-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.eslintrc.js
114 lines (114 loc) · 3.56 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
module.exports = {
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
},
env: {
browser: true,
'jest/globals': true
},
rules: {
'array-callback-return': 'error',
'default-case': 'error',
'eol-last': 'error',
'func-call-spacing': ['error', 'never'],
'init-declarations': ['error', 'always'],
'max-len': ['error', { 'ignoreComments': true }, { 'code': 120 }],
'max-lines-per-function': ['error', { 'max': 30 }],
'max-lines': ['warn', { 'max': 500 }],
'no-alert': 'error',
'no-console': 'error',
'no-empty-function': 'error',
'no-extra-parens': 'error',
'no-extra-semi': 'error',
'no-new': "error",
'no-new-func': "error",
'no-trailing-spaces': 'error',
'no-unused-vars': "error",
'semi-spacing': 'error',
complexity: ["error", 6],
indent: ['error', 2],
semi: 'error',
},
overrides: [
{
files: ['*.ts'],
parser: '@typescript-eslint/parser',
plugins: [
'@typescript-eslint',
],
rules: {
'@typescript-eslint/array-type': 'error',
'@typescript-eslint/consistent-type-assertions': 'error',
'@typescript-eslint/explicit-function-return-type': 'error',
'@typescript-eslint/explicit-module-boundary-types': 'error',
'@typescript-eslint/member-delimiter-style': 'error',
'@typescript-eslint/member-ordering': 'error',
'@typescript-eslint/method-signature-style': 'error',
'@typescript-eslint/naming-convention': 'error',
'@typescript-eslint/no-confusing-non-null-assertion': 'error',
'@typescript-eslint/no-empty-interface': 'error',
'@typescript-eslint/no-extra-non-null-assertion': 'error',
'@typescript-eslint/no-misused-new': 'error',
'@typescript-eslint/no-require-imports': 'error',
'@typescript-eslint/type-annotation-spacing': 'error',
'@typescript-eslint/typedef': 'error',
}
},
{
files: ['*.vue'],
parser: 'vue-eslint-parser',
parserOptions: {
sourceType: 'module',
ecmaVersion: 2020,
},
plugins: [
'vue',
],
extends: [
'plugin:vue/recommended',
'plugin:vue/essential',
],
rules: {
'vue/html-indent': ['error', 4],
'vue/multiline-html-element-content-newline': 'error',
'vue/no-dupe-keys': 'error',
'vue/no-duplicate-attributes': 'error',
'vue/no-parsing-error': 'error',
'vue/no-reserved-keys': 'error',
'vue/no-spaces-around-equal-signs-in-attribute': 'error',
'vue/no-unused-components': 'error',
'vue/no-use-v-if-with-v-for': 'error',
'vue/require-render-return': 'error',
'vue/require-v-for-key': 'error',
}
},
{
files: ['*.spec.js'],
extends: [
'plugin:jest/recommended',
],
plugins: [
'jest',
],
rules: {
'max-lines': 'off',
'max-lines-per-function': 'off',
'jest/consistent-test-it': 'error',
'jest/expect-expect': 'error',
'jest/no-commented-out-tests': 'error',
'jest/no-disabled-tests': 'error',
'jest/no-export': 'error',
'jest/no-focused-tests': 'error',
'jest/no-identical-title': 'error',
'jest/no-mocks-import': 'error',
'jest/prefer-strict-equal': 'error',
'jest/prefer-to-be-null': 'error',
'jest/prefer-to-be-undefined': 'error',
'jest/prefer-to-contain': 'error',
'jest/prefer-to-have-length': 'error',
'jest/valid-expect': 'error',
}
}
]
};