-
-
Notifications
You must be signed in to change notification settings - Fork 40
/
eslint.config.mjs
93 lines (92 loc) · 2.29 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
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
import pluginVue from 'eslint-plugin-vue'
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'
import markdown from 'eslint-plugin-markdown'
import tseslint from 'typescript-eslint'
export default [
...pluginVue.configs['flat/recommended'],
eslintPluginPrettierRecommended,
...markdown.configs.recommended,
{
rules: {
'object-shorthand': 'error',
'no-debugger': 'error',
'vue/multi-word-component-names': 'off',
'prefer-template': 'error',
'no-restricted-properties': [
'error',
{
object: 'context',
property: 'getSourceCode',
message: 'Use lib/utils/compat.ts'
},
{
object: 'context',
property: 'getFilename',
message: 'Use lib/utils/compat.ts'
},
{
object: 'context',
property: 'getPhysicalFilename',
message: 'Use lib/utils/compat.ts'
},
{
object: 'context',
property: 'getCwd',
message: 'Use lib/utils/compat.ts'
},
{
object: 'context',
property: 'getScope',
message: 'Use lib/utils/compat.ts'
},
{
object: 'context',
property: 'parserServices',
message: 'Use lib/utils/compat.ts'
}
]
}
},
...tseslint.config({
files: ['*.ts', '**/*.ts', '*.mts', '**/*.mts'],
extends: [...tseslint.configs.recommended],
rules: {
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/consistent-type-imports': 'error'
}
}),
{
files: ['*.vue', '**/*.vue'],
languageOptions: {
parserOptions: {
parser: tseslint.parser
}
}
},
{
files: ['js', 'mjs', 'cjs', 'ts', 'mts', 'cts', 'vue'].map(ext => [
`**/*.md/*.${ext}`
]),
rules: {
'prettier/prettier': 'off',
'vue/no-v-html': 'off'
}
},
{
ignores: [
'!docs/.vitepress/',
'!.github/',
'!.vscode/',
'.nyc_output/',
'assets/',
'coverage/',
'dist/',
'docs/.vitepress/cache/',
'docs/.vitepress/dist/',
'lib/configs/**/*.ts',
'node_modules/',
'tests/integrations/'
// 'tests/fixtures/' // Do not specify it here for the test to work.
]
}
]