-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.js
131 lines (131 loc) · 3.82 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
module.exports = {
env: {
browser: true,
es6: true,
node: true
},
extends: ['plugin:vue/recommended', '@vue/typescript/recommended'],
parserOptions: {
ecmaVersion: 2020
},
plugins: [
'import',
'jest',
'new-with-error',
'simple-import-sort',
'sort-class-members',
'sort-destructure-keys',
'switch-case'
],
root: true,
rules: {
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/indent': ['error', 2, {
SwitchCase: 1,
flatTernaryExpressions: true,
offsetTernaryExpressions: false
}],
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'arrow-body-style': ['error', 'as-needed', {
requireReturnForObjectLiteral: false
}],
'class-methods-use-this': 'off',
'comma-dangle': ['error', 'never'],
'comma-spacing': ['error', {
'after': true,
'before': false
}],
curly: ['error', 'all'],
'id-length': ['error', {
exceptions: ['e', 'i', 'h', 't']
}],
'id-match': ['error', '_count|^[a-zA-Z][a-zA-Z0-9]*$|^[A-Z][_A-Z0-9]+[A-Z0-9]$', {
onlyDeclarations: true,
properties: true
}],
'import/extensions': ['error', {
'component': 'ignorePackages',
'container': 'ignorePackages',
'context': 'ignorePackages',
'json': 'ignorePackages',
'md': 'ignorePackages',
'provider': 'ignorePackages',
'scene': 'ignorePackages',
'vue': 'ignorePackages'
}],
'import/first': 'error',
'import/newline-after-import': 'error',
'import/order': 'off',
'import/prefer-default-export': 'off',
indent: 'off',
'jsx-quotes': ['error', 'prefer-single'],
'lines-around-comment': ['error', {
afterBlockComment: false,
allowBlockStart: true,
beforeBlockComment: true
}],
'max-len': ['error', {
code: 125,
comments: 100,
ignoreComments: false,
ignoreRegExpLiterals: true,
ignoreStrings: false,
ignoreTemplateLiterals: true,
ignoreTrailingComments: false,
ignoreUrls: true,
tabWidth: 2
}],
'max-params': ['error', 3],
'no-console': ['error', {
allow: ['error', 'info']
}],
'no-duplicate-imports': 'error',
'no-multiple-empty-lines': ['error', {
max: 1
}],
'no-restricted-syntax': ['error', {
// eslint-disable-next-line max-len
message: 'for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array.',
selector: 'ForInStatement'
}, {
message: 'Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand.',
selector: 'LabeledStatement'
}, {
message: '`with` is disallowed in strict mode because it makes code impossible to predict and optimize.',
selector: 'WithStatement'
}],
'no-unused-vars': 'error',
'object-curly-newline': 'off',
'prefer-arrow-callback': ['error', {
allowNamedFunctions: false,
allowUnboundThis: true
}],
'prefer-destructuring': ['error', {
array: true,
object: true
}],
quotes: ['error', 'single'],
semi: 'error',
'semi-spacing': 'error',
'simple-import-sort/imports': 'error',
'sort-destructure-keys/sort-destructure-keys': ['error', {
caseSensitive: true
}],
'sort-imports': 'off',
'sort-keys': ['error', 'asc', {
natural: true
}],
'space-before-blocks': 'error',
'space-before-function-paren': ['error', {
anonymous: 'never',
named: 'never'
}],
'space-in-parens': 'error',
'space-infix-ops': 'error',
'space-unary-ops': 'error',
'spaced-comment': 'error',
'vue/no-multiple-template-root': 'off',
'vue/order-in-components': 'off'
}
};