8000 Update eslint 8.x config · HowProgrammingWorks/API@72dc195 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit 72dc195

Browse files
committed
Update eslint 8.x config
1 parent 056bfda commit 72dc195

File tree

1 file changed

+139
-80
lines changed

1 file changed

+139
-80
lines changed

.eslintrc.json

Lines changed: 139 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -14,70 +14,35 @@
1414
"rules": {
1515
"indent": ["error", 2],
1616
"linebreak-style": ["error", "unix"],
17-
"quotes": ["error", "single"],
17+
"quotes": ["error", "single", { "allowTemplateLiterals": true }],
1818
"semi": ["error", "always"],
1919
"no-loop-func": ["error"],
2020
"block-spacing": ["error", "always"],
2121
"camelcase": ["error"],
2222
"eqeqeq": ["error", "always"],
2323
"strict": ["error", "global"],
24-
"brace-style": [
25-
"error",
26-
"1tbs",
27-
{
28-
"allowSingleLine": true
29-
}
30-
],
24+
"brace-style": ["error", "1tbs", { "allowSingleLine": true }],
3125
"comma-style": ["error", "last"],
32-
"comma-spacing": [
33-
"error",
34-
{
35-
"before": false,
36-
"after": true
37-
}
38-
],
26+
"comma-spacing": ["error", { "before": false, "after": true }],
3927
"eol-last": ["error"],
4028
"func-call-spacing": ["error", "never"],
4129
"key-spacing": [
4230
"error",
43-
{
44-
"beforeColon": false,
45-
"afterColon": true,
46-
"mode": "minimum"
47-
}
31+
{ "beforeColon": false, "afterColon": true, "mode": "minimum" }
4832
],
4933
"keyword-spacing": [
5034
"error",
5135
{
5236
"before": true,
5337
"after": true,
54-
"overrides": {
55-
"function": {
56-
"after": false
57-
}
58-
}
59-
}
60-
],
61-
"max-len": [
62-
"error",
63-
{
64-
"code": 80,
65-
"ignoreUrls": true
66-
}
67-
],
68-
"max-nested-callbacks": [
69-
"error",
70-
{
71-
"max": 7
38+
"overrides": { "function": { "after": false } }
7239
}
7340
],
41+
"max-len": ["error", { "code": 80, "ignoreUrls": true }],
42+
"max-nested-callbacks": ["error", { "max": 7 }],
7443
"new-cap": [
7544
"error",
76-
{
77-
"newIsCap": true,
78-
"capIsNew": false,
79-
"properties": true
80-
}
45+
{ "newIsCap": true, "capIsNew": true, "properties": true }
8146
],
8247
"new-parens": ["error"],
8348
"no-lonely-if": ["error"],
@@ -86,64 +51,37 @@
8651
"no-whitespace-before-property": ["error"],
8752
"object-curly-spacing": ["error", "always"],
8853
"operator-assignment": ["error", "always"],
89-
"operator-linebreak": ["error", "after"],
90-
"semi-spacing": [
54+
"operator-linebreak": [
9155
"error",
92-
{
93-
"before": false,
94-
"after": true
95-
}
56+
"after",
57+
{ "overrides": { "?": "before", ":": "before" } }
9658
],
59+
"semi-spacing": ["error", { "before": false, "after": true }],
9760
"space-before-blocks": ["error", "always"],
9861
"space-before-function-paren": [
9962
"error",
100-
{
101-
"anonymous": "never",
102-
"named": "never",
103-
"asyncArrow": "always"
104-
}
63+
{ "anonymous": "never", "named": "never", "asyncArrow": "always" }
10564
],
10665
"space-in-parens": ["error", "never"],
10766
"space-infix-ops": ["error"],
10867
"space-unary-ops": [
10968
"error",
110-
{
111-
"words": true,
112-
"nonwords": false,
113-
"overrides": {
114-
"typeof": false
115-
}
116-
}
69+
{ "words": true, "nonwords": false, "overrides": { "typeof": false } }
11770
],
11871
"no-unreachable": ["error"],
11972
"no-global-assign": ["error"],
12073
"no-self-compare": ["error"],
12174
"no-unmodified-loop-condition": ["error"],
122-
"no-constant-condition": [
123-
"error",
124-
{
125-
"checkLoops": false
126-
}
127-
],
75+
"no-constant-condition": ["error", { "checkLoops": false }],
12876
"no-console": ["off"],
12977
"no-useless-concat": ["error"],
13078
"no-useless-escape": ["error"],
13179
"no-shadow-restricted-names": ["error"],
132-
"no-use-before-define": [
133-
"error",
134-
{
135-
"functions": false
136-
}
137-
],
80+
"no-use-before-define": ["error", { "functions": false }],
13881
"arrow-parens": ["error", "always"],
13982
"arrow-body-style": ["error", "as-needed"],
14083
"arrow-spacing": ["error"],
141-
"no-confusing-arrow": [
142-
"error",
143-
{
144-
"allowParens": true
145-
}
146-
],
84+
"no-confusing-arrow": 0,
14785
"no-useless-computed-key": ["error"],
14886
"no-useless-rename": ["error"],
14987
"no-var": ["error"],
@@ -155,6 +93,127 @@
15593
"prefer-spread": ["error"],
15694
"rest-spread-spacing": ["error", "never"],
15795
"template-curly-spacing": ["error", "never"],
158-
"consistent-return": ["error", { "treatUndefinedAsUnspecified": true }]
96+
"consistent-return": ["error", { "treatUndefinedAsUnspecified": true }],
97+
"constructor-super": ["error"],
98+
"for-direction": ["error"],
99+
"getter-return": ["error"],
100+
"no-async-promise-executor": ["error"],
101+
"no-case-declarations": ["error"],
102+
"no-class-assign": ["error"],
103+
"no-compare-neg-zero": ["error"],
104+
"no-cond-assign": ["error"],
105+
"no-const-assign": ["error"],
106+
"no-constant-binary-expression": ["error"],
107+
"no-control-regex": ["error"],
108+
"no-debugger": ["error"],
109+
"no-delete-var": ["error"],
110+
"no-dupe-args": ["error"],
111+
"no-dupe-class-members": ["error"],
112+
"no-dupe-else-if": ["error"],
113+
"no-dupe-keys": ["error"],
114+
"no-duplicate-case": ["error"],
115+
"no-empty": ["error"],
116+
"no-empty-character-class": ["error"],
117+
"no-empty-pattern": ["error"],
118+
"no-empty-static-block": ["error"],
119+
"no-ex-assign": ["error"],
120+
"no-extra-boolean-cast": ["error"],
121+
"no-fallthrough": ["error"],
122+
"no-func-assign": ["error"],
123+
"no-import-assign": ["error"],
124+
"no-invalid-regexp": ["error"],
125+
"no-irregular-whitespace": ["error"],
126+
"no-loss-of-precision": ["error"],
127+
"no-misleading-character-class": ["error"],
128+
"no-new-native-nonconstructor": ["error"],
129+
"no-nonoctal-decimal-escape": ["error"],
130+
"no-obj-calls": ["error"],
131+
"no-octal": ["error"],
132+
"no-prototype-builtins": ["error"],
133+
"no-redeclare": ["error"],
134+
"no-regex-spaces": ["error"],
135+
"no-self-assign": ["error"],
136+
"no-setter-return": ["error"],
137+
"no-sparse-arrays": ["error"],
138+
"no-this-before-super": ["error"],
< F42D /code>
139+
"no-undef": ["error"],
140+
"no-unexpected-multiline": 0,
141+
"no-unsafe-finally": ["error"],
142+
"no-unsafe-negation": ["error"],
143+
"no-unsafe-optional-chaining": ["error"],
144+
"no-unused-labels": ["error"],
145+
"no-unused-private-class-members": ["error"],
146+
"no-unused-vars": ["error"],
147+
"no-useless-backreference": ["error"],
148+
"no-useless-catch": ["error"],
149+
"no-with": ["error"],
150+
"require-yield": ["error"],
151+
"use-isnan": ["error"],
152+
"valid-typeof": ["error"],
153+
"curly": ["error", "multi-line", "consistent"],
154+
"space-unary-word-ops": "off",
155+
"generator-star": "off",
156+
"no-comma-dangle": "off",
157+
"no-reserved-keys": "off",
158+
"no-space-before-semi": "off",
159+
"no-wrap-func": "off",
160+
"space-after-function-name": "off",
161+
"space-before-function-parentheses": "off",
162+
"space-in-brackets": "off",
163+
"no-arrow-condition": "off",
164+
"space-after-keywords": "off",
165+
"space-before-keywords": "off",
166+
"space-return-throw-case": "off",
167+
"no-spaced-func": "off",
168+
"indent-legacy": "off",
169+
"array-bracket-newline": "off",
170+
"array-bracket-spacing": "off",
171+
"array-element-newline": "off",
172+
"comma-dangle": ["error", "always-multiline"],
173+
"computed-property-spacing": "off",
174+
"dot-location": "off",
175+
"function-call-argument-newline": "off",
176+
"function-paren-newline": "off",
177+
"generator-star-spacing": "off",
178+
"implicit-arrow-linebreak": "off",
179+
"jsx-quotes": "off",
180+
"lines-around-comment": 0,
181+
"max-statements-per-line": "off",
182+
"multiline-ternary": "off",
183+
"newline-per-chained-call": "off",
184+
"no-extra-parens": [
185+
"error",
186+
"all",
187+
{
188+
"returnAssign": false,
189+
"nestedBinaryExpressions": false,
190+
"enforceForArrowConditionals": false
191+
}
192+
],
193+
"no-extra-semi": "off",
194+
"no-floating-decimal": "off",
195+
"no-mixed-operators": 0,
196+
"no-mixed-spaces-and-tabs": "off",
197+
"no-multi-spaces": "off",
198+
"no-multiple-empty-lines": "off",
199+
"no-tabs": 0,
200+
"nonblock-statement-body-position": "off",
201+
"object-curly-newline": "off",
202+
"object-property-newline": "off",
203+
"one-var-declaration-per-line": "off",
204+
"padded-blocks": "off",
205+
"quote-props": "off",
206+
"semi-style": "off",
207+
"switch-colon-spacing": "off",
208+
"template-tag-spacing": "off",
209+
"wrap-iife": "off",
210+
"wrap-regex": "off",
211+
"yield-star-spacing": "off",
212+
"react/jsx-space-before-closing": "off",
213+
"no-return-assign": ["error"],
214+
"handle-callback-err": ["error", "^err"],
215+
"no-nested-ternary": ["error"],
216+
"no-invalid-this": ["error"],
217+
"class-methods-use-this": ["warn"]
159218
}
160219
}

0 commit comments

Comments
 (0)
0