eslint 8.16.0 → 8.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -7
- package/bin/eslint.js +1 -1
- package/lib/eslint/eslint.js +3 -3
- package/lib/linter/linter.js +5 -1
- package/lib/linter/timing.js +2 -1
- package/lib/rules/accessor-pairs.js +1 -1
- package/lib/rules/array-bracket-newline.js +1 -1
- package/lib/rules/array-bracket-spacing.js +1 -1
- package/lib/rules/array-callback-return.js +1 -1
- package/lib/rules/array-element-newline.js +1 -1
- package/lib/rules/arrow-body-style.js +1 -1
- package/lib/rules/arrow-parens.js +1 -1
- package/lib/rules/arrow-spacing.js +1 -1
- package/lib/rules/block-scoped-var.js +1 -1
- package/lib/rules/block-spacing.js +1 -1
- package/lib/rules/brace-style.js +1 -1
- package/lib/rules/callback-return.js +1 -1
- package/lib/rules/camelcase.js +1 -1
- package/lib/rules/capitalized-comments.js +1 -1
- package/lib/rules/class-methods-use-this.js +1 -1
- package/lib/rules/comma-dangle.js +1 -1
- package/lib/rules/comma-spacing.js +1 -1
- package/lib/rules/comma-style.js +1 -1
- package/lib/rules/complexity.js +1 -1
- package/lib/rules/computed-property-spacing.js +1 -1
- package/lib/rules/consistent-return.js +1 -1
- package/lib/rules/consistent-this.js +1 -1
- package/lib/rules/constructor-super.js +1 -1
- package/lib/rules/curly.js +1 -1
- package/lib/rules/default-case-last.js +1 -1
- package/lib/rules/default-case.js +1 -1
- package/lib/rules/default-param-last.js +1 -1
- package/lib/rules/dot-location.js +1 -1
- package/lib/rules/dot-notation.js +1 -1
- package/lib/rules/eol-last.js +1 -1
- package/lib/rules/eqeqeq.js +1 -1
- package/lib/rules/for-direction.js +1 -1
- package/lib/rules/func-call-spacing.js +1 -1
- package/lib/rules/func-name-matching.js +1 -1
- package/lib/rules/func-names.js +1 -1
- package/lib/rules/func-style.js +1 -1
- package/lib/rules/function-call-argument-newline.js +1 -1
- package/lib/rules/function-paren-newline.js +2 -2
- package/lib/rules/generator-star-spacing.js +1 -1
- package/lib/rules/getter-return.js +1 -1
- package/lib/rules/global-require.js +1 -1
- package/lib/rules/grouped-accessor-pairs.js +1 -1
- package/lib/rules/guard-for-in.js +1 -1
- package/lib/rules/handle-callback-err.js +1 -1
- package/lib/rules/id-blacklist.js +1 -1
- package/lib/rules/id-denylist.js +1 -1
- package/lib/rules/id-length.js +1 -1
- package/lib/rules/id-match.js +1 -1
- package/lib/rules/implicit-arrow-linebreak.js +1 -1
- package/lib/rules/indent-legacy.js +1 -1
- package/lib/rules/indent.js +46 -14
- package/lib/rules/init-declarations.js +1 -1
- package/lib/rules/jsx-quotes.js +1 -1
- package/lib/rules/key-spacing.js +1 -1
- package/lib/rules/keyword-spacing.js +1 -1
- package/lib/rules/line-comment-position.js +1 -1
- package/lib/rules/linebreak-style.js +1 -1
- package/lib/rules/lines-around-comment.js +1 -1
- package/lib/rules/lines-around-directive.js +1 -1
- package/lib/rules/lines-between-class-members.js +1 -1
- package/lib/rules/max-classes-per-file.js +1 -1
- package/lib/rules/max-depth.js +1 -1
- package/lib/rules/max-len.js +1 -1
- package/lib/rules/max-lines-per-function.js +1 -1
- package/lib/rules/max-lines.js +1 -1
- package/lib/rules/max-nested-callbacks.js +1 -1
- package/lib/rules/max-params.js +1 -1
- package/lib/rules/max-statements-per-line.js +1 -1
- package/lib/rules/max-statements.js +2 -2
- package/lib/rules/multiline-comment-style.js +1 -1
- package/lib/rules/multiline-ternary.js +1 -1
- package/lib/rules/new-cap.js +1 -1
- package/lib/rules/new-parens.js +1 -1
- package/lib/rules/newline-after-var.js +1 -1
- package/lib/rules/newline-before-return.js +1 -1
- package/lib/rules/newline-per-chained-call.js +1 -1
- package/lib/rules/no-alert.js +1 -1
- package/lib/rules/no-array-constructor.js +1 -1
- package/lib/rules/no-async-promise-executor.js +1 -1
- package/lib/rules/no-await-in-loop.js +1 -1
- package/lib/rules/no-bitwise.js +1 -1
- package/lib/rules/no-buffer-constructor.js +1 -1
- package/lib/rules/no-caller.js +1 -1
- package/lib/rules/no-case-declarations.js +1 -1
- package/lib/rules/no-catch-shadow.js +1 -1
- package/lib/rules/no-class-assign.js +1 -1
- package/lib/rules/no-compare-neg-zero.js +1 -1
- package/lib/rules/no-cond-assign.js +1 -1
- package/lib/rules/no-confusing-arrow.js +1 -1
- package/lib/rules/no-console.js +1 -1
- package/lib/rules/no-const-assign.js +1 -1
- package/lib/rules/no-constant-binary-expression.js +4 -4
- package/lib/rules/no-constant-condition.js +1 -1
- package/lib/rules/no-constructor-return.js +1 -1
- package/lib/rules/no-continue.js +1 -1
- package/lib/rules/no-control-regex.js +1 -1
- package/lib/rules/no-debugger.js +1 -1
- package/lib/rules/no-delete-var.js +1 -1
- package/lib/rules/no-div-regex.js +1 -1
- package/lib/rules/no-dupe-args.js +1 -1
- package/lib/rules/no-dupe-class-members.js +1 -1
- package/lib/rules/no-dupe-else-if.js +1 -1
- package/lib/rules/no-dupe-keys.js +1 -1
- package/lib/rules/no-duplicate-case.js +1 -1
- package/lib/rules/no-duplicate-imports.js +1 -1
- package/lib/rules/no-else-return.js +1 -1
- package/lib/rules/no-empty-character-class.js +1 -1
- package/lib/rules/no-empty-function.js +1 -1
- package/lib/rules/no-empty-pattern.js +1 -1
- package/lib/rules/no-empty.js +1 -1
- package/lib/rules/no-eq-null.js +1 -1
- package/lib/rules/no-eval.js +1 -1
- package/lib/rules/no-ex-assign.js +1 -1
- package/lib/rules/no-extend-native.js +1 -1
- package/lib/rules/no-extra-bind.js +1 -1
- package/lib/rules/no-extra-boolean-cast.js +1 -1
- package/lib/rules/no-extra-label.js +1 -1
- package/lib/rules/no-extra-parens.js +1 -1
- package/lib/rules/no-extra-semi.js +1 -1
- package/lib/rules/no-fallthrough.js +1 -1
- package/lib/rules/no-floating-decimal.js +1 -1
- package/lib/rules/no-func-assign.js +1 -1
- package/lib/rules/no-global-assign.js +1 -1
- package/lib/rules/no-implicit-coercion.js +3 -3
- package/lib/rules/no-implicit-globals.js +1 -1
- package/lib/rules/no-implied-eval.js +1 -1
- package/lib/rules/no-import-assign.js +1 -1
- package/lib/rules/no-inline-comments.js +1 -1
- package/lib/rules/no-inner-declarations.js +1 -1
- package/lib/rules/no-invalid-regexp.js +1 -1
- package/lib/rules/no-invalid-this.js +1 -1
- package/lib/rules/no-irregular-whitespace.js +1 -1
- package/lib/rules/no-iterator.js +1 -1
- package/lib/rules/no-label-var.js +1 -1
- package/lib/rules/no-labels.js +1 -1
- package/lib/rules/no-lone-blocks.js +1 -1
- package/lib/rules/no-lonely-if.js +1 -1
- package/lib/rules/no-loop-func.js +2 -2
- package/lib/rules/no-loss-of-precision.js +1 -1
- package/lib/rules/no-magic-numbers.js +1 -1
- package/lib/rules/no-misleading-character-class.js +1 -1
- package/lib/rules/no-mixed-operators.js +1 -1
- package/lib/rules/no-mixed-requires.js +1 -1
- package/lib/rules/no-mixed-spaces-and-tabs.js +1 -1
- package/lib/rules/no-multi-assign.js +1 -1
- package/lib/rules/no-multi-spaces.js +1 -1
- package/lib/rules/no-multi-str.js +1 -1
- package/lib/rules/no-multiple-empty-lines.js +1 -1
- package/lib/rules/no-native-reassign.js +1 -1
- package/lib/rules/no-negated-condition.js +1 -1
- package/lib/rules/no-negated-in-lhs.js +1 -1
- package/lib/rules/no-nested-ternary.js +1 -1
- package/lib/rules/no-new-func.js +1 -1
- package/lib/rules/no-new-object.js +2 -2
- package/lib/rules/no-new-require.js +1 -1
- package/lib/rules/no-new-symbol.js +1 -1
- package/lib/rules/no-new-wrappers.js +1 -1
- package/lib/rules/no-new.js +1 -1
- package/lib/rules/no-nonoctal-decimal-escape.js +1 -1
- package/lib/rules/no-obj-calls.js +1 -1
- package/lib/rules/no-octal-escape.js +1 -1
- package/lib/rules/no-octal.js +3 -3
- package/lib/rules/no-param-reassign.js +1 -1
- package/lib/rules/no-path-concat.js +1 -1
- package/lib/rules/no-plusplus.js +1 -1
- package/lib/rules/no-process-env.js +1 -1
- package/lib/rules/no-process-exit.js +1 -1
- package/lib/rules/no-promise-executor-return.js +1 -1
- package/lib/rules/no-proto.js +1 -1
- package/lib/rules/no-prototype-builtins.js +1 -1
- package/lib/rules/no-redeclare.js +1 -1
- package/lib/rules/no-regex-spaces.js +1 -1
- package/lib/rules/no-restricted-exports.js +1 -1
- package/lib/rules/no-restricted-globals.js +1 -1
- package/lib/rules/no-restricted-imports.js +77 -12
- package/lib/rules/no-restricted-modules.js +1 -1
- package/lib/rules/no-restricted-properties.js +1 -1
- package/lib/rules/no-restricted-syntax.js +1 -1
- package/lib/rules/no-return-assign.js +1 -1
- package/lib/rules/no-return-await.js +1 -1
- package/lib/rules/no-script-url.js +1 -1
- package/lib/rules/no-self-assign.js +1 -1
- package/lib/rules/no-self-compare.js +1 -1
- package/lib/rules/no-sequences.js +1 -1
- package/lib/rules/no-setter-return.js +1 -1
- package/lib/rules/no-shadow-restricted-names.js +1 -1
- package/lib/rules/no-shadow.js +1 -1
- package/lib/rules/no-spaced-func.js +1 -1
- package/lib/rules/no-sparse-arrays.js +1 -1
- package/lib/rules/no-sync.js +1 -1
- package/lib/rules/no-tabs.js +1 -1
- package/lib/rules/no-template-curly-in-string.js +1 -1
- package/lib/rules/no-ternary.js +1 -1
- package/lib/rules/no-this-before-super.js +1 -1
- package/lib/rules/no-throw-literal.js +1 -1
- package/lib/rules/no-trailing-spaces.js +1 -1
- package/lib/rules/no-undef-init.js +1 -1
- package/lib/rules/no-undef.js +1 -1
- package/lib/rules/no-undefined.js +1 -1
- package/lib/rules/no-underscore-dangle.js +1 -1
- package/lib/rules/no-unexpected-multiline.js +1 -1
- package/lib/rules/no-unmodified-loop-condition.js +1 -1
- package/lib/rules/no-unneeded-ternary.js +1 -1
- package/lib/rules/no-unreachable-loop.js +1 -1
- package/lib/rules/no-unreachable.js +1 -1
- package/lib/rules/no-unsafe-finally.js +1 -1
- package/lib/rules/no-unsafe-negation.js +1 -1
- package/lib/rules/no-unsafe-optional-chaining.js +1 -1
- package/lib/rules/no-unused-expressions.js +1 -1
- package/lib/rules/no-unused-labels.js +1 -1
- package/lib/rules/no-unused-private-class-members.js +1 -1
- package/lib/rules/no-unused-vars.js +5 -5
- package/lib/rules/no-use-before-define.js +16 -3
- package/lib/rules/no-useless-backreference.js +1 -1
- package/lib/rules/no-useless-call.js +1 -1
- package/lib/rules/no-useless-catch.js +1 -1
- package/lib/rules/no-useless-computed-key.js +1 -1
- package/lib/rules/no-useless-concat.js +1 -1
- package/lib/rules/no-useless-constructor.js +1 -1
- package/lib/rules/no-useless-escape.js +1 -1
- package/lib/rules/no-useless-rename.js +1 -1
- package/lib/rules/no-useless-return.js +1 -1
- package/lib/rules/no-var.js +1 -1
- package/lib/rules/no-void.js +1 -1
- package/lib/rules/no-warning-comments.js +1 -1
- package/lib/rules/no-whitespace-before-property.js +1 -1
- package/lib/rules/no-with.js +1 -1
- package/lib/rules/nonblock-statement-body-position.js +1 -1
- package/lib/rules/object-curly-newline.js +1 -1
- package/lib/rules/object-curly-spacing.js +1 -1
- package/lib/rules/object-property-newline.js +1 -1
- package/lib/rules/object-shorthand.js +1 -1
- package/lib/rules/one-var-declaration-per-line.js +1 -1
- package/lib/rules/one-var.js +1 -1
- package/lib/rules/operator-assignment.js +1 -1
- package/lib/rules/operator-linebreak.js +1 -1
- package/lib/rules/padded-blocks.js +1 -1
- package/lib/rules/padding-line-between-statements.js +1 -1
- package/lib/rules/prefer-arrow-callback.js +1 -1
- package/lib/rules/prefer-const.js +1 -1
- package/lib/rules/prefer-destructuring.js +1 -1
- package/lib/rules/prefer-exponentiation-operator.js +1 -1
- package/lib/rules/prefer-named-capture-group.js +1 -1
- package/lib/rules/prefer-numeric-literals.js +1 -1
- package/lib/rules/prefer-object-has-own.js +1 -1
- package/lib/rules/prefer-object-spread.js +1 -1
- package/lib/rules/prefer-promise-reject-errors.js +1 -1
- package/lib/rules/prefer-reflect.js +1 -1
- package/lib/rules/prefer-regex-literals.js +1 -1
- package/lib/rules/prefer-rest-params.js +1 -1
- package/lib/rules/prefer-spread.js +1 -1
- package/lib/rules/prefer-template.js +1 -1
- package/lib/rules/quote-props.js +1 -1
- package/lib/rules/quotes.js +1 -1
- package/lib/rules/radix.js +1 -1
- package/lib/rules/require-atomic-updates.js +1 -1
- package/lib/rules/require-await.js +1 -1
- package/lib/rules/require-jsdoc.js +1 -1
- package/lib/rules/require-unicode-regexp.js +1 -1
- package/lib/rules/require-yield.js +1 -1
- package/lib/rules/rest-spread-spacing.js +1 -1
- package/lib/rules/semi-spacing.js +1 -1
- package/lib/rules/semi-style.js +1 -1
- package/lib/rules/semi.js +1 -1
- package/lib/rules/sort-imports.js +1 -1
- package/lib/rules/sort-keys.js +1 -1
- package/lib/rules/sort-vars.js +1 -1
- package/lib/rules/space-before-blocks.js +1 -1
- package/lib/rules/space-before-function-paren.js +1 -1
- package/lib/rules/space-in-parens.js +1 -1
- package/lib/rules/space-infix-ops.js +1 -1
- package/lib/rules/space-unary-ops.js +1 -1
- package/lib/rules/spaced-comment.js +1 -1
- package/lib/rules/strict.js +1 -1
- package/lib/rules/switch-colon-spacing.js +1 -1
- package/lib/rules/symbol-description.js +1 -1
- package/lib/rules/template-curly-spacing.js +1 -1
- package/lib/rules/template-tag-spacing.js +1 -1
- package/lib/rules/unicode-bom.js +1 -1
- package/lib/rules/use-isnan.js +1 -1
- package/lib/rules/valid-jsdoc.js +1 -1
- package/lib/rules/valid-typeof.js +1 -1
- package/lib/rules/vars-on-top.js +1 -1
- package/lib/rules/wrap-iife.js +1 -1
- package/lib/rules/wrap-regex.js +1 -1
- package/lib/rules/yield-star-spacing.js +1 -1
- package/lib/rules/yoda.js +1 -1
- package/lib/shared/deprecation-warnings.js +1 -8
- package/lib/shared/types.js +1 -1
- package/package.json +3 -2
package/lib/rules/indent.js
CHANGED
@@ -500,7 +500,7 @@ module.exports = {
|
|
500
500
|
type: "layout",
|
501
501
|
|
502
502
|
docs: {
|
503
|
-
description: "
|
503
|
+
description: "Enforce consistent indentation",
|
504
504
|
recommended: false,
|
505
505
|
url: "https://eslint.org/docs/rules/indent"
|
506
506
|
},
|
@@ -916,18 +916,6 @@ module.exports = {
|
|
916
916
|
}
|
917
917
|
|
918
918
|
offsets.setDesiredOffsets([firstBodyToken.range[0], lastBodyToken.range[1]], lastParentToken, 1);
|
919
|
-
|
920
|
-
/*
|
921
|
-
* For blockless nodes with semicolon-first style, don't indent the semicolon.
|
922
|
-
* e.g.
|
923
|
-
* if (foo) bar()
|
924
|
-
* ; [1, 2, 3].map(foo)
|
925
|
-
*/
|
926
|
-
const lastToken = sourceCode.getLastToken(node);
|
927
|
-
|
928
|
-
if (node.type !== "EmptyStatement" && astUtils.isSemicolonToken(lastToken)) {
|
929
|
-
offsets.setDesiredOffset(lastToken, lastParentToken, 0);
|
930
|
-
}
|
931
919
|
}
|
932
920
|
}
|
933
921
|
|
@@ -1223,7 +1211,7 @@ module.exports = {
|
|
1223
1211
|
}
|
1224
1212
|
},
|
1225
1213
|
|
1226
|
-
"DoWhileStatement, WhileStatement, ForInStatement, ForOfStatement": node => addBlocklessNodeIndent(node.body),
|
1214
|
+
"DoWhileStatement, WhileStatement, ForInStatement, ForOfStatement, WithStatement": node => addBlocklessNodeIndent(node.body),
|
1227
1215
|
|
1228
1216
|
ExportNamedDeclaration(node) {
|
1229
1217
|
if (node.declaration === null) {
|
@@ -1271,6 +1259,50 @@ module.exports = {
|
|
1271
1259
|
}
|
1272
1260
|
},
|
1273
1261
|
|
1262
|
+
/*
|
1263
|
+
* For blockless nodes with semicolon-first style, don't indent the semicolon.
|
1264
|
+
* e.g.
|
1265
|
+
* if (foo)
|
1266
|
+
* bar()
|
1267
|
+
* ; [1, 2, 3].map(foo)
|
1268
|
+
*
|
1269
|
+
* Traversal into the node sets indentation of the semicolon, so we need to override it on exit.
|
1270
|
+
*/
|
1271
|
+
":matches(DoWhileStatement, ForStatement, ForInStatement, ForOfStatement, IfStatement, WhileStatement, WithStatement):exit"(node) {
|
1272
|
+
let nodesToCheck;
|
1273
|
+
|
1274
|
+
if (node.type === "IfStatement") {
|
1275
|
+
nodesToCheck = [node.consequent];
|
1276
|
+
if (node.alternate) {
|
1277
|
+
nodesToCheck.push(node.alternate);
|
1278
|
+
}
|
1279
|
+
} else {
|
1280
|
+
nodesToCheck = [node.body];
|
1281
|
+
}
|
1282
|
+
|
1283
|
+
for (const nodeToCheck of nodesToCheck) {
|
1284
|
+
const lastToken = sourceCode.getLastToken(nodeToCheck);
|
1285
|
+
|
1286
|
+
if (astUtils.isSemicolonToken(lastToken)) {
|
1287
|
+
const tokenBeforeLast = sourceCode.getTokenBefore(lastToken);
|
1288
|
+
const tokenAfterLast = sourceCode.getTokenAfter(lastToken);
|
1289
|
+
|
1290
|
+
// override indentation of `;` only if its line looks like a semicolon-first style line
|
1291
|
+
if (
|
1292
|
+
!astUtils.isTokenOnSameLine(tokenBeforeLast, lastToken) &&
|
1293
|
+
tokenAfterLast &&
|
1294
|
+
astUtils.isTokenOnSameLine(lastToken, tokenAfterLast)
|
1295
|
+
) {
|
1296
|
+
offsets.setDesiredOffset(
|
1297
|
+
lastToken,
|
1298
|
+
sourceCode.getFirstToken(node),
|
1299
|
+
0
|
1300
|
+
);
|
1301
|
+
}
|
1302
|
+
}
|
1303
|
+
}
|
1304
|
+
},
|
1305
|
+
|
1274
1306
|
ImportDeclaration(node) {
|
1275
1307
|
if (node.specifiers.some(specifier => specifier.type === "ImportSpecifier")) {
|
1276
1308
|
const openingCurly = sourceCode.getFirstToken(node, astUtils.isOpeningBraceToken);
|
@@ -48,7 +48,7 @@ module.exports = {
|
|
48
48
|
type: "suggestion",
|
49
49
|
|
50
50
|
docs: {
|
51
|
-
description: "
|
51
|
+
description: "Require or disallow initialization in variable declarations",
|
52
52
|
recommended: false,
|
53
53
|
url: "https://eslint.org/docs/rules/init-declarations"
|
54
54
|
},
|
package/lib/rules/jsx-quotes.js
CHANGED
@@ -42,7 +42,7 @@ module.exports = {
|
|
42
42
|
type: "layout",
|
43
43
|
|
44
44
|
docs: {
|
45
|
-
description: "
|
45
|
+
description: "Enforce the consistent use of either double or single quotes in JSX attributes",
|
46
46
|
recommended: false,
|
47
47
|
url: "https://eslint.org/docs/rules/jsx-quotes"
|
48
48
|
},
|
package/lib/rules/key-spacing.js
CHANGED
@@ -139,7 +139,7 @@ module.exports = {
|
|
139
139
|
type: "layout",
|
140
140
|
|
141
141
|
docs: {
|
142
|
-
description: "
|
142
|
+
description: "Enforce consistent spacing between keys and values in object literal properties",
|
143
143
|
recommended: false,
|
144
144
|
url: "https://eslint.org/docs/rules/key-spacing"
|
145
145
|
},
|
@@ -67,7 +67,7 @@ module.exports = {
|
|
67
67
|
type: "layout",
|
68
68
|
|
69
69
|
docs: {
|
70
|
-
description: "
|
70
|
+
description: "Enforce consistent spacing before and after keywords",
|
71
71
|
recommended: false,
|
72
72
|
url: "https://eslint.org/docs/rules/keyword-spacing"
|
73
73
|
},
|
@@ -18,7 +18,7 @@ module.exports = {
|
|
18
18
|
type: "layout",
|
19
19
|
|
20
20
|
docs: {
|
21
|
-
description: "
|
21
|
+
description: "Require or disallow newlines around directives",
|
22
22
|
recommended: false,
|
23
23
|
url: "https://eslint.org/docs/rules/lines-around-directive"
|
24
24
|
},
|
@@ -20,7 +20,7 @@ module.exports = {
|
|
20
20
|
type: "layout",
|
21
21
|
|
22
22
|
docs: {
|
23
|
-
description: "
|
23
|
+
description: "Require or disallow an empty line between class members",
|
24
24
|
recommended: false,
|
25
25
|
url: "https://eslint.org/docs/rules/lines-between-class-members"
|
26
26
|
},
|
@@ -19,7 +19,7 @@ module.exports = {
|
|
19
19
|
type: "suggestion",
|
20
20
|
|
21
21
|
docs: {
|
22
|
-
description: "
|
22
|
+
description: "Enforce a maximum number of classes per file",
|
23
23
|
recommended: false,
|
24
24
|
url: "https://eslint.org/docs/rules/max-classes-per-file"
|
25
25
|
},
|
package/lib/rules/max-depth.js
CHANGED
@@ -15,7 +15,7 @@ module.exports = {
|
|
15
15
|
type: "suggestion",
|
16
16
|
|
17
17
|
docs: {
|
18
|
-
description: "
|
18
|
+
description: "Enforce a maximum depth that blocks can be nested",
|
19
19
|
recommended: false,
|
20
20
|
url: "https://eslint.org/docs/rules/max-depth"
|
21
21
|
},
|
package/lib/rules/max-len.js
CHANGED
@@ -71,7 +71,7 @@ module.exports = {
|
|
71
71
|
type: "suggestion",
|
72
72
|
|
73
73
|
docs: {
|
74
|
-
description: "
|
74
|
+
description: "Enforce a maximum number of lines of code in a function",
|
75
75
|
recommended: false,
|
76
76
|
url: "https://eslint.org/docs/rules/max-lines-per-function"
|
77
77
|
},
|
package/lib/rules/max-lines.js
CHANGED
@@ -15,7 +15,7 @@ module.exports = {
|
|
15
15
|
type: "suggestion",
|
16
16
|
|
17
17
|
docs: {
|
18
|
-
description: "
|
18
|
+
description: "Enforce a maximum depth that callbacks can be nested",
|
19
19
|
recommended: false,
|
20
20
|
url: "https://eslint.org/docs/rules/max-nested-callbacks"
|
21
21
|
},
|
package/lib/rules/max-params.js
CHANGED
@@ -22,7 +22,7 @@ module.exports = {
|
|
22
22
|
type: "suggestion",
|
23
23
|
|
24
24
|
docs: {
|
25
|
-
description: "
|
25
|
+
description: "Enforce a maximum number of parameters in function definitions",
|
26
26
|
recommended: false,
|
27
27
|
url: "https://eslint.org/docs/rules/max-params"
|
28
28
|
},
|
@@ -20,7 +20,7 @@ module.exports = {
|
|
20
20
|
type: "layout",
|
21
21
|
|
22
22
|
docs: {
|
23
|
-
description: "
|
23
|
+
description: "Enforce a maximum number of statements allowed per line",
|
24
24
|
recommended: false,
|
25
25
|
url: "https://eslint.org/docs/rules/max-statements-per-line"
|
26
26
|
},
|
@@ -22,7 +22,7 @@ module.exports = {
|
|
22
22
|
type: "suggestion",
|
23
23
|
|
24
24
|
docs: {
|
25
|
-
description: "
|
25
|
+
description: "Enforce a maximum number of statements allowed in function blocks",
|
26
26
|
recommended: false,
|
27
27
|
url: "https://eslint.org/docs/rules/max-statements"
|
28
28
|
},
|
@@ -126,7 +126,7 @@ module.exports = {
|
|
126
126
|
|
127
127
|
/*
|
128
128
|
* This rule does not apply to class static blocks, but we have to track them so
|
129
|
-
* that
|
129
|
+
* that statements in them do not count as statements in the enclosing function.
|
130
130
|
*/
|
131
131
|
if (node.type === "StaticBlock") {
|
132
132
|
return;
|
@@ -16,7 +16,7 @@ module.exports = {
|
|
16
16
|
type: "suggestion",
|
17
17
|
|
18
18
|
docs: {
|
19
|
-
description: "
|
19
|
+
description: "Enforce a particular style for multiline comments",
|
20
20
|
recommended: false,
|
21
21
|
url: "https://eslint.org/docs/rules/multiline-comment-style"
|
22
22
|
},
|
@@ -17,7 +17,7 @@ module.exports = {
|
|
17
17
|
type: "layout",
|
18
18
|
|
19
19
|
docs: {
|
20
|
-
description: "
|
20
|
+
description: "Enforce newlines between operands of ternary expressions",
|
21
21
|
recommended: false,
|
22
22
|
url: "https://eslint.org/docs/rules/multiline-ternary"
|
23
23
|
},
|
package/lib/rules/new-cap.js
CHANGED
@@ -82,7 +82,7 @@ module.exports = {
|
|
82
82
|
type: "suggestion",
|
83
83
|
|
84
84
|
docs: {
|
85
|
-
description: "
|
85
|
+
description: "Require constructor names to begin with a capital letter",
|
86
86
|
recommended: false,
|
87
87
|
url: "https://eslint.org/docs/rules/new-cap"
|
88
88
|
},
|
package/lib/rules/new-parens.js
CHANGED
@@ -25,7 +25,7 @@ module.exports = {
|
|
25
25
|
type: "layout",
|
26
26
|
|
27
27
|
docs: {
|
28
|
-
description: "
|
28
|
+
description: "Enforce or disallow parentheses when invoking a constructor with no arguments",
|
29
29
|
recommended: false,
|
30
30
|
url: "https://eslint.org/docs/rules/new-parens"
|
31
31
|
},
|
@@ -22,7 +22,7 @@ module.exports = {
|
|
22
22
|
type: "layout",
|
23
23
|
|
24
24
|
docs: {
|
25
|
-
description: "
|
25
|
+
description: "Require or disallow an empty line after variable declarations",
|
26
26
|
recommended: false,
|
27
27
|
url: "https://eslint.org/docs/rules/newline-after-var"
|
28
28
|
},
|
@@ -15,7 +15,7 @@ module.exports = {
|
|
15
15
|
type: "layout",
|
16
16
|
|
17
17
|
docs: {
|
18
|
-
description: "
|
18
|
+
description: "Require an empty line before `return` statements",
|
19
19
|
recommended: false,
|
20
20
|
url: "https://eslint.org/docs/rules/newline-before-return"
|
21
21
|
},
|
@@ -18,7 +18,7 @@ module.exports = {
|
|
18
18
|
type: "layout",
|
19
19
|
|
20
20
|
docs: {
|
21
|
-
description: "
|
21
|
+
description: "Require a newline after each call in a method chain",
|
22
22
|
recommended: false,
|
23
23
|
url: "https://eslint.org/docs/rules/newline-per-chained-call"
|
24
24
|
},
|
package/lib/rules/no-alert.js
CHANGED
@@ -88,7 +88,7 @@ module.exports = {
|
|
88
88
|
type: "suggestion",
|
89
89
|
|
90
90
|
docs: {
|
91
|
-
description: "
|
91
|
+
description: "Disallow the use of `alert`, `confirm`, and `prompt`",
|
92
92
|
recommended: false,
|
93
93
|
url: "https://eslint.org/docs/rules/no-alert"
|
94
94
|
},
|
@@ -14,7 +14,7 @@ module.exports = {
|
|
14
14
|
type: "problem",
|
15
15
|
|
16
16
|
docs: {
|
17
|
-
description: "
|
17
|
+
description: "Disallow using an async function as a Promise executor",
|
18
18
|
recommended: true,
|
19
19
|
url: "https://eslint.org/docs/rules/no-async-promise-executor"
|
20
20
|
},
|
package/lib/rules/no-bitwise.js
CHANGED
@@ -19,7 +19,7 @@ module.exports = {
|
|
19
19
|
type: "problem",
|
20
20
|
|
21
21
|
docs: {
|
22
|
-
description: "
|
22
|
+
description: "Disallow use of the `Buffer()` constructor",
|
23
23
|
recommended: false,
|
24
24
|
url: "https://eslint.org/docs/rules/no-buffer-constructor"
|
25
25
|
},
|
package/lib/rules/no-caller.js
CHANGED
@@ -15,7 +15,7 @@ module.exports = {
|
|
15
15
|
type: "suggestion",
|
16
16
|
|
17
17
|
docs: {
|
18
|
-
description: "
|
18
|
+
description: "Disallow the use of `arguments.caller` or `arguments.callee`",
|
19
19
|
recommended: false,
|
20
20
|
url: "https://eslint.org/docs/rules/no-caller"
|
21
21
|
},
|
@@ -14,7 +14,7 @@ module.exports = {
|
|
14
14
|
type: "suggestion",
|
15
15
|
|
16
16
|
docs: {
|
17
|
-
description: "
|
17
|
+
description: "Disallow lexical declarations in case clauses",
|
18
18
|
recommended: true,
|
19
19
|
url: "https://eslint.org/docs/rules/no-case-declarations"
|
20
20
|
},
|
@@ -22,7 +22,7 @@ module.exports = {
|
|
22
22
|
type: "suggestion",
|
23
23
|
|
24
24
|
docs: {
|
25
|
-
description: "
|
25
|
+
description: "Disallow `catch` clause parameters from shadowing variables in the outer scope",
|
26
26
|
recommended: false,
|
27
27
|
url: "https://eslint.org/docs/rules/no-catch-shadow"
|
28
28
|
},
|
@@ -34,7 +34,7 @@ module.exports = {
|
|
34
34
|
type: "problem",
|
35
35
|
|
36
36
|
docs: {
|
37
|
-
description: "
|
37
|
+
description: "Disallow assignment operators in conditional expressions",
|
38
38
|
recommended: true,
|
39
39
|
url: "https://eslint.org/docs/rules/no-cond-assign"
|
40
40
|
},
|
@@ -31,7 +31,7 @@ module.exports = {
|
|
31
31
|
type: "suggestion",
|
32
32
|
|
33
33
|
docs: {
|
34
|
-
description: "
|
34
|
+
description: "Disallow arrow functions where they could be confused with comparisons",
|
35
35
|
recommended: false,
|
36
36
|
url: "https://eslint.org/docs/rules/no-confusing-arrow"
|
37
37
|
},
|
package/lib/rules/no-console.js
CHANGED
@@ -120,7 +120,7 @@ function isStaticBoolean(scope, node) {
|
|
120
120
|
|
121
121
|
/**
|
122
122
|
* Test if an AST node will always give the same result when compared to a
|
123
|
-
*
|
123
|
+
* boolean value. Note that comparison to boolean values is different than
|
124
124
|
* truthiness.
|
125
125
|
* https://262.ecma-international.org/5.1/#sec-11.9.3
|
126
126
|
*
|
@@ -238,7 +238,7 @@ function hasConstantLooseBooleanComparison(scope, node) {
|
|
238
238
|
|
239
239
|
/**
|
240
240
|
* Test if an AST node will always give the same result when _strictly_ compared
|
241
|
-
* to a
|
241
|
+
* to a boolean value. This can happen if the expression can never be boolean, or
|
242
242
|
* if it is always the same boolean value.
|
243
243
|
* @param {Scope} scope The scope in which the node was found.
|
244
244
|
* @param {ASTNode} node The node to test
|
@@ -432,7 +432,7 @@ module.exports = {
|
|
432
432
|
meta: {
|
433
433
|
type: "problem",
|
434
434
|
docs: {
|
435
|
-
description: "
|
435
|
+
description: "Disallow expressions where the operation doesn't affect the value",
|
436
436
|
recommended: false,
|
437
437
|
url: "https://eslint.org/docs/rules/no-constant-binary-expression"
|
438
438
|
},
|
@@ -488,7 +488,7 @@ module.exports = {
|
|
488
488
|
}
|
489
489
|
|
490
490
|
/*
|
491
|
-
* In theory we could handle short
|
491
|
+
* In theory we could handle short-circuiting assignment operators,
|
492
492
|
* for some constant values, but that would require walking the
|
493
493
|
* scope to find the value of the variable being assigned. This is
|
494
494
|
* dependant on https://github.com/eslint/eslint/issues/13776
|
@@ -21,7 +21,7 @@ module.exports = {
|
|
21
21
|
type: "problem",
|
22
22
|
|
23
23
|
docs: {
|
24
|
-
description: "
|
24
|
+
description: "Disallow constant expressions in conditions",
|
25
25
|
recommended: true,
|
26
26
|
url: "https://eslint.org/docs/rules/no-constant-condition"
|
27
27
|
},
|
@@ -15,7 +15,7 @@ module.exports = {
|
|
15
15
|
type: "problem",
|
16
16
|
|
17
17
|
docs: {
|
18
|
-
description: "
|
18
|
+
description: "Disallow returning value from constructor",
|
19
19
|
recommended: false,
|
20
20
|
url: "https://eslint.org/docs/rules/no-constructor-return"
|
21
21
|
},
|
package/lib/rules/no-continue.js
CHANGED
@@ -54,7 +54,7 @@ module.exports = {
|
|
54
54
|
type: "problem",
|
55
55
|
|
56
56
|
docs: {
|
57
|
-
description: "
|
57
|
+
description: "Disallow control characters in regular expressions",
|
58
58
|
recommended: true,
|
59
59
|
url: "https://eslint.org/docs/rules/no-control-regex"
|
60
60
|
},
|
package/lib/rules/no-debugger.js
CHANGED
@@ -15,7 +15,7 @@ module.exports = {
|
|
15
15
|
type: "suggestion",
|
16
16
|
|
17
17
|
docs: {
|
18
|
-
description: "
|
18
|
+
description: "Disallow division operators explicitly at the beginning of regular expressions",
|
19
19
|
recommended: false,
|
20
20
|
url: "https://eslint.org/docs/rules/no-div-regex"
|
21
21
|
},
|
@@ -15,7 +15,7 @@ module.exports = {
|
|
15
15
|
type: "problem",
|
16
16
|
|
17
17
|
docs: {
|
18
|
-
description: "
|
18
|
+
description: "Disallow duplicate arguments in `function` definitions",
|
19
19
|
recommended: true,
|
20
20
|
url: "https://eslint.org/docs/rules/no-dupe-args"
|
21
21
|
},
|