|
| 1 | +module.exports = { |
| 2 | + extends: [ |
| 3 | + 'airbnb-base', |
| 4 | + 'airbnb-typescript/base', // https://www.npmjs.com/package/eslint-config-airbnb-typescript |
| 5 | + 'plugin:vue/vue3-recommended', |
| 6 | + '@vue/typescript/recommended', |
| 7 | + 'eslint:recommended', // https://eslint.org/docs/rules/ |
| 8 | + 'plugin:jsx-a11y/strict', // https://www.npmjs.com/package/eslint-plugin-jsx-a11y |
| 9 | + ], |
| 10 | + env: { |
| 11 | + browser: true, |
| 12 | + es6: true, |
| 13 | + node: true, |
| 14 | + }, |
| 15 | + plugins: [ |
| 16 | + '@typescript-eslint', |
| 17 | + 'jsx-a11y', |
| 18 | + ], |
| 19 | + parserOptions: { |
| 20 | + project: './tsconfig.json', |
| 21 | + extraFileExtensions: ['.vue'], |
| 22 | + ecmaFeatures: { |
| 23 | + jsx: true, |
| 24 | + tsx: true, |
| 25 | + }, |
| 26 | + ecmaVersion: 2020, |
| 27 | + useJSXTextNode: true, |
| 28 | + sourceType: 'module', |
| 29 | + }, |
| 30 | + rules: { |
| 31 | + // eslint |
| 32 | + 'import/export': 'off', |
| 33 | + 'import/prefer-default-export': 'off', |
| 34 | + 'no-unused-vars': 'off', |
| 35 | + 'no-undef': 'off', |
| 36 | + 'prefer-rest-params': 'off', |
| 37 | + 'no-async-promise-executor': 'off', |
| 38 | + 'prefer-promise-reject-errors': 'off', |
| 39 | + 'import/extensions': 'off', |
| 40 | + 'no-nested-ternary': 'off', |
| 41 | + 'no-spaced-func': 'off', |
| 42 | + 'import/no-unresolved': 'off', |
| 43 | + // jsx |
| 44 | + 'jsx-a11y/click-events-have-key-events': 'off', |
| 45 | + 'jsx-a11y/no-static-element-interactions': 'off', |
| 46 | + 'jsx-a11y/anchor-is-valid': 'off', |
| 47 | + 'jsx-a11y/no-noninteractive-tabindex': 'off', |
| 48 | + 'jsx-a11y/no-noninteractive-element-interactions': 'off', |
| 49 | + // 代码风格 |
| 50 | + 'vue/multi-word-component-names': 'off', |
| 51 | + 'arrow-parens': 'off', |
| 52 | + 'no-else-return': 'off', |
| 53 | + 'jsx-quotes': ['error', 'prefer-double'], |
| 54 | + 'import/no-cycle': 'off', |
| 55 | + 'import/no-extraneous-dependencies': 'off', |
| 56 | + 'import/no-named-as-default-member': 'off', |
| 57 | + 'operator-linebreak': 'off', |
| 58 | + 'import/order': 'off', |
| 59 | + 'linebreak-style': 'off', |
| 60 | + 'no-console': 'off', |
| 61 | + 'class-methods-use-this': 'off', |
| 62 | + 'max-classes-per-file': 'off', |
| 63 | + 'consistent-return': 'off', |
| 64 | + 'default-case': 'off', |
| 65 | + 'global-require': 'off', |
| 66 | + 'import/no-dynamic-require': 'off', |
| 67 | + 'generator-star-spacing': 'off', |
| 68 | + 'max-len': ['error', { 'code': 130 }], |
| 69 | + // javascript |
| 70 | + 'func-names': 'off', |
| 71 | + 'no-bitwise': 'off', |
| 72 | + 'no-plusplus': 'off', |
| 73 | + 'prefer-template': 'off', |
| 74 | + 'object-curly-newline': 'off', |
| 75 | + 'no-param-reassign': 'off', |
| 76 | + 'no-restricted-globals': 'off', |
| 77 | + 'no-underscore-dangle': 'off', |
| 78 | + 'no-restricted-syntax': 'off', |
| 79 | + 'no-useless-escape': 'off', |
| 80 | + 'no-confusing-arrow': 'off', |
| 81 | + 'no-new': 'off', |
| 82 | + 'no-void': 'off', |
| 83 | + 'prefer-rest-params': 'off', |
| 84 | + 'no-async-promise-executor': 'off', |
| 85 | + 'no-case-declarations': 'off', |
| 86 | + // typescript |
| 87 | + '@typescript-eslint/no-var-requires': 'off', |
| 88 | + '@typescript-eslint/no-inferrable-types': 'off', |
| 89 | + '@typescript-eslint/naming-convention': 'off', |
| 90 | + '@typescript-eslint/no-unnecessary-type-assertion': 'off', |
| 91 | + '@typescript-eslint/no-unused-vars': 'off', |
| 92 | + '@typescript-eslint/no-useless-constructor': 'off', |
| 93 | + '@typescript-eslint/no-use-before-define': 'off', |
| 94 | + '@typescript-eslint/no-unsafe-assignment': 'off', |
| 95 | + '@typescript-eslint/await-thenable': 'off', |
| 96 | + '@typescript-eslint/no-namespace': 'off', |
| 97 | + '@typescript-eslint/prefer-regexp-exec': 'off', |
| 98 | + '@typescript-eslint/explicit-module-boundary-types': 'off', |
| 99 | + '@typescript-eslint/no-explicit-any': 'off', |
| 100 | + '@typescript-eslint/ban-ts-comment': 'off', |
| 101 | + '@typescript-eslint/ban-types': 'off', |
| 102 | + '@typescript-eslint/no-this-alias': 'off', |
| 103 | + '@typescript-eslint/no-unsafe-call:': 'off', |
| 104 | + '@typescript-eslint/no-unsafe-member-access': 'off', |
| 105 | + '@typescript-eslint/no-floating-promises': 'off', |
| 106 | + '@typescript-eslint/restrict-plus-operands': 'off', |
| 107 | + '@typescript-eslint/restrict-template-expressions': 'off', |
| 108 | + '@typescript-eslint/no-misused-promises': 'off', |
| 109 | + '@typescript-eslint/no-unsafe-return': 'off', |
| 110 | + '@typescript-eslint/unbound-method': 'off', |
| 111 | + '@typescript-eslint/no-unsafe-argument': 'off', |
| 112 | + // vue - https://eslint.vuejs.org/rules/ |
| 113 | + 'vue/require-default-prop': 'off', |
| 114 | + 'vue/singleline-html-element-content-newline': 'off', |
| 115 | + 'vue/multiline-html-element-content-newline': 'off', |
| 116 | + 'vue/max-attributes-per-line': ['warn', { |
| 117 | + singleline: { |
| 118 | + max: 3, |
| 119 | + }, |
| 120 | + multiline: { |
| 121 | + max: 1, |
| 122 | + } |
| 123 | + }] |
| 124 | + }, |
| 125 | +} |
0 commit comments