|
1 |
| -module.exports = { |
2 |
| - extends: ['plugin:vue/base', 'eslint:recommended', 'plugin:vue/vue3-recommended', 'prettier'], |
3 |
| - parser: 'vue-eslint-parser', |
4 |
| - parserOptions: { |
5 |
| - parser: '@typescript-eslint/parser', |
6 |
| - ecmaVersion: 2020, |
7 |
| - sourceType: 'module', |
8 |
| - ecmaFeatures: { |
9 |
| - jsx: true |
| 1 | +import pluginJs from '@eslint/js' |
| 2 | +import pluginVue from 'eslint-plugin-vue' |
| 3 | +import pluginTs from 'typescript-eslint' |
| 4 | +import stylistic from '@stylistic/eslint-plugin' |
| 5 | + |
| 6 | +import parserVue from 'vue-eslint-parser' |
| 7 | +import parserTs from '@typescript-eslint/parser' |
| 8 | + |
| 9 | +export default [ |
| 10 | + pluginJs.configs.recommended, |
| 11 | + stylistic.configs.customize({ |
| 12 | + quoteProps: 'as-needed', |
| 13 | + commaDangle: 'never', |
| 14 | + braceStyle: '1tbs' |
| 15 | + }), |
| 16 | + ...pluginTs.configs.recommended, |
| 17 | + ...pluginVue.configs['flat/recommended'], |
| 18 | + { |
| 19 | + rules: { |
| 20 | + // typescript-eslint |
| 21 | + '@typescript-eslint/no-explicit-any': 'off', |
| 22 | + '@typescript-eslint/ban-types': 'off', |
| 23 | + '@typescript-eslint/no-var-requires': 'off', |
| 24 | + 'no-unused-vars': 'off', |
| 25 | + '@typescript-eslint/no-unused-vars': 'error', |
| 26 | + '@typescript-eslint/ban-ts-comment': 'off', |
| 27 | + // eslint-plugin-vue |
| 28 | + 'vue/v-on-event-hyphenation': [ |
| 29 | + 'error', |
| 30 | + 'always', |
| 31 | + { |
| 32 | + autofix: true |
| 33 | + } |
| 34 | + ], |
| 35 | + 'vue/no-v-html': 'off', |
| 36 | + 'vue/max-attributes-per-line': 'off', |
| 37 | + 'vue/first-attribute-linebreak': 'off', |
| 38 | + 'vue/multi-word-component-names': 'off', |
| 39 | + 'vue/no-v-text-v-html-on-component': 'off', |
| 40 | + // TODO: will be removed |
| 41 | + 'vue/html-self-closing': 'off', |
| 42 | + 'vue/html-closing-bracket-newline': 'off', |
| 43 | + 'vue/singleline-html-element-content-newline': 'off' |
10 | 44 | }
|
11 | 45 | },
|
12 |
| - plugins: ['vue', '@typescript-eslint'], |
13 |
| - env: { |
14 |
| - es6: true, |
15 |
| - node: true, |
16 |
| - browser: true, |
17 |
| - jest: true |
18 |
| - }, |
19 |
| - globals: { |
20 |
| - vi: true, |
21 |
| - NodeJS: true, |
22 |
| - TaroGeneral: true |
23 |
| - }, |
24 |
| - rules: { |
25 |
| - // basic |
26 |
| - semi: [2, 'never'], |
27 |
| - // @typescript-eslint |
28 |
| - '@typescript-eslint/no-explicit-any': 'off', |
29 |
| - '@typescript-eslint/ban-types': 'off', |
30 |
| - '@typescript-eslint/no-var-requires': 'off', |
31 |
| - 'no-unused-vars': 'off', |
32 |
| - '@typescript-eslint/no-unused-vars': 'error', |
33 |
| - // eslint-plugin-vue |
34 |
| - 'vue/v-on-event-hyphenation': [ |
35 |
| - 'error', |
36 |
| - 'always', |
37 |
| - { |
38 |
| - autofix: true |
| 46 | + { |
| 47 | + languageOptions: { |
| 48 | + parser: parserVue, |
| 49 | + globals: { |
| 50 | + vi: true, |
| 51 | + NodeJS: true, |
| 52 | + TaroGeneral: true |
| 53 | + }, |
| 54 | + parserOptions: { |
| 55 | + parser: parserTs, |
| 56 | + ecmaVersion: 2020, |
| 57 | + sourceType: 'module', |
| 58 | + ecmaFeatures: { |
| 59 | + jsx: true |
| 60 | + } |
39 | 61 | }
|
40 |
| - ], |
41 |
| - 'vue/no-v-html': 'off', |
42 |
| - 'vue/first-attribute-linebreak': 'off', |
43 |
| - 'vue/multi-word-component-names': 'off', |
44 |
| - 'vue/no-v-text-v-html-on-component': 'off' |
| 62 | + } |
45 | 63 | }
|
46 |
| -} |
| 64 | +] |
0 commit comments