1.0.0 • Published 1 year ago

@paint-hub/eslint-config-nuxt-ts v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@paint-hub/eslint-config-nuxt-ts

适用于 NuxtTS 的 ESlint 配置

🏁 安装

npm install @paint-hub/eslint-config-nuxt-ts --save-dev

# or

pnpm add @paint-hub/eslint-config-nuxt-ts -D

🚋 使用

// .eslintrc.js
module.exports = {
  extends: ['@paint-hub/nuxt-ts'],
}

🛠️ 预设规则

以下展示的是默认规则,你可以在你的 .eslintrc.js 中覆盖或添加规则

env: {
  browser: true,
  node: true,
  es2022: true,
},
parserOptions: {
  parser: '@typescript-eslint/parser',
  sourceType: 'module',
},
extends: [
  'plugin:vue/essential',
  'plugin:vue/strongly-recommended',
  'plugin:vue/recommended',
  '@nuxtjs/typescript',
  'plugin:nuxt/recommended',
  'plugin:@paint-hub/specification/base',
  'plugin:prettier/recommended',
  'eslint:recommended',
  'prettier',
],
plugins: ['vue', 'nuxt', 'prettier', '@typescript-eslint', '@paint-hub/specification'],
rules: {
  'vue/html-self-closing': [
    'error',
    {
      html: {
        void: 'always',
        normal: 'never',
        component: 'always',
      },
      svg: 'always',
      math: 'always',
    },
  ],
  'vue/max-attributes-per-line': 'off',
  'vue/singleline-html-element-content-newline': 'off',
  'vue/no-v-html': 'off',
  'vue/multi-word-component-names': 'off',
  'no-console': 'off',
},
overrides: [
  {
    files: ['**/tests/unit/**/*.spec.{j,t}s?(x)'],
    env: {
      jest: true,
    },
  },
],

License

MIT

Copyright (c) 2022-present, Wenhao (Noah) Yu