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/README.md
CHANGED
@@ -261,11 +261,6 @@ Brett Zamir
|
|
261
261
|
Bryan Mishkin
|
262
262
|
</a>
|
263
263
|
</td><td align="center" valign="top" width="11%">
|
264
|
-
<a href="https://github.com/mysticatea">
|
265
|
-
<img src="https://github.com/mysticatea.png?s=75" width="75" height="75"><br />
|
266
|
-
Toru Nagashima
|
267
|
-
</a>
|
268
|
-
</td><td align="center" valign="top" width="11%">
|
269
264
|
<a href="https://github.com/SaraSoueidan">
|
270
265
|
<img src="https://github.com/SaraSoueidan.png?s=75" width="75" height="75"><br />
|
271
266
|
Sara Soueidan
|
@@ -297,9 +292,9 @@ The following companies, organizations, and individuals support ESLint's ongoing
|
|
297
292
|
<!--sponsorsstart-->
|
298
293
|
<h3>Platinum Sponsors</h3>
|
299
294
|
<p><a href="https://automattic.com"><img src="https://images.opencollective.com/automattic/d0ef3e1/logo.png" alt="Automattic" height="undefined"></a></p><h3>Gold Sponsors</h3>
|
300
|
-
<p><a href="https://www.salesforce.com"><img src="https://images.opencollective.com/salesforce/ca8f997/logo.png" alt="Salesforce" height="96"></a> <a href="https://www.airbnb.com/"><img src="https://images.opencollective.com/airbnb/d327d66/logo.png" alt="Airbnb" height="96"></a> <a href="https://americanexpress.io"><img src="https://avatars.githubusercontent.com/u/3853301?v=4" alt="American Express" height="96"></a
|
295
|
+
<p><a href="https://www.salesforce.com"><img src="https://images.opencollective.com/salesforce/ca8f997/logo.png" alt="Salesforce" height="96"></a> <a href="https://www.airbnb.com/"><img src="https://images.opencollective.com/airbnb/d327d66/logo.png" alt="Airbnb" height="96"></a> <a href="https://americanexpress.io"><img src="https://avatars.githubusercontent.com/u/3853301?v=4" alt="American Express" height="96"></a></p><h3>Silver Sponsors</h3>
|
301
296
|
<p><a href="https://liftoff.io/"><img src="https://images.opencollective.com/liftoff/5c4fa84/logo.png" alt="Liftoff" height="64"></a></p><h3>Bronze Sponsors</h3>
|
302
|
-
<p><a href="https://launchdarkly.com"><img src="https://images.opencollective.com/launchdarkly/574bb9e/logo.png" alt="launchdarkly" height="32"></a> <a href="https://nx.dev"><img src="https://images.opencollective.com/nx/0efbe42/logo.png" alt="Nx (by Nrwl)" height="32"></a> <a href="https://www.crosswordsolver.org/anagram-solver/"><img src="https://images.opencollective.com/anagram-solver/2666271/logo.png" alt="Anagram Solver" height="32"></a> <a href="https://www.vpsserver.com"><img src="https://images.opencollective.com/vpsservercom/logo.png" alt="VPS" height="32"></a> <a href="https://icons8.com"><img src="https://images.opencollective.com/icons8/7fa1641/logo.png" alt="Icons8: free icons, photos, illustrations, and music" height="32"></a> <a href="https://discord.com"><img src="https://images.opencollective.com/discordapp/f9645d9/logo.png" alt="Discord" height="32"></a> <a href="https://themeisle.com"><img src="https://images.opencollective.com/themeisle/d5592fe/logo.png" alt="ThemeIsle" height="32"></a> <a href="https://www.ignitionapp.com"><img src="https://avatars.githubusercontent.com/u/5753491?v=4" alt="Ignition" height="32"></a></p>
|
297
|
+
<p><a href="https://launchdarkly.com"><img src="https://images.opencollective.com/launchdarkly/574bb9e/logo.png" alt="launchdarkly" height="32"></a> <a href="https://nx.dev"><img src="https://images.opencollective.com/nx/0efbe42/logo.png" alt="Nx (by Nrwl)" height="32"></a> <a href="https://www.crosswordsolver.org/anagram-solver/"><img src="https://images.opencollective.com/anagram-solver/2666271/logo.png" alt="Anagram Solver" height="32"></a> <a href="https://www.vpsserver.com"><img src="https://images.opencollective.com/vpsservercom/logo.png" alt="VPS" height="32"></a> <a href="https://icons8.com"><img src="https://images.opencollective.com/icons8/7fa1641/logo.png" alt="Icons8: free icons, photos, illustrations, and music" height="32"></a> <a href="https://discord.com"><img src="https://images.opencollective.com/discordapp/f9645d9/logo.png" alt="Discord" height="32"></a> <a href="https://themeisle.com"><img src="https://images.opencollective.com/themeisle/d5592fe/logo.png" alt="ThemeIsle" height="32"></a> <a href="https://www.ignitionapp.com"><img src="https://avatars.githubusercontent.com/u/5753491?v=4" alt="Ignition" height="32"></a> <a href="https://herocoders.com"><img src="https://avatars.githubusercontent.com/u/37549774?v=4" alt="HeroCoders" height="32"></a></p>
|
303
298
|
<!--sponsorsend-->
|
304
299
|
|
305
300
|
## <a name="technology-sponsors"></a>Technology Sponsors
|
package/bin/eslint.js
CHANGED
@@ -69,7 +69,7 @@ function getErrorMessage(error) {
|
|
69
69
|
// Lazy loading because this is used only if an error happened.
|
70
70
|
const util = require("util");
|
71
71
|
|
72
|
-
// Foolproof --
|
72
|
+
// Foolproof -- third-party module might throw non-object.
|
73
73
|
if (typeof error !== "object" || error === null) {
|
74
74
|
return String(error);
|
75
75
|
}
|
package/lib/eslint/eslint.js
CHANGED
@@ -104,9 +104,9 @@ function isNonEmptyString(x) {
|
|
104
104
|
}
|
105
105
|
|
106
106
|
/**
|
107
|
-
* Check if a given value is an array of non-empty
|
107
|
+
* Check if a given value is an array of non-empty strings or not.
|
108
108
|
* @param {any} x The value to check.
|
109
|
-
* @returns {boolean} `true` if `x` is an array of non-empty
|
109
|
+
* @returns {boolean} `true` if `x` is an array of non-empty strings.
|
110
110
|
*/
|
111
111
|
function isArrayOfNonEmptyString(x) {
|
112
112
|
return Array.isArray(x) && x.every(isNonEmptyString);
|
@@ -599,7 +599,7 @@ class ESLint {
|
|
599
599
|
* The following values are allowed:
|
600
600
|
* - `undefined` ... Load `stylish` builtin formatter.
|
601
601
|
* - A builtin formatter name ... Load the builtin formatter.
|
602
|
-
* - A
|
602
|
+
* - A third-party formatter name:
|
603
603
|
* - `foo` → `eslint-formatter-foo`
|
604
604
|
* - `@foo` → `@foo/eslint-formatter`
|
605
605
|
* - `@foo/bar` → `@foo/eslint-formatter-bar`
|
package/lib/linter/linter.js
CHANGED
@@ -1101,7 +1101,7 @@ function runRules(sourceCode, configuredRules, ruleMapper, parserName, languageO
|
|
1101
1101
|
)
|
1102
1102
|
);
|
1103
1103
|
|
1104
|
-
const ruleListeners = createRuleListeners(rule, ruleContext);
|
1104
|
+
const ruleListeners = timing.enabled ? timing.time(ruleId, createRuleListeners)(rule, ruleContext) : createRuleListeners(rule, ruleContext);
|
1105
1105
|
|
1106
1106
|
/**
|
1107
1107
|
* Include `ruleId` in error logs
|
@@ -1119,6 +1119,10 @@ function runRules(sourceCode, configuredRules, ruleMapper, parserName, languageO
|
|
1119
1119
|
};
|
1120
1120
|
}
|
1121
1121
|
|
1122
|
+
if (typeof ruleListeners === "undefined" || ruleListeners === null) {
|
1123
|
+
throw new Error(`The create() function for rule '${ruleId}' did not return an object.`);
|
1124
|
+
}
|
1125
|
+
|
1122
1126
|
// add all the selectors from the rule as listeners
|
1123
1127
|
Object.keys(ruleListeners).forEach(selector => {
|
1124
1128
|
const ruleListener = timing.enabled
|
package/lib/linter/timing.js
CHANGED
@@ -138,10 +138,11 @@ module.exports = (function() {
|
|
138
138
|
|
139
139
|
return function(...args) {
|
140
140
|
let t = process.hrtime();
|
141
|
+
const result = fn(...args);
|
141
142
|
|
142
|
-
fn(...args);
|
143
143
|
t = process.hrtime(t);
|
144
144
|
data[key] += t[0] * 1e3 + t[1] / 1e6;
|
145
|
+
return result;
|
145
146
|
};
|
146
147
|
}
|
147
148
|
|
@@ -140,7 +140,7 @@ module.exports = {
|
|
140
140
|
type: "suggestion",
|
141
141
|
|
142
142
|
docs: {
|
143
|
-
description: "
|
143
|
+
description: "Enforce getter and setter pairs in objects and classes",
|
144
144
|
recommended: false,
|
145
145
|
url: "https://eslint.org/docs/rules/accessor-pairs"
|
146
146
|
},
|
@@ -17,7 +17,7 @@ module.exports = {
|
|
17
17
|
type: "layout",
|
18
18
|
|
19
19
|
docs: {
|
20
|
-
description: "
|
20
|
+
description: "Enforce linebreaks after opening and before closing array brackets",
|
21
21
|
recommended: false,
|
22
22
|
url: "https://eslint.org/docs/rules/array-bracket-newline"
|
23
23
|
},
|
@@ -16,7 +16,7 @@ module.exports = {
|
|
16
16
|
type: "layout",
|
17
17
|
|
18
18
|
docs: {
|
19
|
-
description: "
|
19
|
+
description: "Enforce consistent spacing inside array brackets",
|
20
20
|
recommended: false,
|
21
21
|
url: "https://eslint.org/docs/rules/array-bracket-spacing"
|
22
22
|
},
|
@@ -139,7 +139,7 @@ module.exports = {
|
|
139
139
|
type: "problem",
|
140
140
|
|
141
141
|
docs: {
|
142
|
-
description: "
|
142
|
+
description: "Enforce `return` statements in callbacks of array methods",
|
143
143
|
recommended: false,
|
144
144
|
url: "https://eslint.org/docs/rules/array-callback-return"
|
145
145
|
},
|
@@ -17,7 +17,7 @@ module.exports = {
|
|
17
17
|
type: "layout",
|
18
18
|
|
19
19
|
docs: {
|
20
|
-
description: "
|
20
|
+
description: "Enforce line breaks after each array element",
|
21
21
|
recommended: false,
|
22
22
|
url: "https://eslint.org/docs/rules/array-element-newline"
|
23
23
|
},
|
@@ -20,7 +20,7 @@ module.exports = {
|
|
20
20
|
type: "suggestion",
|
21
21
|
|
22
22
|
docs: {
|
23
|
-
description: "
|
23
|
+
description: "Require braces around arrow function bodies",
|
24
24
|
recommended: false,
|
25
25
|
url: "https://eslint.org/docs/rules/arrow-body-style"
|
26
26
|
},
|
@@ -33,7 +33,7 @@ module.exports = {
|
|
33
33
|
type: "layout",
|
34
34
|
|
35
35
|
docs: {
|
36
|
-
description: "
|
36
|
+
description: "Require parentheses around arrow function arguments",
|
37
37
|
recommended: false,
|
38
38
|
url: "https://eslint.org/docs/rules/arrow-parens"
|
39
39
|
},
|
@@ -20,7 +20,7 @@ module.exports = {
|
|
20
20
|
type: "layout",
|
21
21
|
|
22
22
|
docs: {
|
23
|
-
description: "
|
23
|
+
description: "Enforce consistent spacing before and after the arrow in arrow functions",
|
24
24
|
recommended: false,
|
25
25
|
url: "https://eslint.org/docs/rules/arrow-spacing"
|
26
26
|
},
|
@@ -14,7 +14,7 @@ module.exports = {
|
|
14
14
|
type: "suggestion",
|
15
15
|
|
16
16
|
docs: {
|
17
|
-
description: "
|
17
|
+
description: "Enforce the use of variables within the scope they are defined",
|
18
18
|
recommended: false,
|
19
19
|
url: "https://eslint.org/docs/rules/block-scoped-var"
|
20
20
|
},
|
@@ -17,7 +17,7 @@ module.exports = {
|
|
17
17
|
type: "layout",
|
18
18
|
|
19
19
|
docs: {
|
20
|
-
description: "
|
20
|
+
description: "Disallow or enforce spaces inside of blocks after opening block and before closing block",
|
21
21
|
recommended: false,
|
22
22
|
url: "https://eslint.org/docs/rules/block-spacing"
|
23
23
|
},
|
package/lib/rules/brace-style.js
CHANGED
@@ -19,7 +19,7 @@ module.exports = {
|
|
19
19
|
type: "suggestion",
|
20
20
|
|
21
21
|
docs: {
|
22
|
-
description: "
|
22
|
+
description: "Require `return` statements after callbacks",
|
23
23
|
recommended: false,
|
24
24
|
url: "https://eslint.org/docs/rules/callback-return"
|
25
25
|
},
|
package/lib/rules/camelcase.js
CHANGED
@@ -105,7 +105,7 @@ module.exports = {
|
|
105
105
|
type: "suggestion",
|
106
106
|
|
107
107
|
docs: {
|
108
|
-
description: "
|
108
|
+
description: "Enforce or disallow capitalization of the first letter of a comment",
|
109
109
|
recommended: false,
|
110
110
|
url: "https://eslint.org/docs/rules/capitalized-comments"
|
111
111
|
},
|
@@ -21,7 +21,7 @@ module.exports = {
|
|
21
21
|
type: "suggestion",
|
22
22
|
|
23
23
|
docs: {
|
24
|
-
description: "
|
24
|
+
description: "Enforce that class methods utilize `this`",
|
25
25
|
recommended: false,
|
26
26
|
url: "https://eslint.org/docs/rules/class-methods-use-this"
|
27
27
|
},
|
@@ -16,7 +16,7 @@ module.exports = {
|
|
16
16
|
type: "layout",
|
17
17
|
|
18
18
|
docs: {
|
19
|
-
description: "
|
19
|
+
description: "Enforce consistent spacing before and after commas",
|
20
20
|
recommended: false,
|
21
21
|
url: "https://eslint.org/docs/rules/comma-spacing"
|
22
22
|
},
|
package/lib/rules/comma-style.js
CHANGED
package/lib/rules/complexity.js
CHANGED
@@ -23,7 +23,7 @@ module.exports = {
|
|
23
23
|
type: "suggestion",
|
24
24
|
|
25
25
|
docs: {
|
26
|
-
description: "
|
26
|
+
description: "Enforce a maximum cyclomatic complexity allowed in a program",
|
27
27
|
recommended: false,
|
28
28
|
url: "https://eslint.org/docs/rules/complexity"
|
29
29
|
},
|
@@ -16,7 +16,7 @@ module.exports = {
|
|
16
16
|
type: "layout",
|
17
17
|
|
18
18
|
docs: {
|
19
|
-
description: "
|
19
|
+
description: "Enforce consistent spacing inside computed property brackets",
|
20
20
|
recommended: false,
|
21
21
|
url: "https://eslint.org/docs/rules/computed-property-spacing"
|
22
22
|
},
|
@@ -46,7 +46,7 @@ module.exports = {
|
|
46
46
|
type: "suggestion",
|
47
47
|
|
48
48
|
docs: {
|
49
|
-
description: "
|
49
|
+
description: "Require `return` statements to either always or never specify values",
|
50
50
|
recommended: false,
|
51
51
|
url: "https://eslint.org/docs/rules/consistent-return"
|
52
52
|
},
|
@@ -14,7 +14,7 @@ module.exports = {
|
|
14
14
|
type: "suggestion",
|
15
15
|
|
16
16
|
docs: {
|
17
|
-
description: "
|
17
|
+
description: "Enforce consistent naming when capturing the current execution context",
|
18
18
|
recommended: false,
|
19
19
|
url: "https://eslint.org/docs/rules/consistent-this"
|
20
20
|
},
|
@@ -122,7 +122,7 @@ module.exports = {
|
|
122
122
|
type: "problem",
|
123
123
|
|
124
124
|
docs: {
|
125
|
-
description: "
|
125
|
+
description: "Require `super()` calls in constructors",
|
126
126
|
recommended: true,
|
127
127
|
url: "https://eslint.org/docs/rules/constructor-super"
|
128
128
|
},
|
package/lib/rules/curly.js
CHANGED
@@ -20,7 +20,7 @@ module.exports = {
|
|
20
20
|
type: "suggestion",
|
21
21
|
|
22
22
|
docs: {
|
23
|
-
description: "
|
23
|
+
description: "Enforce consistent brace style for all control statements",
|
24
24
|
recommended: false,
|
25
25
|
url: "https://eslint.org/docs/rules/curly"
|
26
26
|
},
|
@@ -15,7 +15,7 @@ module.exports = {
|
|
15
15
|
type: "suggestion",
|
16
16
|
|
17
17
|
docs: {
|
18
|
-
description: "
|
18
|
+
description: "Enforce default clauses in switch statements to be last",
|
19
19
|
recommended: false,
|
20
20
|
url: "https://eslint.org/docs/rules/default-case-last"
|
21
21
|
},
|
@@ -16,7 +16,7 @@ module.exports = {
|
|
16
16
|
type: "suggestion",
|
17
17
|
|
18
18
|
docs: {
|
19
|
-
description: "
|
19
|
+
description: "Require `default` cases in `switch` statements",
|
20
20
|
recommended: false,
|
21
21
|
url: "https://eslint.org/docs/rules/default-case"
|
22
22
|
},
|
@@ -17,7 +17,7 @@ module.exports = {
|
|
17
17
|
type: "layout",
|
18
18
|
|
19
19
|
docs: {
|
20
|
-
description: "
|
20
|
+
description: "Enforce consistent newlines before and after dots",
|
21
21
|
recommended: false,
|
22
22
|
url: "https://eslint.org/docs/rules/dot-location"
|
23
23
|
},
|
package/lib/rules/eol-last.js
CHANGED
@@ -14,7 +14,7 @@ module.exports = {
|
|
14
14
|
type: "layout",
|
15
15
|
|
16
16
|
docs: {
|
17
|
-
description: "
|
17
|
+
description: "Require or disallow newline at the end of files",
|
18
18
|
recommended: false,
|
19
19
|
url: "https://eslint.org/docs/rules/eol-last"
|
20
20
|
},
|
package/lib/rules/eqeqeq.js
CHANGED
@@ -15,7 +15,7 @@ module.exports = {
|
|
15
15
|
type: "problem",
|
16
16
|
|
17
17
|
docs: {
|
18
|
-
description: "
|
18
|
+
description: "Enforce \"for\" loop update clause moving the counter in the right direction.",
|
19
19
|
recommended: true,
|
20
20
|
url: "https://eslint.org/docs/rules/for-direction"
|
21
21
|
},
|
@@ -21,7 +21,7 @@ module.exports = {
|
|
21
21
|
type: "layout",
|
22
22
|
|
23
23
|
docs: {
|
24
|
-
description: "
|
24
|
+
description: "Require or disallow spacing between function identifiers and their invocations",
|
25
25
|
recommended: false,
|
26
26
|
url: "https://eslint.org/docs/rules/func-call-spacing"
|
27
27
|
},
|
@@ -74,7 +74,7 @@ module.exports = {
|
|
74
74
|
type: "suggestion",
|
75
75
|
|
76
76
|
docs: {
|
77
|
-
description: "
|
77
|
+
description: "Require function names to match the name of the variable or property to which they are assigned",
|
78
78
|
recommended: false,
|
79
79
|
url: "https://eslint.org/docs/rules/func-name-matching"
|
80
80
|
},
|
package/lib/rules/func-names.js
CHANGED
@@ -30,7 +30,7 @@ module.exports = {
|
|
30
30
|
type: "suggestion",
|
31
31
|
|
32
32
|
docs: {
|
33
|
-
description: "
|
33
|
+
description: "Require or disallow named `function` expressions",
|
34
34
|
recommended: false,
|
35
35
|
url: "https://eslint.org/docs/rules/func-names"
|
36
36
|
},
|
package/lib/rules/func-style.js
CHANGED
@@ -14,7 +14,7 @@ module.exports = {
|
|
14
14
|
type: "suggestion",
|
15
15
|
|
16
16
|
docs: {
|
17
|
-
description: "
|
17
|
+
description: "Enforce the consistent use of either `function` declarations or expressions",
|
18
18
|
recommended: false,
|
19
19
|
url: "https://eslint.org/docs/rules/func-style"
|
20
20
|
},
|
@@ -15,7 +15,7 @@ module.exports = {
|
|
15
15
|
type: "layout",
|
16
16
|
|
17
17
|
docs: {
|
18
|
-
description: "
|
18
|
+
description: "Enforce line breaks between arguments of a function call",
|
19
19
|
recommended: false,
|
20
20
|
url: "https://eslint.org/docs/rules/function-call-argument-newline"
|
21
21
|
},
|
@@ -20,7 +20,7 @@ module.exports = {
|
|
20
20
|
type: "layout",
|
21
21
|
|
22
22
|
docs: {
|
23
|
-
description: "
|
23
|
+
description: "Enforce consistent line breaks inside function parentheses",
|
24
24
|
recommended: false,
|
25
25
|
url: "https://eslint.org/docs/rules/function-paren-newline"
|
26
26
|
},
|
@@ -183,7 +183,7 @@ module.exports = {
|
|
183
183
|
/**
|
184
184
|
* Gets the left paren and right paren tokens of a node.
|
185
185
|
* @param {ASTNode} node The node with parens
|
186
|
-
* @throws {TypeError}
|
186
|
+
* @throws {TypeError} Unexpected node type.
|
187
187
|
* @returns {Object} An object with keys `leftParen` for the left paren token, and `rightParen` for the right paren token.
|
188
188
|
* Can also return `null` if an expression has no parens (e.g. a NewExpression with no arguments, or an ArrowFunctionExpression
|
189
189
|
* with a single parameter)
|
@@ -31,7 +31,7 @@ module.exports = {
|
|
31
31
|
type: "layout",
|
32
32
|
|
33
33
|
docs: {
|
34
|
-
description: "
|
34
|
+
description: "Enforce consistent spacing around `*` operators in generator functions",
|
35
35
|
recommended: false,
|
36
36
|
url: "https://eslint.org/docs/rules/generator-star-spacing"
|
37
37
|
},
|
@@ -58,7 +58,7 @@ module.exports = {
|
|
58
58
|
type: "suggestion",
|
59
59
|
|
60
60
|
docs: {
|
61
|
-
description: "
|
61
|
+
description: "Require `require()` calls to be placed at top-level module scope",
|
62
62
|
recommended: false,
|
63
63
|
url: "https://eslint.org/docs/rules/global-require"
|
64
64
|
},
|
@@ -96,7 +96,7 @@ module.exports = {
|
|
96
96
|
type: "suggestion",
|
97
97
|
|
98
98
|
docs: {
|
99
|
-
description: "
|
99
|
+
description: "Require grouped accessor pairs in object literals and classes",
|
100
100
|
recommended: false,
|
101
101
|
url: "https://eslint.org/docs/rules/grouped-accessor-pairs"
|
102
102
|
},
|
@@ -15,7 +15,7 @@ module.exports = {
|
|
15
15
|
type: "suggestion",
|
16
16
|
|
17
17
|
docs: {
|
18
|
-
description: "
|
18
|
+
description: "Require `for-in` loops to include an `if` statement",
|
19
19
|
recommended: false,
|
20
20
|
url: "https://eslint.org/docs/rules/guard-for-in"
|
21
21
|
},
|
package/lib/rules/id-denylist.js
CHANGED
package/lib/rules/id-length.js
CHANGED
@@ -16,7 +16,7 @@ module.exports = {
|
|
16
16
|
type: "suggestion",
|
17
17
|
|
18
18
|
docs: {
|
19
|
-
description: "
|
19
|
+
description: "Enforce minimum and maximum identifier lengths",
|
20
20
|
recommended: false,
|
21
21
|
url: "https://eslint.org/docs/rules/id-length"
|
22
22
|
},
|
package/lib/rules/id-match.js
CHANGED
@@ -15,7 +15,7 @@ module.exports = {
|
|
15
15
|
type: "suggestion",
|
16
16
|
|
17
17
|
docs: {
|
18
|
-
description: "
|
18
|
+
description: "Require identifiers to match a specified regular expression",
|
19
19
|
recommended: false,
|
20
20
|
url: "https://eslint.org/docs/rules/id-match"
|
21
21
|
},
|
@@ -15,7 +15,7 @@ module.exports = {
|
|
15
15
|
type: "layout",
|
16
16
|
|
17
17
|
docs: {
|
18
|
-
description: "
|
18
|
+
description: "Enforce the location of arrow function bodies",
|
19
19
|
recommended: false,
|
20
20
|
url: "https://eslint.org/docs/rules/implicit-arrow-linebreak"
|
21
21
|
},
|