-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
73 lines (73 loc) · 2.53 KB
/
.eslintrc.js
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
module.exports = {
// extends: [ 'plugin:vue/vue3-recommended', '@vue/typescript/recommended' ],
plugins: [ '@typescript-eslint' ],
env: {
node: true
},
overrides: [
{
files: [ '*.vue', '*.js' ],
extends: [ 'plugin:vue/vue3-recommended', '@vue/typescript/recommended' ],
rules: {
'vue/multi-word-component-names': 'off',
'no-var': 'error',
'vue/no-unused-vars': 'error',
'@typescript-eslint/no-unused-vars': 'error', // 使用 ts 未使用变量的规则 比如枚举类型在es中会报错
'semi': [ 'error', 'always' ],
'comma-dangle': 'error',
'id-length': 'error',
'object-curly-spacing': [ 'error', 'always' ],
'array-bracket-spacing': [ 'error', 'always' ],
'no-unused-vars': 'error',
'quotes': [ 'error', 'single', { allowTemplateLiterals: true } ],
'no-unreachable': 'error',
'keyword-spacing': 'error',
'semi-spacing': 'error',
'comma-spacing': 'error',
'key-spacing': 'error',
'prefer-const': [
'error',
{
destructuring: 'any',
ignoreReadBeforeAssign: false
}
],
'space-infix-ops': 2,
'no-irregular-whitespace': 2, // 不规则的空白不允许
'vue/html-self-closing': 'off',
'vue/max-attributes-per-line': 'off',
'vue/require-default-prop': 'off'
}
},
{
files: [ '*.ts', '*.tsx' ],
extends: [ 'eslint:recommended', 'plugin:@typescript-eslint/eslint-recommended', 'plugin:@typescript-eslint/recommended' ],
rules: {
'no-var': 'error',
'vue/no-unused-vars': 'error',
'@typescript-eslint/no-unused-vars': 'error', // 使用 ts 未使用变量的规则 比如枚举类型在es中会报错
'semi': [ 'error', 'always' ],
'comma-dangle': 'error',
'id-length': 'error',
'object-curly-spacing': [ 'error', 'always' ],
'array-bracket-spacing': [ 'error', 'always' ],
'no-unused-vars': 'error',
'quotes': [ 'error', 'single', { allowTemplateLiterals: true } ],
'no-unreachable': 'error',
'keyword-spacing': 'error',
'semi-spacing': 'error',
'comma-spacing': 'error',
'key-spacing': 'error',
'prefer-const': [
'error',
{
destructuring: 'any',
ignoreReadBeforeAssign: false
}
],
'space-infix-ops': 2,
'no-irregular-whitespace': 2 // 不规则的空白不允许
}
}
]
};