|
1 |
| -module.exports = { |
2 |
| - env: { |
3 |
| - browser: true, |
4 |
| - es6: true, |
5 |
| - amd: true |
6 |
| - }, |
7 |
| - extends: ['plugin:vue/vue3-recommended', 'plugin:prettier-vue/recommended'], |
8 |
| - parser: 'vue-eslint-parser', |
9 |
| - parserOptions: { |
10 |
| - parser: { |
11 |
| - js: '@babel/eslint-parser', |
12 |
| - ts: '@typescript-eslint/parser' |
13 |
| - }, |
14 |
| - requireConfigFile: false, |
15 |
| - sourceType: 'module' |
16 |
| - }, |
17 |
| - rules: { |
18 |
| - /** |
19 |
| - * TODO: fix project import issues and then enable it |
20 |
| - * 'sort-imports': 'warn', |
21 |
| - */ |
22 |
| - 'require-await': 'warn', |
23 |
| - 'no-new': 'off', |
24 |
| - 'node/no-callback-literal': 'off', |
25 |
| - 'unused-imports/no-unused-imports': 'error', |
26 |
| - 'nonblock-statement-body-position': ['error', 'below'], |
27 |
| - curly: 'error', |
| 1 | +import unusedImports from 'eslint-plugin-unused-imports' |
| 2 | +import eslintConfigPrettier from 'eslint-plugin-prettier/recommended' |
| 3 | +import tseslint from 'typescript-eslint' |
| 4 | +import globals from 'globals' |
| 5 | +import pluginVue from 'eslint-plugin-vue' |
| 6 | + |
| 7 | +export default [ |
| 8 | + ...tseslint.configs.recommended, |
| 9 | + ...pluginVue.configs['flat/recommended'], |
| 10 | + eslintConfigPrettier, |
28 | 11 |
|
29 |
| - // Vue 3 rules: (need to be fixed, but can be done incrementally) |
30 |
| - 'vue/no-deprecated-events-api': 'warn' |
31 |
| - }, |
32 |
| - globals: { |
33 |
| - require: false, |
34 |
| - requirejs: false |
35 |
| - }, |
36 |
| - plugins: ['unused-imports'], |
37 |
| - overrides: [ |
38 |
| - { |
39 |
| - files: ['**/*.vue'], |
40 |
| - extends: ['plugin:vue/recommended', 'plugin:prettier-vue/recommended'], |
41 |
| - rules: { |
42 |
| - 'vue/multi-word-component-names': 'warn', |
43 |
| - 'vue/no-multiple-template-root': 'off', |
44 |
| - 'vue/no-v-model-argument': 'off', |
45 |
| - 'vue/no-v-text-v-html-on-component': 'warn' |
| 12 | + { |
| 13 | + languageOptions: { |
| 14 | + ecmaVersion: 5, |
| 15 | + globals: { |
| 16 | + ...globals.browser, |
| 17 | + ...globals.amd, |
| 18 | + require: false, |
| 19 | + requirejs: false |
| 20 | + }, |
| 21 | + parserOptions: { |
| 22 | + parser: { |
| 23 | + js: '@babel/eslint-parser', |
| 24 | + ts: '@typescript-eslint/parser', |
| 25 | + vue: 'vue-eslint-parser' |
| 26 | + }, |
| 27 | + requireConfigFile: false, |
| 28 | + sourceType: 'module' |
46 | 29 | }
|
47 | 30 | },
|
48 |
| - { |
49 |
| - files: ['**/*.ts'], |
50 |
| - parser: '@typescript-eslint/parser', |
51 |
| - extends: ['plugin:@typescript-eslint/recommended'], |
52 |
| - rules: { |
53 |
| - '@typescript-eslint/no-extra-semi': 'off', |
54 |
| - '@typescript-eslint/no-explicit-any': 'off', |
55 |
| - '@typescript-eslint/no-unused-vars': 'warn', |
56 |
| - 'prefer-const': 'warn' |
57 |
| - } |
| 31 | + |
| 32 | + plugins: { |
| 33 | + 'unused-imports': unusedImports |
| 34 | + }, |
| 35 | + |
| 36 | + rules: { |
| 37 | + '@typescript-eslint/ban-ts-comment': 'off', |
| 38 | + '@typescript-eslint/no-empty-object-type': 'off', |
| 39 | + '@typescript-eslint/no-explicit-any': 'off', |
| 40 | + '@typescript-eslint/no-extra-semi': 'off', |
| 41 | + '@typescript-eslint/no-require-imports': 'off', |
| 42 | + '@typescript-eslint/no-this-alias': 'warn', |
| 43 | + '@typescript-eslint/no-unused-expressions': 'off', |
| 44 | + '@typescript-eslint/no-unused-vars': 'warn', |
| 45 | + |
| 46 | + 'no-new': 'off', |
| 47 | + 'node/no-callback-literal': 'off', |
| 48 | + 'prefer-const': 'warn', |
| 49 | + 'require-await': 'warn', |
| 50 | + // 'sort-imports': 'warn', TODO: fix project import issues and then enable it |
| 51 | + 'unused-imports/no-unused-imports': 'error', |
| 52 | + |
| 53 | + 'vue/multi-word-component-names': 'warn', |
| 54 | + 'vue/no-multiple-template-root': 'off', |
| 55 | + 'vue/no-v-model-argument': 'off', |
| 56 | + 'vue/no-v-text-v-html-on-component': 'warn' |
58 | 57 | }
|
59 |
| - ] |
60 |
| -} |
| 58 | + } |
| 59 | +] |
0 commit comments