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