-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc.js
251 lines (251 loc) · 11.2 KB
/
.eslintrc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
module.exports = {
extends: [
'@vue/typescript/recommended',
'plugin:@typescript-eslint/recommended',
'eslint:recommended',
'plugin:import/recommended',
'plugin:import/typescript',
'plugin:vue/vue3-essential',
],
plugins: [
'no-relative-import-paths',
'only-warn',
],
rules: {
'@typescript-eslint/array-type': 'warn',
'@typescript-eslint/brace-style': ['warn', '1tbs'],
'@typescript-eslint/class-literal-property-style': ['warn', 'fields'],
'@typescript-eslint/comma-dangle': ['warn', { arrays: 'always-multiline', objects: 'always-multiline', imports: 'never', exports: 'never', functions: 'always-multiline' }],
'@typescript-eslint/comma-spacing': 'warn',
'@typescript-eslint/consistent-indexed-object-style': ['warn', 'record'],
'@typescript-eslint/consistent-type-exports': 'warn',
'@typescript-eslint/explicit-function-return-type': ['warn', { allowExpressions: true }],
'@typescript-eslint/explicit-member-accessibility': 'warn',
'@typescript-eslint/func-call-spacing': 'warn',
'@typescript-eslint/indent': ['warn', 2, { 'SwitchCase': 1 }],
'@typescript-eslint/keyword-spacing': ['warn', { before: true, after: true }],
'@typescript-eslint/member-delimiter-style': ['warn', { multiline: { delimiter: 'comma', requireLast: true }, singleline: { delimiter: 'comma', requireLast: false } }],
'@typescript-eslint/method-signature-style': ['warn', 'property'],
'@typescript-eslint/no-base-to-string': 'warn',
'@typescript-eslint/no-confusing-non-null-assertion': 'warn',
'@typescript-eslint/no-dupe-class-members': 'error',
'@typescript-eslint/no-extra-parens': 'warn',
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/no-inferrable-types': 'off',
'@typescript-eslint/no-non-null-asserted-nullish-coalescing': 'warn',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-require-imports': 'warn',
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'warn',
'@typescript-eslint/no-unnecessary-condition': 'warn',
'@typescript-eslint/no-unnecessary-qualifier': 'warn',
'@typescript-eslint/no-unnecessary-type-arguments': 'warn',
'@typescript-eslint/no-unused-expressions': 'warn',
'@typescript-eslint/no-unused-vars': ['warn', { ignoreRestSiblings: true }],
'@typescript-eslint/no-useless-constructor': 'warn',
'@typescript-eslint/non-nullable-type-assertion-style': 'warn',
'@typescript-eslint/object-curly-spacing': ['warn', 'always'],
'@typescript-eslint/parameter-properties': 'warn',
'@typescript-eslint/prefer-enum-initializers': 'warn',
'@typescript-eslint/prefer-for-of': 'warn',
'@typescript-eslint/prefer-includes': 'warn',
'@typescript-eslint/prefer-nullish-coalescing': ['warn', { ignoreConditionalTests: true }],
'@typescript-eslint/prefer-optional-chain': 'warn',
'@typescript-eslint/prefer-readonly': 'warn',
'@typescript-eslint/prefer-reduce-type-parameter': 'warn',
'@typescript-eslint/prefer-string-starts-ends-with': 'warn',
'@typescript-eslint/prefer-ts-expect-error': 'warn',
'@typescript-eslint/quotes': ['warn', 'single', { avoidEscape: true }],
'@typescript-eslint/require-array-sort-compare': 'warn',
'@typescript-eslint/semi': ['warn', 'never'],
'@typescript-eslint/space-before-function-paren': ['warn', {anonymous: 'never', named: 'never', asyncArrow: 'always'}],
'@typescript-eslint/switch-exhaustiveness-check': 'warn',
'@typescript-eslint/type-annotation-spacing': 'warn',
'@typescript-eslint/unified-signatures': ['warn', {ignoreDifferentlyNamedParameters: true}],
'array-bracket-newline': 'warn',
'array-bracket-spacing': 'warn',
'array-callback-return': 'warn',
'arrow-spacing': 'warn',
'brace-style': ['warn', '1tbs'],
'camelcase': 'warn',
'comma-dangle': ['warn', { arrays: 'always-multiline', objects: 'always-multiline', imports: 'never', exports: 'never', functions: 'always-multiline' }],
'comma-spacing': 'warn',
'curly': 'warn',
'default-case-last': 'warn',
'default-case': 'warn',
'dot-location': ['warn', 'property'],
'dot-notation': 'warn',
'func-call-spacing': 'warn',
'id-length': ['warn', { exceptions: ['x', 'y', 'i'] }],
'implicit-arrow-linebreak': 'warn',
'import/no-duplicates': 'warn',
'import/order': ['warn', { 'alphabetize': { 'order': 'asc', 'caseInsensitive': true } }],
'import/named': 'off',
'import/namespace': 'off',
'import/default': 'off',
'import/no-named-as-default-member': 'off',
'import/no-unresolved': 'off',
'indent': ['warn', 2, { 'SwitchCase': 1 }],
'key-spacing': ['warn', { afterColon: true }],
'keyword-spacing': ['warn', { before: true, after: true }],
'line-comment-position': ['warn', { position: 'above' }],
'max-classes-per-file': 'warn',
'max-params': 'warn',
'no-alert': 'error',
'no-await-in-loop': 'warn',
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-constructor-return': 'warn',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-duplicate-imports': 'warn',
'no-else-return': 'warn',
'no-extra-parens': 'warn',
'no-lonely-if': 'warn',
'no-multi-spaces': 'warn',
'no-multiple-empty-lines': 'warn',
'no-nested-ternary': 'error',
'no-redeclare': 'off',
'no-relative-import-paths/no-relative-import-paths': ['warn', { rootDir: 'src', prefix: '@' }],
'no-self-compare': 'warn',
'no-tabs': 'warn',
'no-trailing-spaces': 'warn',
'no-unmodified-loop-condition': 'warn',
'no-unneeded-ternary': 'warn',
'no-unreachable-loop': 'warn',
'no-unused-expressions': 'warn',
'no-unused-private-class-members': 'warn',
'no-useless-call': 'warn',
'no-useless-concat': 'warn',
'no-useless-constructor': 'warn',
'no-useless-return': 'warn',
'no-whitespace-before-property': 'warn',
'object-curly-newline': ['warn', { multiline: true, consistent: true }],
'object-curly-spacing': ['warn', 'always'],
'object-property-newline': ['warn', { 'allowAllPropertiesOnSameLine': true }],
'one-var-declaration-per-line': 'warn',
'prefer-arrow-callback': 'warn',
'prefer-destructuring': 'warn',
'prefer-exponentiation-operator': 'warn',
'prefer-promise-reject-errors': 'warn',
'prefer-rest-params': 'warn',
'prefer-spread': 'warn',
'prefer-template': 'warn',
'quotes': ['warn', 'single', { avoidEscape: true }],
'require-await': 'warn',
'rest-spread-spacing': 'warn',
'semi-spacing': 'warn',
'semi-style': ['warn', 'last'],
'semi': ['warn', 'never'],
'space-before-blocks': 'warn',
'space-before-function-paren': ['warn', {anonymous: 'never', named: 'never', asyncArrow: 'always'}],
'space-in-parens': 'warn',
'space-infix-ops': 'warn',
'spaced-comment': ['warn', 'always', { 'markers': ['/'] }],
'switch-colon-spacing': 'warn',
'vue/array-bracket-newline': 'warn',
'vue/array-bracket-spacing': 'warn',
'vue/arrow-spacing': 'warn',
'vue/attribute-hyphenation': 'warn',
'vue/attributes-order': 'warn',
'vue/block-lang': ['warn', { script: { lang: 'ts' }, style: { lang: ['css'] } }],
'vue/block-tag-newline': 'warn',
'vue/brace-style': ['warn', '1tbs'],
'vue/camelcase': 'warn',
'vue/comma-dangle': ['warn', { arrays: 'always-multiline', objects: 'always-multiline', imports: 'never', exports: 'never', functions: 'never' }],
'vue/comma-spacing': 'warn',
'vue/component-definition-name-casing': 'warn',
'vue/component-name-in-template-casing': 'off',
'vue/component-options-name-casing': 'warn',
'vue/component-tags-order': ['warn', { order: ['template', 'script', 'style'] }],
'vue/custom-event-name-casing': 'warn',
'vue/dot-location': ['warn', 'property'],
'vue/dot-notation': 'warn',
'vue/first-attribute-linebreak': 'warn',
'vue/func-call-spacing': 'warn',
'vue/html-button-has-type': 'warn',
'vue/html-closing-bracket-newline': 'warn',
'vue/html-closing-bracket-spacing': 'warn',
'vue/html-comment-content-newline': 'warn',
'vue/html-comment-content-spacing': 'warn',
'vue/html-comment-indent': 'warn',
'vue/html-end-tags': 'warn',
'vue/html-indent': 'warn',
'vue/html-quotes': 'warn',
'vue/html-self-closing': 'warn',
'vue/key-spacing': ['warn', { afterColon: true }],
'vue/keyword-spacing': ['warn', { before: true, after: true }],
'vue/match-component-file-name': 'warn',
'vue/max-attributes-per-line': ['warn', { singleline: { max: 5 }, multiline: { max: 1 } }],
'vue/multi-word-component-names': 'warn',
'vue/multiline-html-element-content-newline': 'warn',
'vue/mustache-interpolation-spacing': 'warn',
'vue/new-line-between-multi-line-property': 'warn',
'vue/next-tick-style': 'warn',
'vue/no-boolean-default': 'warn',
'vue/no-child-content': 'warn',
'vue/no-duplicate-attr-inheritance': 'warn',
'vue/no-empty-component-block': 'warn',
'vue/no-expose-after-await': 'warn',
'vue/no-extra-parens': 'warn',
'vue/no-invalid-model-keys': 'warn',
'vue/no-lone-template': 'warn',
'vue/no-multi-spaces': 'warn',
'vue/no-multiple-objects-in-class': 'warn',
'vue/no-multiple-slot-args': 'warn',
'vue/no-potential-component-option-typo': 'warn',
'vue/no-reserved-component-names': 'warn',
'vue/no-spaces-around-equal-signs-in-attribute': 'warn',
'vue/no-static-inline-styles': 'warn',
'vue/no-template-shadow': 'warn',
'vue/no-this-in-before-route-enter': 'warn',
'vue/no-undef-properties': 'warn',
'vue/no-unused-properties': 'warn',
'vue/no-unused-refs': 'warn',
'vue/no-use-computed-property-like-method': 'warn',
'vue/no-useless-concat': 'warn',
'vue/no-useless-mustaches': 'warn',
'vue/no-useless-v-bind': 'warn',
'vue/no-v-html': 'warn',
'vue/no-v-text': 'warn',
'vue/object-curly-newline': ['warn', { multiline: true, consistent: true }],
'vue/object-curly-spacing': ['warn', 'always'],
'vue/object-property-newline': ['warn', { 'allowAllPropertiesOnSameLine': true }],
'vue/one-component-per-file': 'warn',
'vue/order-in-components': 'warn',
'vue/padding-line-between-blocks': 'warn',
'vue/prefer-separate-static-class': 'warn',
'vue/prefer-template': 'warn',
'vue/prop-name-casing': 'warn',
'vue/require-default-prop': 'warn',
'vue/require-direct-export': 'warn',
'vue/require-explicit-emits': 'warn',
'vue/require-expose': 'warn',
'vue/require-name-property': 'warn',
'vue/require-prop-types': 'warn',
'vue/script-indent': ['warn', 2, { baseIndent: 1, switchCase: 1 }],
'vue/singleline-html-element-content-newline': 'warn',
'vue/space-in-parens': 'warn',
'vue/this-in-template': 'warn',
'vue/v-bind-style': 'warn',
'vue/v-on-event-hyphenation': 'warn',
'vue/v-on-function-call': 'warn',
'vue/v-on-style': 'warn',
'vue/v-slot-style': 'warn',
'yoda': 'warn',
},
overrides: [
{
files: ['**/*.vue'],
rules: {
'@typescript-eslint/indent': 'off',
'indent': 'off',
'func-call-spacing': 'off',
}
},
{
files: ['**/*.ts', '**/*.vue'],
rules: {
'no-case-declarations': 'off',
'default-case': 'off'
}
}
]
}