-
Notifications
You must be signed in to change notification settings - Fork 375
/
Copy patheslint.config.mjs
76 lines (74 loc) · 1.81 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
import js from '@eslint/js'
import { configureVueProject, defineConfigWithVueTs, vueTsConfigs } from '@vue/eslint-config-typescript'
import pluginVue from 'eslint-plugin-vue'
import globals from 'globals'
configureVueProject({
scriptLangs: ['ts', 'js', 'tsx', 'jsx']
})
export default defineConfigWithVueTs(
{
ignores: [
'.vscode',
'docs',
'**/dist',
'**/public',
'**/package-lock.json',
'**/node_modules',
'**/tmp',
'**/temp',
'mockServer',
'**/bin',
'**/expected',
'**/output',
'**/test'
]
},
{
files: ['**/*.{js,mjs,jsx,ts,mts,tsx,vue}']
},
js.configs.recommended,
pluginVue.configs['flat/essential'],
vueTsConfigs.recommended,
{
languageOptions: {
globals: {
...globals.browser,
...globals.worker,
...globals.node,
...globals.jest
}
},
rules: {
'no-console': 'error',
'no-debugger': 'error',
'no-eq-null': 'error',
'no-extra-semi': 'off',
'no-eval': 'error',
'space-before-function-paren': 'off',
'vue/multi-word-component-names': 'off',
'vue/prefer-import-from-vue': 'off',
// 允许 @ts-ignore
'@typescript-eslint/ban-ts-comment': 'off',
// 允许非空断言
'@typescript-eslint/no-non-null-asserted-optional-chain': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-use-before-define': 'error',
'@typescript-eslint/no-unused-vars': [
'error',
{
ignoreRestSiblings: true,
varsIgnorePattern: '^_',
argsIgnorePattern: '^_',
caughtErrors: 'none'
}
]
}
},
{
files: ['scripts/**/*'],
rules: {
'no-console': 'off',
'@typescript-eslint/no-require-imports': 'off'
}
}
)