|
1 | 1 | 'use strict';
|
2 | 2 |
|
3 |
| -const jsRules = { |
4 |
| - files: '*.js', |
5 |
| - parserOptions: { |
6 |
| - ecmaVersion: '2017', |
7 |
| - sourceType: 'module', |
8 |
| - }, |
9 |
| - rules: { |
10 |
| - strict: ['error', 'global'], |
11 |
| - |
12 |
| - 'jsdoc/no-undefined-types': 'warn', |
13 |
| - 'jsdoc/require-param-type': 'warn', |
14 |
| - 'jsdoc/require-returns-type': 'warn', |
15 |
| - }, |
16 |
| -}; |
17 |
| - |
18 |
| -const tsRules = { |
19 |
| - files: '*.ts', |
20 |
| - extends: [ |
21 |
| - 'plugin:@typescript-eslint/eslint-recommended', |
22 |
| - 'plugin:@typescript-eslint/recommended', |
23 |
| - 'plugin:@typescript-eslint/recommended-requiring-type-checking', |
24 |
| - ], |
25 |
| - parser: '@typescript-eslint/parser', |
26 |
| - parserOptions: { |
27 |
| - project: 'tsconfig.json', |
28 |
| - tsconfigRootDir: '.', |
29 |
| - }, |
30 |
| - plugins: ['@typescript-eslint'], |
31 |
| - rules: { |
32 |
| - '@typescript-eslint/ban-ts-comment': 'off', |
33 |
| - '@typescript-eslint/no-floating-promises': 'off', |
34 |
| - 'jsdoc/no-types': 'warn', |
35 |
| - }, |
36 |
| -}; |
37 |
| - |
38 |
| -const vueRules = { |
39 |
| - files: '*.vue', |
40 |
| - extends: ['plugin:vue/essential'], |
41 |
| -}; |
42 |
| - |
43 | 3 | const baseRules = {
|
44 | 4 | env: {
|
45 | 5 | es6: true,
|
@@ -254,9 +214,44 @@ const baseRules = {
|
254 | 214 | },
|
255 | 215 | };
|
256 | 216 |
|
257 |
| -module.exports = { |
258 |
| - baseRules, |
259 |
| - jsRules, |
260 |
| - tsRules, |
261 |
| - vueRules, |
| 217 | +const jsOverrides = { |
| 218 | + files: '*.js', |
| 219 | + parserOptions: { |
| 220 | + ecmaVersion: '2017', |
| 221 | + sourceType: 'module', |
| 222 | + }, |
| 223 | + rules: { |
| 224 | + strict: ['error', 'global'], |
| 225 | + |
| 226 | + 'jsdoc/no-undefined-types': 'warn', |
| 227 | + 'jsdoc/require-param-type': 'warn', |
| 228 | + 'jsdoc/require-returns-type': 'warn', |
| 229 | + }, |
| 230 | +}; |
| 231 | + |
| 232 | +const tsOverrides = { |
| 233 | + files: '*.ts', |
| 234 | + extends: [ |
| 235 | + 'plugin:@typescript-eslint/eslint-recommended', |
| 236 | + 'plugin:@typescript-eslint/recommended', |
| 237 | + 'plugin:@typescript-eslint/recommended-requiring-type-checking', |
| 238 | + ], |
| 239 | + parser: '@typescript-eslint/parser', |
| 240 | + parserOptions: { |
| 241 | + project: 'tsconfig.json', |
| 242 | + tsconfigRootDir: '.', |
| 243 | + }, |
| 244 | + plugins: ['@typescript-eslint'], |
| 245 | + rules: { |
| 246 | + '@typescript-eslint/ban-ts-comment': 'off', |
| 247 | + '@typescript-eslint/no-floating-promises': 'off', |
| 248 | + 'jsdoc/no-types': 'warn', |
| 249 | + }, |
262 | 250 | };
|
| 251 | + |
| 252 | +const vueOverrides = { |
| 253 | + files: '*.vue', |
| 254 | + extends: ['plugin:vue/essential'], |
| 255 | +}; |
| 256 | + |
| 257 | +module.exports = { baseRules, jsOverrides, tsOverrides, vueOverrides }; |
0 commit comments