-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patheslint.config.mjs
67 lines (61 loc) · 1.97 KB
/
eslint.config.mjs
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
import eslint from '@eslint/js';
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
import simpleImportSort from 'eslint-plugin-simple-import-sort';
import unusedImports from 'eslint-plugin-unused-imports';
import pluginVue from 'eslint-plugin-vue';
import tseslint from 'typescript-eslint';
export default tseslint.config(
// global ignores
{
ignores: ['dist/', '.yarn/']
},
// presets
eslint.configs.recommended,
...tseslint.configs.recommended,
...pluginVue.configs['flat/recommended'],
eslintPluginPrettierRecommended,
// register parser options
{
files: ['**/*.ts', '**/*.tsx', '**/*.vue'],
languageOptions: {
parserOptions: {
parser: tseslint.parser,
extraFileExtensions: ['.vue'],
projectService: true
},
// not sure why some of these TS generics are needed.
// will circle back when Vue officially updates to ESLint 9
globals: {
Omit: false,
Record: false
}
}
},
// plugins & configs
{
plugins: {
'unused-imports': unusedImports,
'simple-import-sort': simpleImportSort
},
rules: {
'no-console': 'off',
'no-debugger': 'off',
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
'prettier/prettier': 'warn',
'no-unused-vars': 'off',
'unused-imports/no-unused-imports': 'error',
'unused-imports/no-unused-vars': [
'warn',
{
vars: 'all',
varsIgnorePattern: '^_',
args: 'all',
argsIgnorePattern: '^_'
}
]
// 'vue/multi-word-component-names': 'off',
// 'vue/no-reserved-component-names': 'off'
}
}
);