|
| 1 | +module.exports = { |
| 2 | + env: { |
| 3 | + browser: true, |
| 4 | + node: true, |
| 5 | + }, |
| 6 | + extends: [ |
| 7 | + 'eslint:recommended', |
| 8 | + 'plugin:vue/essential', |
| 9 | + 'plugin:@typescript-eslint/recommended', |
| 10 | + '@vue/typescript/recommended', |
| 11 | + 'prettier', |
| 12 | + './.eslintrc-auto-import.json', |
| 13 | + ], |
| 14 | + ignorePatterns: [ |
| 15 | + '.eslintrc.js', |
| 16 | + 'vite.build.config.ts', |
| 17 | + 'vite.config.ts', |
| 18 | + '*.bk.vue', |
| 19 | + ], |
| 20 | + overrides: [ |
| 21 | + { |
| 22 | + files: [ |
| 23 | + '**/*.spec.{j,t}s?(x)', |
| 24 | + ], |
| 25 | + env: { |
| 26 | + jest: true, |
| 27 | + }, |
| 28 | + }, |
| 29 | + ], |
| 30 | + globals: { |
| 31 | + Entry: true, |
| 32 | + }, |
| 33 | + parserOptions: { |
| 34 | + parser: '@typescript-eslint/parser', |
| 35 | + }, |
| 36 | + plugins: [ |
| 37 | + '@typescript-eslint', |
| 38 | + 'import', |
| 39 | + 'prettier', |
| 40 | + 'vue', |
| 41 | + ], |
| 42 | + root: true, |
| 43 | + settings: { |
| 44 | + 'import/resolver': { |
| 45 | + 'babel-module': {}, |
| 46 | + }, |
| 47 | + }, |
| 48 | + rules: { |
| 49 | + '@typescript-eslint/ban-ts-comment': 0, |
| 50 | + '@typescript-eslint/ban-types': [ |
| 51 | + 'error', |
| 52 | + { |
| 53 | + 'extendDefaults': true, |
| 54 | + 'types': { |
| 55 | + '{}': false, |
| 56 | + } |
| 57 | + }, |
| 58 | + ], |
| 59 | + '@typescript-eslint/no-empty-function': 0, |
| 60 | + 'brace-style': ['error', 'stroustrup'], |
| 61 | + 'default-case': [ |
| 62 | + 'error', { |
| 63 | + commentPattern: '^skip\\sdefault', |
| 64 | + }, |
| 65 | + ], |
| 66 | + 'func-names': ['error', 'never'], |
| 67 | + 'function-paren-newline': 0, |
| 68 | + 'import/no-self-import': 0, |
| 69 | + 'import/no-extraneous-dependencies': 0, |
| 70 | + 'implicit-arrow-linebreak': ['warn', 'beside'], |
| 71 | + indent: [2, 'tab', { SwitchCase: 1 }], |
| 72 | + 'no-tabs': [0, { allowIndentationTabs: true }], |
| 73 | + 'linebreak-style': 0, |
| 74 | + 'max-len': 0, |
| 75 | + 'no-else-return': ['error', { allowElseIf: true }], |
| 76 | + 'no-console': ['warn', { allow: ['warn', 'error', 'info', 'trace'] }], |
| 77 | + 'no-const-assign': 'error', |
| 78 | + 'no-debugger': 0, |
| 79 | + 'no-new': 0, |
| 80 | + 'no-undef': 0, |
| 81 | + 'no-unused-vars': 1, |
| 82 | + 'no-use-before-define': 0, |
| 83 | + 'no-useless-escape': 0, |
| 84 | + 'no-param-reassign': [ |
| 85 | + 'error', { |
| 86 | + props: true, |
| 87 | + ignorePropertyModificationsFor: ['field', 'model', 'el', 'item', 'state', 'Vue', 'vue'], |
| 88 | + }, |
| 89 | + ], |
| 90 | + 'no-underscore-dangle': [ |
| 91 | + 'error', { |
| 92 | + allow: ['_data'], |
| 93 | + allowAfterThis: true, |
| 94 | + }, |
| 95 | + ], |
| 96 | + 'no-plusplus': [ |
| 97 | + 'error', { allowForLoopAfterthoughts: true }, |
| 98 | + ], |
| 99 | + 'object-curly-newline': ['error', { |
| 100 | + ObjectPattern: { multiline: false }, |
| 101 | + }], |
| 102 | + 'operator-linebreak': ['error', 'after'], |
| 103 | + 'prefer-destructuring': [ |
| 104 | + 'error', { |
| 105 | + array: false, |
| 106 | + object: false, |
| 107 | + }, |
| 108 | + { |
| 109 | + enforceForRenamedProperties: false, |
| 110 | + }, |
| 111 | + ], |
| 112 | + 'space-before-function-paren': ['error', { |
| 113 | + anonymous: 'never', |
| 114 | + named: 'never', |
| 115 | + asyncArrow: 'always', |
| 116 | + }], |
| 117 | + 'vue/attributes-order': ['error', { |
| 118 | + 'alphabetical': true, |
| 119 | + 'order': [ |
| 120 | + 'DEFINITION', |
| 121 | + 'LIST_RENDERING', |
| 122 | + 'CONDITIONALS', |
| 123 | + 'RENDER_MODIFIERS', |
| 124 | + 'GLOBAL', |
| 125 | + ['UNIQUE', 'SLOT'], |
| 126 | + 'TWO_WAY_BINDING', |
| 127 | + 'OTHER_DIRECTIVES', |
| 128 | + 'OTHER_ATTR', |
| 129 | + 'EVENTS', |
| 130 | + 'CONTENT', |
| 131 | + ], |
| 132 | + }], |
| 133 | + 'vue/html-closing-bracket-newline': 0, |
| 134 | + 'vue/html-indent': 0, |
| 135 | + 'vue/html-self-closing': 0, |
| 136 | + 'vue/max-attributes-per-line': 0, |
| 137 | + 'vue/no-multiple-template-root': 0, |
| 138 | + 'vue/no-template-shadow': 0, |
| 139 | + 'vue/no-v-for-template-key': 0, |
| 140 | + 'vue/no-v-html': 0, |
| 141 | + 'vue/singleline-html-element-content-newline': 0, |
| 142 | + 'vue/sort-keys': ['error', 'asc', { |
| 143 | + caseSensitive: true, |
| 144 | + ignoreChildrenOf: ['model', 'defineProps'], |
| 145 | + ignoreGrandchildrenOf: ['computed', 'directives', 'inject', 'props', 'watch', 'defineProps'], |
| 146 | + minKeys: 2, |
| 147 | + natural: true, |
| 148 | + }], |
| 149 | + 'vue/valid-template-root': 0, |
| 150 | + }, |
| 151 | +}; |
0 commit comments