eslint-config-plus
Eslint config plus = Eslint official recommended rules + most fixable and normal rules.
https://eslint.org/docs/rules/
Installation
npm install eslint-config-plus -D
Usage
//.eslintrc.js
module.exports = {
'extends': [
'plus'
]
};
Rules
Base on eslint@8.40.0 (2023/5/6)
- All Eslint rules: 267
- Defined in plus: 201 (Based on Eslint defaults and many years of personal programming style, welcome to add)
- Recommended: 61 β (All Eslint official recommended rules)
- Fixable: 100 π§ (Good enough formatting that no extra tools like Prettier are needed. Why I don't use Prettier)
- Undefined: 66 β
Details
Rules | In plus | |
---|---|---|
1 | accessor-pairs | β |
2 | array-bracket-newline | π§ ["error","consistent"] |
3 | array-bracket-spacing | π§ ["error","never"] |
4 | array-callback-return | β |
5 | array-element-newline | π§ ["error","consistent"] |
6 | arrow-body-style | π§ β |
7 | arrow-parens | π§ ["error","always"] |
8 | arrow-spacing | π§ "error" |
9 | block-scoped-var | β |
10 | block-spacing | π§ "error" |
11 | brace-style | π§ "error" |
12 | camelcase | β |
13 | capitalized-comments | π§ β |
14 | class-methods-use-this | β |
15 | comma-dangle | π§ ["error","never"] |
16 | comma-spacing | π§ ["error",{"after":true,"before":false}] |
17 | comma-style | π§ ["error","last"] |
18 | complexity | ["error",8] |
19 | computed-property-spacing | π§ ["error","never"] |
20 | consistent-return | β |
21 | consistent-this | β |
22 | constructor-super | β "error" |
23 | curly | π§ "error" |
24 | default-case | "error" |
25 | default-case-last | "error" |
26 | default-param-last | "error" |
27 | dot-location | π§ ["error","property"] |
28 | dot-notation | π§ "error" |
29 | eol-last | π§ ["error","always"] |
30 | eqeqeq | π§ ["error","always"] |
31 | for-direction | β "error" |
32 | func-call-spacing | π§ ["error","never"] |
33 | func-name-matching | "error" |
34 | func-names | β |
35 | func-style | β |
36 | function-call-argument-newline | π§ ["error","consistent"] |
37 | function-paren-newline | π§ ["error","consistent"] |
38 | generator-star-spacing | π§ ["error",{"after":false,"before":true}] |
39 | getter-return | β "error" |
40 | grouped-accessor-pairs | β |
41 | guard-for-in | β |
42 | id-denylist | β |
43 | id-length | β |
44 | id-match | β |
45 | implicit-arrow-linebreak | π§ ["error","beside"] |
46 | indent | π§ ["error",4,{"ArrayExpression":"first","ObjectExpression":1,"SwitchCase":1}] |
47 | init-declarations | β |
48 | jsx-quotes | π§ ["error","prefer-double"] |
49 | key-spacing | π§ ["error",{"afterColon":true,"mode":"strict"}] |
50 | keyword-spacing | π§ ["error",{"after":true,"before":true}] |
51 | line-comment-position | ["error",{"position":"above"}] |
52 | linebreak-style | π§ β |
53 | lines-around-comment | π§ ["error",{"beforeBlockComment":true}] |
54 | lines-between-class-members | π§ ["error","always",{"exceptAfterSingleLine":true}] |
55 | logical-assignment-operators | π§ β |
56 | max-classes-per-file | "error" |
57 | max-depth | ["error",5] |
58 | max-len | ["error",{"code":550,"ignoreStrings":true,"ignoreTrailingComments":true}] |
59 | max-lines | ["error",3000] |
60 | max-lines-per-function | ["error",300] |
61 | max-nested-callbacks | ["error",5] |
62 | max-params | ["error",8] |
63 | max-statements | ["error",50] |
64 | max-statements-per-line | ["error",{"max":3}] |
65 | multiline-comment-style | π§ β |
66 | multiline-ternary | π§ ["error","never"] |
67 | new-cap | ["error",{"capIsNew":false,"newIsCap":true,"properties":true}] |
68 | new-parens | π§ "error" |
69 | newline-per-chained-call | π§ β |
70 | no-alert | "error" |
71 | no-array-constructor | "error" |
72 | no-async-promise-executor | β "error" |
73 | no-await-in-loop | β |
74 | no-bitwise | β |
75 | no-caller | "error" |
76 | no-case-declarations | β "error" |
77 | no-class-assign | β "error" |
78 | no-compare-neg-zero | β "error" |
79 | no-cond-assign | β "error" |
80 | no-confusing-arrow | π§ "error" |
81 | no-console | "off" |
82 | no-const-assign | β "error" |
83 | no-constant-binary-expression | β |
84 | no-constant-condition | β "error" |
85 | no-constructor-return | "error" |
86 | no-continue | β |
87 | no-control-regex | β "error" |
88 | no-debugger | β "error" |
89 | no-delete-var | β "error" |
90 | no-div-regex | π§ "error" |
91 | no-dupe-args | β "error" |
92 | no-dupe-class-members | β "error" |
93 | no-dupe-else-if | β "error" |
94 | no-dupe-keys | β "error" |
95 | no-duplicate-case | β "error" |
96 | no-duplicate-imports | "error" |
97 | no-else-return | π§ "error" |
98 | no-empty | β "error" |
99 | no-empty-character-class | β "error" |
100 | no-empty-function | β |
101 | no-empty-pattern | β "error" |
102 | no-empty-static-block | β |
103 | no-eq-null | "error" |
104 | no-eval | "error" |
105 | no-ex-assign | β "error" |
106 | no-extend-native | "error" |
107 | no-extra-bind | π§ "error" |
108 | no-extra-boolean-cast | β π§ "error" |
109 | no-extra-label | π§ "error" |
110 | no-extra-parens | π§ β |
111 | no-extra-semi | β π§ "error" |
112 | no-fallthrough | β "error" |
113 | no-floating-decimal | π§ "error" |
114 | no-func-assign | β "error" |
115 | no-global-assign | β "error" |
116 | no-implicit-coercion | π§ "error" |
117 | no-implicit-globals | β |
118 | no-implied-eval | "error" |
119 | no-import-assign | β "error" |
120 | no-inline-comments | "error" |
121 | no-inner-declarations | β "error" |
122 | no-invalid-regexp | β "error" |
123 | no-invalid-this | β |
124 | no-irregular-whitespace | β "error" |
125 | no-iterator | "error" |
126 | no-label-var | "error" |
127 | no-labels | "error" |
128 | no-lone-blocks | "error" |
129 | no-lonely-if | π§ β |
130 | no-loop-func | "error" |
131 | no-loss-of-precision | β "error" |
132 | no-magic-numbers | β |
133 | no-misleading-character-class | β "error" |
134 | no-mixed-operators | ["error",{"groups":[["&&","||"]]}] |
135 | no-mixed-spaces-and-tabs | β "error" |
136 | no-multi-assign | "error" |
137 | no-multi-spaces | π§ "error" |
138 | no-multi-str | "error" |
139 | no-multiple-empty-lines | π§ ["error",{"max":2,"maxBOF":1,"maxEOF":1}] |
140 | no-negated-condition | "error" |
141 | no-nested-ternary | "warn" |
142 | no-new | β |
143 | no-new-func | β |
144 | no-new-native-nonconstructor | β |
145 | no-new-object | "error" |
146 | no-new-symbol | β "error" |
147 | no-new-wrappers | "error" |
148 | no-nonoctal-decimal-escape | β "error" |
149 | no-obj-calls | β "error" |
150 | no-octal | β "error" |
151 | no-octal-escape | "error" |
152 | no-param-reassign | "off" |
153 | no-plusplus | β |
154 | no-promise-executor-return | "error" |
155 | no-proto | "error" |
156 | no-prototype-builtins | β "error" |
157 | no-redeclare | β "error" |
158 | no-regex-spaces | β π§ "error" |
159 | no-restricted-exports | β |
160 | no-restricted-globals | ["error","event","fdescribe","self"] |
161 | no-restricted-imports | β |
162 | no-restricted-properties | β |
163 | no-restricted-syntax | β |
164 | no-return-assign | "error" |
165 | no-return-await | "error" |
166 | no-script-url | β |
167 | no-self-assign | β "error" |
168 | no-self-compare | "error" |
169 | no-sequences | "error" |
170 | no-setter-return | β "error" |
171 | no-shadow | "error" |
172 | no-shadow-restricted-names | β "error" |
173 | no-sparse-arrays | β "error" |
174 | no-tabs | "error" |
175 | no-template-curly-in-string | "error" |
176 | no-ternary | β |
177 | no-this-before-super | β "error" |
178 | no-throw-literal | "error" |
179 | no-trailing-spaces | π§ ["error"] |
180 | no-undef | β "error" |
181 | no-undef-init | π§ "error" |
182 | no-undefined | "error" |
183 | no-underscore-dangle | β |
184 | no-unexpected-multiline | β "error" |
185 | no-unmodified-loop-condition | "error" |
186 | no-unneeded-ternary | π§ "error" |
187 | no-unreachable | β "error" |
188 | no-unreachable-loop | "error" |
189 | no-unsafe-finally | β "error" |
190 | no-unsafe-negation | β "error" |
191 | no-unsafe-optional-chaining | β "error" |
192 | no-unused-expressions | "error" |
193 | no-unused-labels | β π§ "error" |
194 | no-unused-private-class-members | "error" |
195 | no-unused-vars | β ["error",{"args":"none","vars":"local"}] |
196 | no-use-before-define | β |
197 | no-useless-backreference | β "error" |
198 | no-useless-call | β |
199 | no-useless-catch | β "error" |
200 | no-useless-computed-key | π§ "error" |
201 | no-useless-concat | "error" |
202 | no-useless-constructor | "error" |
203 | no-useless-escape | β "error" |
204 | no-useless-rename | π§ "error" |
205 | no-useless-return | π§ "error" |
206 | no-var | π§ ["warn"] |
207 | no-void | β |
208 | no-warning-comments | β |
209 | no-whitespace-before-property | π§ "error" |
210 | no-with | β "error" |
211 | nonblock-statement-body-position | π§ β |
212 | object-curly-newline | π§ ["error",{"ExportDeclaration":{"minProperties":3,"multiline":true},"ImportDeclaration":{"minProperties":3,"multiline":true},"ObjectExpression":{"consistent":true,"minProperties":1,"multiline":true},"ObjectPattern":{"minProperties":3,"multiline":true}}] |
213 | object-curly-spacing | π§ ["error","always"] |
214 | object-property-newline | π§ ["error",{"allowAllPropertiesOnSameLine":true}] |
215 | object-shorthand | π§ β |
216 | one-var | π§ ["error","never"] |
217 | one-var-declaration-per-line | π§ ["error","always"] |
218 | operator-assignment | π§ ["error","always"] |
219 | operator-linebreak | π§ ["error","before"] |
220 | padded-blocks | π§ β |
221 | padding-line-between-statements | π§ ["error",{"blankLine":"always","next":"","prev":"directive"},{"blankLine":"any","next":"directive","prev":"directive"},{"blankLine":"always","next":"function","prev":""},{"blankLine":"always","next":"block","prev":"*"}] |
222 | prefer-arrow-callback | π§ β |
223 | prefer-const | π§ "error" |
224 | prefer-destructuring | π§ β |
225 | prefer-exponentiation-operator | π§ β |
226 | prefer-named-capture-group | β |
227 | prefer-numeric-literals | π§ "error" |
228 | prefer-object-has-own | π§ β |
229 | prefer-object-spread | π§ "error" |
230 | prefer-promise-reject-errors | β |
231 | prefer-regex-literals | "error" |
232 | prefer-rest-params | β |
233 | prefer-spread | β |
234 | prefer-template | π§ "error" |
235 | quote-props | π§ β |
236 | quotes | π§ ["error","single",{"avoidEscape":true}] |
237 | radix | β |
238 | require-atomic-updates | "off" |
239 | require-await | "error" |
240 | require-unicode-regexp | β |
241 | require-yield | β "error" |
242 | rest-spread-spacing | π§ ["error","always"] |
243 | semi | π§ ["error","always"] |
244 | semi-spacing | π§ ["error",{"after":true,"before":false}] |
245 | semi-style | π§ ["error","last"] |
246 | sort-imports | π§ β |
247 | sort-keys | β |
248 | sort-vars | π§ β |
249 | space-before-blocks | π§ ["error","always"] |
250 | space-before-function-paren | π§ ["error",{"anonymous":"never","asyncArrow":"always","named":"never"}] |
251 | space-in-parens | π§ "error" |
252 | space-infix-ops | π§ ["error",{"int32Hint":false}] |
253 | space-unary-ops | π§ "error" |
254 | spaced-comment | π§ "error" |
255 | strict | π§ β |
256 | switch-colon-spacing | π§ "error" |
257 | symbol-description | "error" |
258 | template-curly-spacing | π§ "error" |
259 | template-tag-spacing | π§ "error" |
260 | unicode-bom | π§ "error" |
261 | use-isnan | β "error" |
262 | valid-typeof | β "error" |
263 | vars-on-top | β |
264 | wrap-iife | π§ ["error","inside"] |
265 | wrap-regex | π§ "error" |
266 | yield-star-spacing | π§ "error" |
267 | yoda | π§ "error" |