-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
178 lines (171 loc) · 5.11 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
module.exports = {
env: {
es2022: true,
node: true,
commonjs: true,
},
// extends: [`prettier`],
// plugins: [`prettier`],
parser: `@babel/eslint-parser`,
parserOptions: {
ecmaVersion: 2022,
sourceType: `module`,
},
overrides: [{
files: [`*.ts`],
excludedFiles: `*.test.ts`,
parser: `@typescript-eslint/parser`,
parserOptions: {
sourceType: `module`,
tsconfigRootDir: __dirname,
project: `tsconfig.json`,
},
plugins: [
`@typescript-eslint`
],
extends: [
`eslint:recommended`,
`plugin:@typescript-eslint/eslint-recommended`,
`plugin:@typescript-eslint/recommended`
],
}],
rules: {
'no-cond-assign': `error`,
'no-irregular-whitespace': `error`,
'no-unexpected-multiline': `error`,
'valid-jsdoc': [`error`, {
requireParamDescription: false,
requireReturnDescription: false,
requireReturn: false,
prefer: {returns: `return`}
}],
'no-constant-condition': `error`,
'no-control-regex': `error`,
'no-debugger': `error`,
'no-dupe-keys': `error`,
'no-dupe-args': `error`,
'no-duplicate-case': `error`,
'no-empty': `error`,
'no-empty-character-class': `error`,
'no-ex-assign': `error`,
'no-extra-boolean-cast': `error`,
'no-extra-semi': `error`,
'no-func-assign': `error`,
'no-inner-declarations': [`error`, `functions`],
'no-invalid-regexp': `error`,
'no-unsafe-negation': `error`,
'no-obj-calls': `error`,
'no-regex-spaces': `error`,
'no-sparse-arrays': `error`,
'no-unreachable': `error`,
'use-isnan': `error`,
'valid-typeof': `error`,
'guard-for-in': `error`,
'max-nested-callbacks': [`error`, {max: 3}],
'no-caller': `error`,
'no-extend-native': `error`,
'no-extra-bind': `error`,
'no-invalid-this': `error`,
'no-multi-spaces': `error`,
'no-multi-str': `error`,
'no-new-wrappers': `error`,
'no-throw-literal': `error`,
'no-with': `error`,
'consistent-return': `error`,
'curly': [`error`, `all`],
'eqeqeq': `error`,
'no-alert': `error`,
'no-eval': `error`,
'no-fallthrough': `error`,
'no-floating-decimal': `error`,
'no-implied-eval': `error`,
'no-iterator': `error`,
'no-labels': `error`,
'no-lone-blocks': `error`,
'no-global-assign': `error`,
'no-new': `error`,
'no-new-func': `error`,
'no-octal': `error`,
'no-octal-escape': `error`,
'no-proto': `error`,
'no-redeclare': `error`,
'no-return-assign': `warn`,
'no-script-url': `error`,
'no-sequences': `error`,
'no-unused-expressions': `error`,
'radix': `error`,
'strict': [`error`, `global`],
'no-unused-vars': [`error`, {args: `after-used`, argsIgnorePattern: `^_`}],
'no-delete-var': `error`,
'no-label-var': `error`,
'@typescript-eslint/no-shadow': `error`,
'no-shadow': `warn`,
'no-shadow-restricted-names': `error`,
'no-undef': `error`,
'no-undef-init': `error`,
'no-undefined': `off`,
'indent': [`error`, 2, {
SwitchCase: 1,
VariableDeclarator: 1,
MemberExpression: `off`,
FunctionDeclaration: {parameters: 2},
FunctionExpression: {parameters: 2},
CallExpression: {arguments: 1}
}],
'block-spacing': [`error`, `always`],
'array-bracket-spacing': [`error`, `never`],
'brace-style': [`error`, `stroustrup`],
'camelcase': `error`,
'comma-dangle': [`error`, `only-multiline`],
'comma-spacing': `error`,
'comma-style': `error`,
'computed-property-spacing': `error`,
'eol-last': `error`,
'func-call-spacing': `error`,
'key-spacing': `error`,
'keyword-spacing': `error`,
'linebreak-style': `off`,
'new-cap': `error`,
'no-array-constructor': `error`,
'no-mixed-spaces-and-tabs': `error`,
'no-multiple-empty-lines': [`error`, {max: 2}],
'no-new-object': `error`,
'no-trailing-spaces': `error`,
'object-curly-spacing': `error`,
'one-var': [`error`, {
var: `never`,
let: `never`,
const: `never`
}],
'padded-blocks': [`off`, `never`],
'quote-props': [`error`, `consistent`],
'semi-spacing': `error`,
'semi': `error`,
'space-in-parens': [`error`, `never`],
'space-before-blocks': `error`,
'space-before-function-paren': [`error`, {named: `never`, anonymous: `always`}],
'spaced-comment': [`error`, `always`],
'unicode-bom': `warn`,
'new-parens': `error`,
'no-nested-ternary': `error`,
'space-infix-ops': `error`,
'space-unary-ops': [`error`, {words: true, nonwords: false}],
'yoda': [`warn`, `never`],
// es6
'arrow-parens': [`error`, `always`],
'constructor-super': `error`,
'generator-star-spacing': [`error`, `after`],
'no-new-symbol': `error`,
'no-this-before-super': `error`,
'no-var': `error`,
'prefer-rest-params': `error`,
'prefer-spread': `error`,
'rest-spread-spacing': `error`,
'yield-star-spacing': [`error`, `after`],
'object-shorthand': [`error`, `always`, {'avoidQuotes': true}],
'quotes': [`error`, `backtick`],
// node
'no-console': `off`,
'no-process-exit': `off`,
},
};