From 528e1c00dc2aa8636e5b706c4270dc655cfa17e3 Mon Sep 17 00:00:00 2001 From: "Nicholas C. Zakas" Date: Fri, 3 Nov 2023 11:12:29 -0400 Subject: [PATCH] feat: Deprecate formatting rules (#17696) * feat: Deprecate formatting rules Fixes #17522 * Add deprecation notice to rule files * Fix tests * Update eslint:all test * Add deprecation notice to docs * Clarify error message for rule check * Update eslint:all test --- Makefile.js | 2 +- docs/src/rules/array-bracket-newline.md | 2 +- docs/src/rules/array-bracket-spacing.md | 2 +- docs/src/rules/array-element-newline.md | 2 +- docs/src/rules/arrow-parens.md | 2 +- docs/src/rules/arrow-spacing.md | 2 +- docs/src/rules/block-spacing.md | 2 +- docs/src/rules/brace-style.md | 2 +- docs/src/rules/comma-dangle.md | 2 +- docs/src/rules/comma-spacing.md | 2 +- docs/src/rules/comma-style.md | 2 +- docs/src/rules/computed-property-spacing.md | 2 +- docs/src/rules/dot-location.md | 2 +- docs/src/rules/eol-last.md | 2 +- docs/src/rules/func-call-spacing.md | 2 +- .../rules/function-call-argument-newline.md | 2 +- docs/src/rules/function-paren-newline.md | 2 +- docs/src/rules/generator-star-spacing.md | 2 +- docs/src/rules/implicit-arrow-linebreak.md | 2 +- docs/src/rules/indent.md | 2 +- docs/src/rules/jsx-quotes.md | 2 +- docs/src/rules/key-spacing.md | 2 +- docs/src/rules/keyword-spacing.md | 2 +- docs/src/rules/linebreak-style.md | 2 +- docs/src/rules/lines-around-comment.md | 2 +- docs/src/rules/lines-between-class-members.md | 2 +- docs/src/rules/max-len.md | 1 + docs/src/rules/max-statements-per-line.md | 1 + docs/src/rules/multiline-ternary.md | 2 +- docs/src/rules/new-parens.md | 2 +- docs/src/rules/newline-per-chained-call.md | 2 +- docs/src/rules/no-confusing-arrow.md | 2 +- docs/src/rules/no-extra-parens.md | 2 +- docs/src/rules/no-extra-semi.md | 4 +- docs/src/rules/no-floating-decimal.md | 2 +- docs/src/rules/no-mixed-operators.md | 1 + docs/src/rules/no-mixed-spaces-and-tabs.md | 2 +- docs/src/rules/no-multi-spaces.md | 2 +- docs/src/rules/no-multiple-empty-lines.md | 2 +- docs/src/rules/no-tabs.md | 1 + docs/src/rules/no-trailing-spaces.md | 2 +- .../rules/no-whitespace-before-property.md | 2 +- .../rules/nonblock-statement-body-position.md | 2 +- docs/src/rules/object-curly-newline.md | 2 +- docs/src/rules/object-curly-spacing.md | 2 +- docs/src/rules/object-property-newline.md | 2 +- .../src/rules/one-var-declaration-per-line.md | 2 +- docs/src/rules/operator-linebreak.md | 2 +- docs/src/rules/padded-blocks.md | 2 +- .../rules/padding-line-between-statements.md | 2 +- docs/src/rules/quote-props.md | 2 +- docs/src/rules/quotes.md | 2 +- docs/src/rules/rest-spread-spacing.md | 2 +- docs/src/rules/semi-spacing.md | 2 +- docs/src/rules/semi-style.md | 2 +- docs/src/rules/semi.md | 2 +- docs/src/rules/space-before-blocks.md | 2 +- docs/src/rules/space-before-function-paren.md | 2 +- docs/src/rules/space-in-parens.md | 2 +- docs/src/rules/space-infix-ops.md | 2 +- docs/src/rules/space-unary-ops.md | 2 +- docs/src/rules/spaced-comment.md | 2 +- docs/src/rules/switch-colon-spacing.md | 2 +- docs/src/rules/template-curly-spacing.md | 2 +- docs/src/rules/template-tag-spacing.md | 2 +- docs/src/rules/wrap-iife.md | 2 +- docs/src/rules/wrap-regex.md | 2 +- docs/src/rules/yield-star-spacing.md | 2 +- lib/rules/array-bracket-newline.js | 3 + lib/rules/array-bracket-spacing.js | 3 + lib/rules/array-element-newline.js | 3 + lib/rules/arrow-parens.js | 3 + lib/rules/arrow-spacing.js | 3 + lib/rules/block-spacing.js | 3 + lib/rules/brace-style.js | 3 + lib/rules/comma-dangle.js | 3 + lib/rules/comma-spacing.js | 3 + lib/rules/comma-style.js | 3 + lib/rules/computed-property-spacing.js | 3 + lib/rules/dot-location.js | 3 + lib/rules/eol-last.js | 3 + lib/rules/func-call-spacing.js | 3 + lib/rules/function-call-argument-newline.js | 3 + lib/rules/function-paren-newline.js | 3 + lib/rules/generator-star-spacing.js | 3 + lib/rules/implicit-arrow-linebreak.js | 3 + lib/rules/indent.js | 3 + lib/rules/jsx-quotes.js | 3 + lib/rules/key-spacing.js | 3 + lib/rules/keyword-spacing.js | 3 + lib/rules/linebreak-style.js | 3 + lib/rules/lines-around-comment.js | 3 + lib/rules/lines-between-class-members.js | 3 + lib/rules/max-len.js | 3 + lib/rules/max-statements-per-line.js | 3 + lib/rules/multiline-ternary.js | 3 + lib/rules/new-parens.js | 3 + lib/rules/newline-per-chained-call.js | 3 + lib/rules/no-confusing-arrow.js | 3 + lib/rules/no-extra-parens.js | 3 + lib/rules/no-extra-semi.js | 3 + lib/rules/no-floating-decimal.js | 3 + lib/rules/no-mixed-operators.js | 3 + lib/rules/no-mixed-spaces-and-tabs.js | 3 + lib/rules/no-multi-spaces.js | 3 + lib/rules/no-multiple-empty-lines.js | 3 + lib/rules/no-tabs.js | 3 + lib/rules/no-trailing-spaces.js | 3 + lib/rules/no-whitespace-before-property.js | 3 + lib/rules/nonblock-statement-body-position.js | 3 + lib/rules/object-curly-newline.js | 3 + lib/rules/object-curly-spacing.js | 3 + lib/rules/object-property-newline.js | 3 + lib/rules/one-var-declaration-per-line.js | 3 + lib/rules/operator-linebreak.js | 3 + lib/rules/padded-blocks.js | 3 + lib/rules/padding-line-between-statements.js | 3 + lib/rules/quote-props.js | 3 + lib/rules/quotes.js | 3 + lib/rules/rest-spread-spacing.js | 3 + lib/rules/semi-spacing.js | 3 + lib/rules/semi-style.js | 3 + lib/rules/semi.js | 3 + lib/rules/space-before-blocks.js | 3 + lib/rules/space-before-function-paren.js | 3 + lib/rules/space-in-parens.js | 3 + lib/rules/space-infix-ops.js | 3 + lib/rules/space-unary-ops.js | 3 + lib/rules/spaced-comment.js | 3 + lib/rules/switch-colon-spacing.js | 3 + lib/rules/template-curly-spacing.js | 3 + lib/rules/template-tag-spacing.js | 3 + lib/rules/wrap-iife.js | 3 + lib/rules/wrap-regex.js | 3 + lib/rules/yield-star-spacing.js | 3 + packages/js/src/configs/eslint-all.js | 67 --------------- tests/bin/eslint.js | 7 +- tests/conf/eslint-all.js | 2 +- tests/lib/cli-engine/cli-engine.js | 11 ++- tests/lib/eslint/eslint.js | 84 ++++++++++++++++--- tests/lib/eslint/flat-eslint.js | 82 +++++++++++++++--- 141 files changed, 428 insertions(+), 160 deletions(-) diff --git a/Makefile.js b/Makefile.js index 8a963388ebe..24accfb6103 100644 --- a/Makefile.js +++ b/Makefile.js @@ -826,7 +826,7 @@ target.checkRuleFiles = function() { // check deprecated if (ruleDef.meta.deprecated && !hasDeprecatedInfo()) { - console.error(`Missing deprecated information in ${basename} rule code or README.md. Please write @deprecated tag in code or 「This rule was deprecated in ESLint ...」 in README.md.`); + console.error(`Missing deprecated information in ${basename} rule code or README.md. Please write @deprecated tag in code and「This rule was deprecated in ESLint ...」 in README.md.`); errors++; } diff --git a/docs/src/rules/array-bracket-newline.md b/docs/src/rules/array-bracket-newline.md index 4ad7e27b560..2ccb13dddf9 100644 --- a/docs/src/rules/array-bracket-newline.md +++ b/docs/src/rules/array-bracket-newline.md @@ -5,7 +5,7 @@ related_rules: - array-bracket-spacing --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). A number of style guides require or disallow line breaks inside of array brackets. diff --git a/docs/src/rules/array-bracket-spacing.md b/docs/src/rules/array-bracket-spacing.md index 5b6dd8a7cac..0fdc8310747 100644 --- a/docs/src/rules/array-bracket-spacing.md +++ b/docs/src/rules/array-bracket-spacing.md @@ -7,7 +7,7 @@ related_rules: - computed-property-spacing --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). A number of style guides require or disallow spaces between array brackets and other tokens. This rule applies to both array literals and destructuring assignments (ECMAScript 6). diff --git a/docs/src/rules/array-element-newline.md b/docs/src/rules/array-element-newline.md index 2b34bd53014..0a8bc39b9bc 100644 --- a/docs/src/rules/array-element-newline.md +++ b/docs/src/rules/array-element-newline.md @@ -12,7 +12,7 @@ related_rules: - brace-style --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). A number of style guides require or disallow line breaks between array elements. diff --git a/docs/src/rules/arrow-parens.md b/docs/src/rules/arrow-parens.md index 8b956c35664..4bfa819f87b 100644 --- a/docs/src/rules/arrow-parens.md +++ b/docs/src/rules/arrow-parens.md @@ -5,7 +5,7 @@ further_reading: - https://github.com/airbnb/javascript#arrows--one-arg-parens --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). Arrow functions can omit parentheses when they have exactly one parameter. In all other cases the parameter(s) must be wrapped in parentheses. This rule enforces the consistent use of parentheses in arrow functions. diff --git a/docs/src/rules/arrow-spacing.md b/docs/src/rules/arrow-spacing.md index fa5a42410a4..3975e9f82cd 100644 --- a/docs/src/rules/arrow-spacing.md +++ b/docs/src/rules/arrow-spacing.md @@ -3,7 +3,7 @@ title: arrow-spacing rule_type: layout --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). This rule normalize style of spacing before/after an arrow function's arrow(`=>`). diff --git a/docs/src/rules/block-spacing.md b/docs/src/rules/block-spacing.md index 415fc7db0bd..831916b55e7 100644 --- a/docs/src/rules/block-spacing.md +++ b/docs/src/rules/block-spacing.md @@ -6,7 +6,7 @@ related_rules: - brace-style --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). ## Rule Details diff --git a/docs/src/rules/brace-style.md b/docs/src/rules/brace-style.md index 456ccf2c2e1..8fb982328a6 100644 --- a/docs/src/rules/brace-style.md +++ b/docs/src/rules/brace-style.md @@ -8,7 +8,7 @@ further_reading: - https://en.wikipedia.org/wiki/Indent_style --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). Brace style is closely related to [indent style](https://en.wikipedia.org/wiki/Indent_style) in programming and describes the placement of braces relative to their control statement and body. There are probably a dozen, if not more, brace styles in the world. diff --git a/docs/src/rules/comma-dangle.md b/docs/src/rules/comma-dangle.md index 1370874ed50..17685a08f3d 100644 --- a/docs/src/rules/comma-dangle.md +++ b/docs/src/rules/comma-dangle.md @@ -3,7 +3,7 @@ title: comma-dangle rule_type: layout --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). Trailing commas in object literals are valid according to the ECMAScript 5 (and ECMAScript 3!) spec. However, IE8 (when not in IE8 document mode) and below will throw an error when it encounters trailing commas in JavaScript. diff --git a/docs/src/rules/comma-spacing.md b/docs/src/rules/comma-spacing.md index 9bc7f82dd24..e4d430997be 100644 --- a/docs/src/rules/comma-spacing.md +++ b/docs/src/rules/comma-spacing.md @@ -16,7 +16,7 @@ further_reading: - https://dojotoolkit.org/reference-guide/1.9/developer/styleguide.html --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). Spacing around commas improves readability of a list of items. Although most of the style guidelines for languages prescribe adding a space after a comma and not before it, it is subjective to the preferences of a project. diff --git a/docs/src/rules/comma-style.md b/docs/src/rules/comma-style.md index 6936cdbcb24..5859710ee89 100644 --- a/docs/src/rules/comma-style.md +++ b/docs/src/rules/comma-style.md @@ -7,7 +7,7 @@ further_reading: - https://gist.github.com/isaacs/357981 --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). The Comma Style rule enforces styles for comma-separated lists. There are two comma styles primarily used in JavaScript: diff --git a/docs/src/rules/computed-property-spacing.md b/docs/src/rules/computed-property-spacing.md index 065270d6caf..424e97cce63 100644 --- a/docs/src/rules/computed-property-spacing.md +++ b/docs/src/rules/computed-property-spacing.md @@ -7,7 +7,7 @@ related_rules: - space-in-parens --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). While formatting preferences are very personal, a number of style guides require or disallow spaces between computed properties in the following situations: diff --git a/docs/src/rules/dot-location.md b/docs/src/rules/dot-location.md index 47ee575be97..8abb47708f4 100644 --- a/docs/src/rules/dot-location.md +++ b/docs/src/rules/dot-location.md @@ -6,7 +6,7 @@ related_rules: - dot-notation --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). JavaScript allows you to place newlines before or after a dot in a member expression. diff --git a/docs/src/rules/eol-last.md b/docs/src/rules/eol-last.md index 2a8de22258b..c4c0dc991f0 100644 --- a/docs/src/rules/eol-last.md +++ b/docs/src/rules/eol-last.md @@ -3,7 +3,7 @@ title: eol-last rule_type: layout --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). Trailing newlines in non-empty files are a common UNIX idiom. Benefits of trailing newlines include the ability to concatenate or append to files as well diff --git a/docs/src/rules/func-call-spacing.md b/docs/src/rules/func-call-spacing.md index 082c86d8140..2821630fdbf 100644 --- a/docs/src/rules/func-call-spacing.md +++ b/docs/src/rules/func-call-spacing.md @@ -5,7 +5,7 @@ related_rules: - no-spaced-func --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). When calling a function, developers may insert optional whitespace between the function's name and the parentheses that invoke it. The following pairs of function calls are equivalent: diff --git a/docs/src/rules/function-call-argument-newline.md b/docs/src/rules/function-call-argument-newline.md index be44b2ed7e9..73adf30c59f 100644 --- a/docs/src/rules/function-call-argument-newline.md +++ b/docs/src/rules/function-call-argument-newline.md @@ -8,7 +8,7 @@ related_rules: - array-element-newline --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). A number of style guides require or disallow line breaks between arguments of a function call. diff --git a/docs/src/rules/function-paren-newline.md b/docs/src/rules/function-paren-newline.md index ad44aaec365..116737118e9 100644 --- a/docs/src/rules/function-paren-newline.md +++ b/docs/src/rules/function-paren-newline.md @@ -3,7 +3,7 @@ title: function-paren-newline rule_type: layout --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). Many style guides require or disallow newlines inside of function parentheses. diff --git a/docs/src/rules/generator-star-spacing.md b/docs/src/rules/generator-star-spacing.md index 3ef58d86da6..a8b3c6c9b17 100644 --- a/docs/src/rules/generator-star-spacing.md +++ b/docs/src/rules/generator-star-spacing.md @@ -5,7 +5,7 @@ further_reading: - https://leanpub.com/understandinges6/read/#leanpub-auto-generators --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). Generators are a new type of function in ECMAScript 6 that can return multiple values over time. These special functions are indicated by placing an `*` after the `function` keyword. diff --git a/docs/src/rules/implicit-arrow-linebreak.md b/docs/src/rules/implicit-arrow-linebreak.md index 09aaba18e03..25f5bc97d76 100644 --- a/docs/src/rules/implicit-arrow-linebreak.md +++ b/docs/src/rules/implicit-arrow-linebreak.md @@ -5,7 +5,7 @@ related_rules: - brace-style --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). An arrow function body can contain an implicit return as an expression instead of a block body. It can be useful to enforce a consistent location for the implicitly returned expression. diff --git a/docs/src/rules/indent.md b/docs/src/rules/indent.md index ea700b240bb..6cd25b73aec 100644 --- a/docs/src/rules/indent.md +++ b/docs/src/rules/indent.md @@ -3,7 +3,7 @@ title: indent rule_type: layout --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). There are several common guidelines which require specific indentation of nested blocks and statements, like: diff --git a/docs/src/rules/jsx-quotes.md b/docs/src/rules/jsx-quotes.md index 4e079968755..b26450a9bc4 100644 --- a/docs/src/rules/jsx-quotes.md +++ b/docs/src/rules/jsx-quotes.md @@ -5,7 +5,7 @@ related_rules: - quotes --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). JSX attribute values can contain string literals, which are delimited with single or double quotes. diff --git a/docs/src/rules/key-spacing.md b/docs/src/rules/key-spacing.md index d6e500053cf..234b0de1b21 100644 --- a/docs/src/rules/key-spacing.md +++ b/docs/src/rules/key-spacing.md @@ -3,7 +3,7 @@ title: key-spacing rule_type: layout --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). This rule enforces spacing around the colon in object literal properties. It can verify each property individually, or it can ensure horizontal alignment of adjacent properties in an object literal. diff --git a/docs/src/rules/keyword-spacing.md b/docs/src/rules/keyword-spacing.md index 0ffe1e13df6..7510378dea0 100644 --- a/docs/src/rules/keyword-spacing.md +++ b/docs/src/rules/keyword-spacing.md @@ -3,7 +3,7 @@ title: keyword-spacing rule_type: layout --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). Keywords are syntax elements of JavaScript, such as `try` and `if`. These keywords have special meaning to the language and so often appear in a different color in code editors. diff --git a/docs/src/rules/linebreak-style.md b/docs/src/rules/linebreak-style.md index 71158115f34..c4a764c9deb 100644 --- a/docs/src/rules/linebreak-style.md +++ b/docs/src/rules/linebreak-style.md @@ -3,7 +3,7 @@ title: linebreak-style rule_type: layout --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). When developing with a lot of people all having different editors, VCS applications and operating systems it may occur that different line endings are written by either of the mentioned (might especially happen when using the windows and mac versions of SourceTree together). diff --git a/docs/src/rules/lines-around-comment.md b/docs/src/rules/lines-around-comment.md index 0cafa6df703..56ea775ef44 100644 --- a/docs/src/rules/lines-around-comment.md +++ b/docs/src/rules/lines-around-comment.md @@ -6,7 +6,7 @@ related_rules: - spaced-comment --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). Many style guides require empty lines before or after comments. The primary goal of these rules is to make the comments easier to read and improve readability of the code. diff --git a/docs/src/rules/lines-between-class-members.md b/docs/src/rules/lines-between-class-members.md index 42c20b92ddd..9c9d7e0cbad 100644 --- a/docs/src/rules/lines-between-class-members.md +++ b/docs/src/rules/lines-between-class-members.md @@ -6,7 +6,7 @@ related_rules: - padding-line-between-statements --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). This rule improves readability by enforcing lines between class members. It will not check empty lines before the first member and after the last member, since that is already taken care of by padded-blocks. diff --git a/docs/src/rules/max-len.md b/docs/src/rules/max-len.md index fb3310269e3..7f7a0d006c0 100644 --- a/docs/src/rules/max-len.md +++ b/docs/src/rules/max-len.md @@ -9,6 +9,7 @@ related_rules: - max-statements --- +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). Very long lines of code in any language can be difficult to read. In order to aid in readability and maintainability many coders have developed a convention to limit lines of code to X number of characters (traditionally 80 characters). diff --git a/docs/src/rules/max-statements-per-line.md b/docs/src/rules/max-statements-per-line.md index d42d2ef55c1..1a579add6fb 100644 --- a/docs/src/rules/max-statements-per-line.md +++ b/docs/src/rules/max-statements-per-line.md @@ -11,6 +11,7 @@ related_rules: - max-statements --- +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). A line of code containing too many statements can be difficult to read. Code is generally read from the top down, especially when scanning, so limiting the number of statements allowed on a single line can be very beneficial for readability and maintainability. diff --git a/docs/src/rules/multiline-ternary.md b/docs/src/rules/multiline-ternary.md index f828bc1cd40..12ed8e176b5 100644 --- a/docs/src/rules/multiline-ternary.md +++ b/docs/src/rules/multiline-ternary.md @@ -5,7 +5,7 @@ related_rules: - operator-linebreak --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). JavaScript allows operands of ternary expressions to be separated by newlines, which can improve the readability of your program. diff --git a/docs/src/rules/new-parens.md b/docs/src/rules/new-parens.md index 08292e8a978..0f652c2eb34 100644 --- a/docs/src/rules/new-parens.md +++ b/docs/src/rules/new-parens.md @@ -3,7 +3,7 @@ title: new-parens rule_type: layout --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). JavaScript allows the omission of parentheses when invoking a function via the `new` keyword and the constructor has no arguments. However, some coders believe that omitting the parentheses is inconsistent with the rest of the language and thus makes code less clear. diff --git a/docs/src/rules/newline-per-chained-call.md b/docs/src/rules/newline-per-chained-call.md index e2482cdbc20..34eddb31338 100644 --- a/docs/src/rules/newline-per-chained-call.md +++ b/docs/src/rules/newline-per-chained-call.md @@ -3,7 +3,7 @@ title: newline-per-chained-call rule_type: layout --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). Chained method calls on a single line without line breaks are harder to read, so some developers place a newline character after each method call in the chain to make it more readable and easy to maintain. diff --git a/docs/src/rules/no-confusing-arrow.md b/docs/src/rules/no-confusing-arrow.md index 546e30321a8..b51140aa75f 100644 --- a/docs/src/rules/no-confusing-arrow.md +++ b/docs/src/rules/no-confusing-arrow.md @@ -6,7 +6,7 @@ related_rules: - arrow-parens --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). Arrow functions (`=>`) are similar in syntax to some comparison operators (`>`, `<`, `<=`, and `>=`). This rule warns against using the arrow function syntax in places where it could be confused with a comparison operator. diff --git a/docs/src/rules/no-extra-parens.md b/docs/src/rules/no-extra-parens.md index 5fcbcc63926..ab5655b2b0a 100644 --- a/docs/src/rules/no-extra-parens.md +++ b/docs/src/rules/no-extra-parens.md @@ -9,7 +9,7 @@ further_reading: - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). This rule restricts the use of parentheses to only where they are necessary. diff --git a/docs/src/rules/no-extra-semi.md b/docs/src/rules/no-extra-semi.md index 683c76cc5f0..1e9ee0a611f 100644 --- a/docs/src/rules/no-extra-semi.md +++ b/docs/src/rules/no-extra-semi.md @@ -6,9 +6,7 @@ related_rules: - semi-spacing --- - - - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). Typing mistakes and misunderstandings about where semicolons are required can lead to semicolons that are unnecessary. While not technically an error, extra semicolons can cause confusion when reading code. diff --git a/docs/src/rules/no-floating-decimal.md b/docs/src/rules/no-floating-decimal.md index 30a43317d55..8ba7a799150 100644 --- a/docs/src/rules/no-floating-decimal.md +++ b/docs/src/rules/no-floating-decimal.md @@ -3,7 +3,7 @@ title: no-floating-decimal rule_type: suggestion --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). Float values in JavaScript contain a decimal point, and there is no requirement that the decimal point be preceded or followed by a number. For example, the following are all valid JavaScript numbers: diff --git a/docs/src/rules/no-mixed-operators.md b/docs/src/rules/no-mixed-operators.md index 07ab40f7fe5..d8bb908540b 100644 --- a/docs/src/rules/no-mixed-operators.md +++ b/docs/src/rules/no-mixed-operators.md @@ -5,6 +5,7 @@ related_rules: - no-extra-parens --- +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). Enclosing complex expressions by parentheses clarifies the developer's intention, which makes the code more readable. This rule warns when different operators are used consecutively without parentheses in an expression. diff --git a/docs/src/rules/no-mixed-spaces-and-tabs.md b/docs/src/rules/no-mixed-spaces-and-tabs.md index 39c230b2dca..b13223cf585 100644 --- a/docs/src/rules/no-mixed-spaces-and-tabs.md +++ b/docs/src/rules/no-mixed-spaces-and-tabs.md @@ -5,7 +5,7 @@ further_reading: - https://www.emacswiki.org/emacs/SmartTabs --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). Most code conventions require either tabs or spaces be used for indentation. As such, it's usually an error if a single line of code is indented with both tabs and spaces. diff --git a/docs/src/rules/no-multi-spaces.md b/docs/src/rules/no-multi-spaces.md index b23a97964fe..ca7e873ab0b 100644 --- a/docs/src/rules/no-multi-spaces.md +++ b/docs/src/rules/no-multi-spaces.md @@ -11,7 +11,7 @@ related_rules: - space-return-throw-case --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). Multiple spaces in a row that are not used for indentation are typically mistakes. For example: diff --git a/docs/src/rules/no-multiple-empty-lines.md b/docs/src/rules/no-multiple-empty-lines.md index e3d7327c2e4..f6ccb3050e5 100644 --- a/docs/src/rules/no-multiple-empty-lines.md +++ b/docs/src/rules/no-multiple-empty-lines.md @@ -3,7 +3,7 @@ title: no-multiple-empty-lines rule_type: layout --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). Some developers prefer to have multiple blank lines removed, while others feel that it helps improve readability. Whitespace is useful for separating logical sections of code, but excess whitespace takes up more of the screen. diff --git a/docs/src/rules/no-tabs.md b/docs/src/rules/no-tabs.md index c105b6a8193..fe999fa3c78 100644 --- a/docs/src/rules/no-tabs.md +++ b/docs/src/rules/no-tabs.md @@ -3,6 +3,7 @@ title: no-tabs rule_type: layout --- +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). Some style guides don't allow the use of tab characters at all, including within comments. diff --git a/docs/src/rules/no-trailing-spaces.md b/docs/src/rules/no-trailing-spaces.md index 61aec1fcf4a..71c50e41f44 100644 --- a/docs/src/rules/no-trailing-spaces.md +++ b/docs/src/rules/no-trailing-spaces.md @@ -3,7 +3,7 @@ title: no-trailing-spaces rule_type: layout --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). Sometimes in the course of editing files, you can end up with extra whitespace at the end of lines. These whitespace differences can be picked up by source control systems and flagged as diffs, causing frustration for developers. While this extra whitespace causes no functional issues, many code conventions require that trailing spaces be removed before check-in. diff --git a/docs/src/rules/no-whitespace-before-property.md b/docs/src/rules/no-whitespace-before-property.md index db79ca2a897..a00864d491c 100644 --- a/docs/src/rules/no-whitespace-before-property.md +++ b/docs/src/rules/no-whitespace-before-property.md @@ -3,7 +3,7 @@ title: no-whitespace-before-property rule_type: layout --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). JavaScript allows whitespace between objects and their properties. However, inconsistent spacing can make code harder to read and can lead to errors. diff --git a/docs/src/rules/nonblock-statement-body-position.md b/docs/src/rules/nonblock-statement-body-position.md index 78d332026e7..1a2aae9122f 100644 --- a/docs/src/rules/nonblock-statement-body-position.md +++ b/docs/src/rules/nonblock-statement-body-position.md @@ -5,7 +5,7 @@ further_reading: - https://jscs-dev.github.io/rule/requireNewlineBeforeSingleStatementsInIf --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). When writing `if`, `else`, `while`, `do-while`, and `for` statements, the body can be a single statement instead of a block. It can be useful to enforce a consistent location for these single statements. diff --git a/docs/src/rules/object-curly-newline.md b/docs/src/rules/object-curly-newline.md index 4a4f2e14f61..d33dd6433e8 100644 --- a/docs/src/rules/object-curly-newline.md +++ b/docs/src/rules/object-curly-newline.md @@ -8,7 +8,7 @@ related_rules: - object-property-newline --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). A number of style guides require or disallow line breaks inside of object braces and other tokens. diff --git a/docs/src/rules/object-curly-spacing.md b/docs/src/rules/object-curly-spacing.md index 4027c9ab755..0484c436a4b 100644 --- a/docs/src/rules/object-curly-spacing.md +++ b/docs/src/rules/object-curly-spacing.md @@ -8,7 +8,7 @@ related_rules: - space-in-parens --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). While formatting preferences are very personal, a number of style guides require or disallow spaces between curly braces in the following situations: diff --git a/docs/src/rules/object-property-newline.md b/docs/src/rules/object-property-newline.md index 50214bdb7c0..e2bb161ea58 100644 --- a/docs/src/rules/object-property-newline.md +++ b/docs/src/rules/object-property-newline.md @@ -8,7 +8,7 @@ related_rules: - object-curly-spacing --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). This rule permits you to restrict the locations of property specifications in object literals. You may prohibit any part of any property specification from appearing on the same line as any part of any other property specification. You may make this prohibition absolute, or, by invoking an object option, you may allow an exception, permitting an object literal to have all parts of all of its property specifications on a single line. diff --git a/docs/src/rules/one-var-declaration-per-line.md b/docs/src/rules/one-var-declaration-per-line.md index 659ef73343d..742f52352fb 100644 --- a/docs/src/rules/one-var-declaration-per-line.md +++ b/docs/src/rules/one-var-declaration-per-line.md @@ -5,7 +5,7 @@ related_rules: - one-var --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). Some developers declare multiple var statements on the same line: diff --git a/docs/src/rules/operator-linebreak.md b/docs/src/rules/operator-linebreak.md index f3cab6e4f03..0724797f3ee 100644 --- a/docs/src/rules/operator-linebreak.md +++ b/docs/src/rules/operator-linebreak.md @@ -5,7 +5,7 @@ related_rules: - comma-style --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). When a statement is too long to fit on a single line, line breaks are generally inserted next to the operators separating expressions. The first style coming to mind would be to place the operator at the end of the line, following the English punctuation rules. diff --git a/docs/src/rules/padded-blocks.md b/docs/src/rules/padded-blocks.md index fd57f2a2905..7d1a32042af 100644 --- a/docs/src/rules/padded-blocks.md +++ b/docs/src/rules/padded-blocks.md @@ -6,7 +6,7 @@ related_rules: - padding-line-between-statements --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). Some style guides require block statements to start and end with blank lines. The goal is to improve readability by visually separating the block content and the surrounding code. diff --git a/docs/src/rules/padding-line-between-statements.md b/docs/src/rules/padding-line-between-statements.md index 710a6116d63..af57ed48990 100644 --- a/docs/src/rules/padding-line-between-statements.md +++ b/docs/src/rules/padding-line-between-statements.md @@ -3,7 +3,7 @@ title: padding-line-between-statements rule_type: layout --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). This rule requires or disallows blank lines between the given 2 kinds of statements. Properly blank lines help developers to understand the code. diff --git a/docs/src/rules/quote-props.md b/docs/src/rules/quote-props.md index b994b82507e..2e204dd0cb6 100644 --- a/docs/src/rules/quote-props.md +++ b/docs/src/rules/quote-props.md @@ -6,7 +6,7 @@ further_reading: - https://mathiasbynens.be/notes/javascript-properties --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). Object literal property names can be defined in two ways: using literals or using strings. For example, these two objects are equivalent: diff --git a/docs/src/rules/quotes.md b/docs/src/rules/quotes.md index 1b876ebdd3e..ea935d610a1 100644 --- a/docs/src/rules/quotes.md +++ b/docs/src/rules/quotes.md @@ -3,7 +3,7 @@ title: quotes rule_type: layout --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). JavaScript allows you to define strings in one of three ways: double quotes, single quotes, and backticks (as of ECMAScript 6). For example: diff --git a/docs/src/rules/rest-spread-spacing.md b/docs/src/rules/rest-spread-spacing.md index f51ef54be35..8a52856cad9 100644 --- a/docs/src/rules/rest-spread-spacing.md +++ b/docs/src/rules/rest-spread-spacing.md @@ -5,7 +5,7 @@ further_reading: - https://github.com/tc39/proposal-object-rest-spread --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). ES2015 introduced the rest and spread operators, which expand an iterable structure into its individual parts. Some examples of their usage are as follows: diff --git a/docs/src/rules/semi-spacing.md b/docs/src/rules/semi-spacing.md index 4ed43ac570e..5a27040f9b5 100644 --- a/docs/src/rules/semi-spacing.md +++ b/docs/src/rules/semi-spacing.md @@ -9,7 +9,7 @@ related_rules: - space-in-parens --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). JavaScript allows you to place unnecessary spaces before or after a semicolon. diff --git a/docs/src/rules/semi-style.md b/docs/src/rules/semi-style.md index 66db3af0f75..2979c188564 100644 --- a/docs/src/rules/semi-style.md +++ b/docs/src/rules/semi-style.md @@ -7,7 +7,7 @@ related_rules: - semi-spacing --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). Generally, semicolons are at the end of lines. However, in semicolon-less style, semicolons are at the beginning of lines. This rule enforces that semicolons are at the configured location. diff --git a/docs/src/rules/semi.md b/docs/src/rules/semi.md index 6fd05501cd1..e118b4518f8 100644 --- a/docs/src/rules/semi.md +++ b/docs/src/rules/semi.md @@ -10,7 +10,7 @@ further_reading: - https://web.archive.org/web/20200420230322/http://inimino.org/~inimino/blog/javascript_semicolons --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). JavaScript doesn't require semicolons at the end of each statement. In many cases, the JavaScript engine can determine that a semicolon should be in a certain spot and will automatically add it. This feature is known as **automatic semicolon insertion (ASI)** and is considered one of the more controversial features of JavaScript. For example, the following lines are both valid: diff --git a/docs/src/rules/space-before-blocks.md b/docs/src/rules/space-before-blocks.md index a7bcad2c70a..42f02f99ebf 100644 --- a/docs/src/rules/space-before-blocks.md +++ b/docs/src/rules/space-before-blocks.md @@ -9,7 +9,7 @@ related_rules: - brace-style --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). Consistency is an important part of any style guide. While it is a personal preference where to put the opening brace of blocks, diff --git a/docs/src/rules/space-before-function-paren.md b/docs/src/rules/space-before-function-paren.md index a132105ac41..8b439dac5f1 100644 --- a/docs/src/rules/space-before-function-paren.md +++ b/docs/src/rules/space-before-function-paren.md @@ -5,7 +5,7 @@ related_rules: - keyword-spacing --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). When formatting a function, whitespace is allowed between the function name or `function` keyword and the opening paren. Named functions also require a space between the `function` keyword and the function name, but anonymous functions require no whitespace. For example: diff --git a/docs/src/rules/space-in-parens.md b/docs/src/rules/space-in-parens.md index 1d6ca52bdf1..9f92cdc524a 100644 --- a/docs/src/rules/space-in-parens.md +++ b/docs/src/rules/space-in-parens.md @@ -7,7 +7,7 @@ related_rules: - computed-property-spacing --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). Some style guides require or disallow spaces inside of parentheses: diff --git a/docs/src/rules/space-infix-ops.md b/docs/src/rules/space-infix-ops.md index b278a7c1d78..8a8c0c3dff7 100644 --- a/docs/src/rules/space-infix-ops.md +++ b/docs/src/rules/space-infix-ops.md @@ -3,7 +3,7 @@ title: space-infix-ops rule_type: layout --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). While formatting preferences are very personal, a number of style guides require spaces around operators, such as: diff --git a/docs/src/rules/space-unary-ops.md b/docs/src/rules/space-unary-ops.md index a33735b5565..4e7f79bfce9 100644 --- a/docs/src/rules/space-unary-ops.md +++ b/docs/src/rules/space-unary-ops.md @@ -3,7 +3,7 @@ title: space-unary-ops rule_type: layout --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). Some style guides require or disallow spaces before or after unary operators. This is mainly a stylistic issue, however, some JavaScript expressions can be written without spacing which makes it harder to read and maintain. diff --git a/docs/src/rules/spaced-comment.md b/docs/src/rules/spaced-comment.md index f15e16c72e8..3094c3cebed 100644 --- a/docs/src/rules/spaced-comment.md +++ b/docs/src/rules/spaced-comment.md @@ -5,7 +5,7 @@ related_rules: - spaced-line-comment --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). Some style guides require or disallow a whitespace immediately after the initial `//` or `/*` of a comment. Whitespace after the `//` or `/*` makes it easier to read text in comments. diff --git a/docs/src/rules/switch-colon-spacing.md b/docs/src/rules/switch-colon-spacing.md index 63df48f23e1..7672c6275b7 100644 --- a/docs/src/rules/switch-colon-spacing.md +++ b/docs/src/rules/switch-colon-spacing.md @@ -3,7 +3,7 @@ title: switch-colon-spacing rule_type: layout --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). Spacing around colons improves readability of `case`/`default` clauses. diff --git a/docs/src/rules/template-curly-spacing.md b/docs/src/rules/template-curly-spacing.md index b96a30c870d..7a095cc38d8 100644 --- a/docs/src/rules/template-curly-spacing.md +++ b/docs/src/rules/template-curly-spacing.md @@ -3,7 +3,7 @@ title: template-curly-spacing rule_type: layout --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). We can embed expressions in template strings with using a pair of `${` and `}`. diff --git a/docs/src/rules/template-tag-spacing.md b/docs/src/rules/template-tag-spacing.md index da0cfa8884b..2adf4c76205 100644 --- a/docs/src/rules/template-tag-spacing.md +++ b/docs/src/rules/template-tag-spacing.md @@ -6,7 +6,7 @@ further_reading: - https://exploringjs.com/es6/ch_template-literals.html#_examples-of-using-tagged-template-literals --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). With ES6, it's possible to create functions called [tagged template literals](#further-reading) where the function parameters consist of a template literal's strings and expressions. diff --git a/docs/src/rules/wrap-iife.md b/docs/src/rules/wrap-iife.md index af8ec85c785..dd0048a8bb7 100644 --- a/docs/src/rules/wrap-iife.md +++ b/docs/src/rules/wrap-iife.md @@ -3,7 +3,7 @@ title: wrap-iife rule_type: layout --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). You can immediately invoke function expressions, but not function declarations. A common technique to create an immediately-invoked function expression (IIFE) is to wrap a function declaration in parentheses. The opening parentheses causes the contained function to be parsed as an expression, rather than a declaration. diff --git a/docs/src/rules/wrap-regex.md b/docs/src/rules/wrap-regex.md index d4cff7df988..0a5daf0e1a0 100644 --- a/docs/src/rules/wrap-regex.md +++ b/docs/src/rules/wrap-regex.md @@ -3,7 +3,7 @@ title: wrap-regex rule_type: layout --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). When a regular expression is used in certain situations, it can end up looking like a division operator. For example: diff --git a/docs/src/rules/yield-star-spacing.md b/docs/src/rules/yield-star-spacing.md index c5e47380926..aeeb0c73b2d 100644 --- a/docs/src/rules/yield-star-spacing.md +++ b/docs/src/rules/yield-star-spacing.md @@ -5,7 +5,7 @@ further_reading: - https://leanpub.com/understandinges6/read/#leanpub-auto-generators --- - +This rule was **deprecated** in ESLint v8.53.0. Please use the corresponding rule in [`@stylistic/eslint-plugin-js`](https://eslint.style/packages/js). ## Rule Details diff --git a/lib/rules/array-bracket-newline.js b/lib/rules/array-bracket-newline.js index c3676bf4dfa..12ef5b612d6 100644 --- a/lib/rules/array-bracket-newline.js +++ b/lib/rules/array-bracket-newline.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to enforce linebreaks after open and before close array brackets * @author Jan Peer Stöcklmair + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -14,6 +15,8 @@ const astUtils = require("./utils/ast-utils"); /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/array-bracket-spacing.js b/lib/rules/array-bracket-spacing.js index e3a46d82214..9dd3ffd902c 100644 --- a/lib/rules/array-bracket-spacing.js +++ b/lib/rules/array-bracket-spacing.js @@ -1,6 +1,7 @@ /** * @fileoverview Disallows or enforces spaces inside of array brackets. * @author Jamund Ferguson + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -13,6 +14,8 @@ const astUtils = require("./utils/ast-utils"); /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/array-element-newline.js b/lib/rules/array-element-newline.js index 0c806ef3a82..504fe04a0b8 100644 --- a/lib/rules/array-element-newline.js +++ b/lib/rules/array-element-newline.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to enforce line breaks after each array element * @author Jan Peer Stöcklmair + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -14,6 +15,8 @@ const astUtils = require("./utils/ast-utils"); /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/arrow-parens.js b/lib/rules/arrow-parens.js index 0463323176e..2206d8ce2bf 100644 --- a/lib/rules/arrow-parens.js +++ b/lib/rules/arrow-parens.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to require parens in arrow function arguments. * @author Jxck + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -30,6 +31,8 @@ function hasBlockBody(node) { /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/arrow-spacing.js b/lib/rules/arrow-spacing.js index fb74d2cb272..2b7d464ffcf 100644 --- a/lib/rules/arrow-spacing.js +++ b/lib/rules/arrow-spacing.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to define spacing before/after arrow function's arrow. * @author Jxck + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -17,6 +18,8 @@ const astUtils = require("./utils/ast-utils"); /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/block-spacing.js b/lib/rules/block-spacing.js index dd4851c6843..9ca461158d9 100644 --- a/lib/rules/block-spacing.js +++ b/lib/rules/block-spacing.js @@ -1,6 +1,7 @@ /** * @fileoverview A rule to disallow or enforce spaces inside of single line blocks. * @author Toru Nagashima + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -14,6 +15,8 @@ const util = require("./utils/ast-utils"); /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/brace-style.js b/lib/rules/brace-style.js index 59758c90925..0fb4c65e68d 100644 --- a/lib/rules/brace-style.js +++ b/lib/rules/brace-style.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to flag block statements that do not use the one true brace style * @author Ian Christian Myers + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -14,6 +15,8 @@ const astUtils = require("./utils/ast-utils"); /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/comma-dangle.js b/lib/rules/comma-dangle.js index e49983b722e..5f4180f12c5 100644 --- a/lib/rules/comma-dangle.js +++ b/lib/rules/comma-dangle.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to forbid or enforce dangling commas. * @author Ian Christian Myers + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -73,6 +74,8 @@ function normalizeOptions(optionValue, ecmaVersion) { /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/comma-spacing.js b/lib/rules/comma-spacing.js index 96015ef6779..e266de4a9c3 100644 --- a/lib/rules/comma-spacing.js +++ b/lib/rules/comma-spacing.js @@ -1,6 +1,7 @@ /** * @fileoverview Comma spacing - validates spacing before and after comma * @author Vignesh Anand aka vegetableman. + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -13,6 +14,8 @@ const astUtils = require("./utils/ast-utils"); /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/comma-style.js b/lib/rules/comma-style.js index bc69de4698d..0b51219531d 100644 --- a/lib/rules/comma-style.js +++ b/lib/rules/comma-style.js @@ -1,6 +1,7 @@ /** * @fileoverview Comma style - enforces comma styles of two types: last and first * @author Vignesh Anand aka vegetableman + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -14,6 +15,8 @@ const astUtils = require("./utils/ast-utils"); /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/computed-property-spacing.js b/lib/rules/computed-property-spacing.js index 1e4e17c6c71..2852877fddf 100644 --- a/lib/rules/computed-property-spacing.js +++ b/lib/rules/computed-property-spacing.js @@ -1,6 +1,7 @@ /** * @fileoverview Disallows or enforces spaces inside computed properties. * @author Jamund Ferguson + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -13,6 +14,8 @@ const astUtils = require("./utils/ast-utils"); /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/dot-location.js b/lib/rules/dot-location.js index dac98b06b9e..0d017c16232 100644 --- a/lib/rules/dot-location.js +++ b/lib/rules/dot-location.js @@ -1,6 +1,7 @@ /** * @fileoverview Validates newlines before and after dots * @author Greg Cochard + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -14,6 +15,8 @@ const astUtils = require("./utils/ast-utils"); /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/eol-last.js b/lib/rules/eol-last.js index 1036db1a108..03487b039f3 100644 --- a/lib/rules/eol-last.js +++ b/lib/rules/eol-last.js @@ -1,6 +1,7 @@ /** * @fileoverview Require or disallow newline at the end of files * @author Nodeca Team + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -11,6 +12,8 @@ /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/func-call-spacing.js b/lib/rules/func-call-spacing.js index 3d5e538493e..33f73727b43 100644 --- a/lib/rules/func-call-spacing.js +++ b/lib/rules/func-call-spacing.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to control spacing within function calls * @author Matt DuVall + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -18,6 +19,8 @@ const astUtils = require("./utils/ast-utils"); /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/function-call-argument-newline.js b/lib/rules/function-call-argument-newline.js index 4462afd0b7c..458399d62cd 100644 --- a/lib/rules/function-call-argument-newline.js +++ b/lib/rules/function-call-argument-newline.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to enforce line breaks between arguments of a function call * @author Alexey Gonchar + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -12,6 +13,8 @@ /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/function-paren-newline.js b/lib/rules/function-paren-newline.js index 8a8714ac95d..de315a0204b 100644 --- a/lib/rules/function-paren-newline.js +++ b/lib/rules/function-paren-newline.js @@ -1,6 +1,7 @@ /** * @fileoverview enforce consistent line breaks inside function parentheses * @author Teddy Katz + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -17,6 +18,8 @@ const astUtils = require("./utils/ast-utils"); /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/generator-star-spacing.js b/lib/rules/generator-star-spacing.js index 81c0b61059a..c633f979f84 100644 --- a/lib/rules/generator-star-spacing.js +++ b/lib/rules/generator-star-spacing.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to check the spacing around the * in generator functions. * @author Jamund Ferguson + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -28,6 +29,8 @@ const OVERRIDE_SCHEMA = { /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/implicit-arrow-linebreak.js b/lib/rules/implicit-arrow-linebreak.js index 30ab1a5f3d0..32f422ce828 100644 --- a/lib/rules/implicit-arrow-linebreak.js +++ b/lib/rules/implicit-arrow-linebreak.js @@ -1,6 +1,7 @@ /** * @fileoverview enforce the location of arrow function bodies * @author Sharmila Jesupaul + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -12,6 +13,8 @@ const { isCommentToken, isNotOpeningParenToken } = require("./utils/ast-utils"); /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/indent.js b/lib/rules/indent.js index 7ea4b3f86c3..9bcbd640c4d 100644 --- a/lib/rules/indent.js +++ b/lib/rules/indent.js @@ -4,6 +4,7 @@ * @author Teddy Katz * @author Vitaly Puzrin * @author Gyandeep Singh + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -493,6 +494,8 @@ const ELEMENT_LIST_SCHEMA = { /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/jsx-quotes.js b/lib/rules/jsx-quotes.js index a41c85170fd..3dcd5fa9d22 100644 --- a/lib/rules/jsx-quotes.js +++ b/lib/rules/jsx-quotes.js @@ -1,6 +1,7 @@ /** * @fileoverview A rule to ensure consistent quotes used in jsx syntax. * @author Mathias Schreck + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -39,6 +40,8 @@ const QUOTE_SETTINGS = { /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/key-spacing.js b/lib/rules/key-spacing.js index 0b51eb3fe13..19fc0167ae0 100644 --- a/lib/rules/key-spacing.js +++ b/lib/rules/key-spacing.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to specify spacing of object literal keys and values * @author Brandon Mills + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -133,6 +134,8 @@ function initOptions(toOptions, fromOptions) { /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/keyword-spacing.js b/lib/rules/keyword-spacing.js index 8ed82199810..9d18441e0e5 100644 --- a/lib/rules/keyword-spacing.js +++ b/lib/rules/keyword-spacing.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to enforce spacing before and after keywords. * @author Toru Nagashima + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -64,6 +65,8 @@ function isCloseParenOfTemplate(token) { /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/linebreak-style.js b/lib/rules/linebreak-style.js index d8f36094b2e..e59acca1b5c 100644 --- a/lib/rules/linebreak-style.js +++ b/lib/rules/linebreak-style.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to enforce a single linebreak style. * @author Erik Mueller + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -18,6 +19,8 @@ const astUtils = require("./utils/ast-utils"); /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/lines-around-comment.js b/lib/rules/lines-around-comment.js index 10aeba3cbc1..2a6e472f9a0 100644 --- a/lib/rules/lines-around-comment.js +++ b/lib/rules/lines-around-comment.js @@ -1,6 +1,7 @@ /** * @fileoverview Enforces empty lines around comments. * @author Jamund Ferguson + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -52,6 +53,8 @@ function getCommentLineNums(comments) { /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/lines-between-class-members.js b/lib/rules/lines-between-class-members.js index 3d0a5e6738e..5f36d468dc0 100644 --- a/lib/rules/lines-between-class-members.js +++ b/lib/rules/lines-between-class-members.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to check empty newline between class members * @author 薛定谔的猫 + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -32,6 +33,8 @@ const ClassMemberTypes = { /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/max-len.js b/lib/rules/max-len.js index 53ad5310799..138a0f239fd 100644 --- a/lib/rules/max-len.js +++ b/lib/rules/max-len.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to check for max length on a line. * @author Matt DuVall + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -66,6 +67,8 @@ const OPTIONS_OR_INTEGER_SCHEMA = { /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/max-statements-per-line.js b/lib/rules/max-statements-per-line.js index b9665048764..4ad73a67f98 100644 --- a/lib/rules/max-statements-per-line.js +++ b/lib/rules/max-statements-per-line.js @@ -1,6 +1,7 @@ /** * @fileoverview Specify the maximum number of statements allowed per line. * @author Kenneth Williams + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -17,6 +18,8 @@ const astUtils = require("./utils/ast-utils"); /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/multiline-ternary.js b/lib/rules/multiline-ternary.js index f156fe32bb1..8155dd7a5a6 100644 --- a/lib/rules/multiline-ternary.js +++ b/lib/rules/multiline-ternary.js @@ -1,6 +1,7 @@ /** * @fileoverview Enforce newlines between operands of ternary expressions * @author Kai Cataldo + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -14,6 +15,8 @@ const astUtils = require("./utils/ast-utils"); /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/new-parens.js b/lib/rules/new-parens.js index e8667310f29..1c5d21d4a0c 100644 --- a/lib/rules/new-parens.js +++ b/lib/rules/new-parens.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to flag when using constructor without parentheses * @author Ilya Volodin + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -22,6 +23,8 @@ const astUtils = require("./utils/ast-utils"); /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/newline-per-chained-call.js b/lib/rules/newline-per-chained-call.js index b2e6cd9e49d..3124ac2d19f 100644 --- a/lib/rules/newline-per-chained-call.js +++ b/lib/rules/newline-per-chained-call.js @@ -2,6 +2,7 @@ * @fileoverview Rule to ensure newline per method call when chaining calls * @author Rajendra Patil * @author Burak Yigit Kaya + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -15,6 +16,8 @@ const astUtils = require("./utils/ast-utils"); /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/no-confusing-arrow.js b/lib/rules/no-confusing-arrow.js index de6e2f30c2e..6fef1870eb2 100644 --- a/lib/rules/no-confusing-arrow.js +++ b/lib/rules/no-confusing-arrow.js @@ -2,6 +2,7 @@ * @fileoverview A rule to warn against using arrow functions when they could be * confused with comparisons * @author Jxck + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -28,6 +29,8 @@ function isConditional(node) { /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "suggestion", docs: { diff --git a/lib/rules/no-extra-parens.js b/lib/rules/no-extra-parens.js index bb80987858c..75c082baf2e 100644 --- a/lib/rules/no-extra-parens.js +++ b/lib/rules/no-extra-parens.js @@ -1,6 +1,7 @@ /** * @fileoverview Disallow parenthesising higher precedence subexpressions. * @author Michael Ficarra + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -14,6 +15,8 @@ const astUtils = require("./utils/ast-utils.js"); /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/no-extra-semi.js b/lib/rules/no-extra-semi.js index 3473df10dbf..af7eb888845 100644 --- a/lib/rules/no-extra-semi.js +++ b/lib/rules/no-extra-semi.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to flag use of unnecessary semicolons * @author Nicholas C. Zakas + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -19,6 +20,8 @@ const astUtils = require("./utils/ast-utils"); /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "suggestion", docs: { diff --git a/lib/rules/no-floating-decimal.js b/lib/rules/no-floating-decimal.js index c26876440a5..80e4994cd72 100644 --- a/lib/rules/no-floating-decimal.js +++ b/lib/rules/no-floating-decimal.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to flag use of a leading/trailing decimal point in a numeric literal * @author James Allardice + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -18,6 +19,8 @@ const astUtils = require("./utils/ast-utils"); /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "suggestion", docs: { diff --git a/lib/rules/no-mixed-operators.js b/lib/rules/no-mixed-operators.js index 724abe09466..6b6f7364a01 100644 --- a/lib/rules/no-mixed-operators.js +++ b/lib/rules/no-mixed-operators.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to disallow mixed binary operators. * @author Toru Nagashima + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -85,6 +86,8 @@ function getChildNode(node) { /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "suggestion", docs: { diff --git a/lib/rules/no-mixed-spaces-and-tabs.js b/lib/rules/no-mixed-spaces-and-tabs.js index a18e4f30d0a..7698b5da7fa 100644 --- a/lib/rules/no-mixed-spaces-and-tabs.js +++ b/lib/rules/no-mixed-spaces-and-tabs.js @@ -1,6 +1,7 @@ /** * @fileoverview Disallow mixed spaces and tabs for indentation * @author Jary Niebur + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -11,6 +12,8 @@ /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/no-multi-spaces.js b/lib/rules/no-multi-spaces.js index 62074e657ae..bc90ee5b5b0 100644 --- a/lib/rules/no-multi-spaces.js +++ b/lib/rules/no-multi-spaces.js @@ -1,6 +1,7 @@ /** * @fileoverview Disallow use of multiple spaces. * @author Nicholas C. Zakas + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -14,6 +15,8 @@ const astUtils = require("./utils/ast-utils"); /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/no-multiple-empty-lines.js b/lib/rules/no-multiple-empty-lines.js index 2c0fbf2c6ab..5d038ff05b2 100644 --- a/lib/rules/no-multiple-empty-lines.js +++ b/lib/rules/no-multiple-empty-lines.js @@ -2,6 +2,7 @@ * @fileoverview Disallows multiple blank lines. * implementation adapted from the no-trailing-spaces rule. * @author Greg Cochard + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -12,6 +13,8 @@ /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/no-tabs.js b/lib/rules/no-tabs.js index b33690c2441..8581e19af37 100644 --- a/lib/rules/no-tabs.js +++ b/lib/rules/no-tabs.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to check for tabs inside a file * @author Gyandeep Singh + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -19,6 +20,8 @@ const anyNonWhitespaceRegex = /\S/u; /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/no-trailing-spaces.js b/lib/rules/no-trailing-spaces.js index 1674de54207..eede46c8634 100644 --- a/lib/rules/no-trailing-spaces.js +++ b/lib/rules/no-trailing-spaces.js @@ -1,6 +1,7 @@ /** * @fileoverview Disallow trailing spaces at the end of lines. * @author Nodeca Team + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -17,6 +18,8 @@ const astUtils = require("./utils/ast-utils"); /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/no-whitespace-before-property.js b/lib/rules/no-whitespace-before-property.js index 1153314afe6..94a166e6ade 100644 --- a/lib/rules/no-whitespace-before-property.js +++ b/lib/rules/no-whitespace-before-property.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to disallow whitespace before properties * @author Kai Cataldo + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -17,6 +18,8 @@ const astUtils = require("./utils/ast-utils"); /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/nonblock-statement-body-position.js b/lib/rules/nonblock-statement-body-position.js index 1ea2770ceb2..811b32b0821 100644 --- a/lib/rules/nonblock-statement-body-position.js +++ b/lib/rules/nonblock-statement-body-position.js @@ -1,6 +1,7 @@ /** * @fileoverview enforce the location of single-line statements * @author Teddy Katz + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -13,6 +14,8 @@ const POSITION_SCHEMA = { enum: ["beside", "below", "any"] }; /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/object-curly-newline.js b/lib/rules/object-curly-newline.js index caf1982312a..176694b6a07 100644 --- a/lib/rules/object-curly-newline.js +++ b/lib/rules/object-curly-newline.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to require or disallow line breaks inside braces. * @author Toru Nagashima + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -147,6 +148,8 @@ function areLineBreaksRequired(node, options, first, last) { /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/object-curly-spacing.js b/lib/rules/object-curly-spacing.js index 41ca428fe24..4463bcd5af1 100644 --- a/lib/rules/object-curly-spacing.js +++ b/lib/rules/object-curly-spacing.js @@ -1,6 +1,7 @@ /** * @fileoverview Disallows or enforces spaces inside of object literals. * @author Jamund Ferguson + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -13,6 +14,8 @@ const astUtils = require("./utils/ast-utils"); /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/object-property-newline.js b/lib/rules/object-property-newline.js index deca9b555b1..6ffa06421f0 100644 --- a/lib/rules/object-property-newline.js +++ b/lib/rules/object-property-newline.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to enforce placing object properties on separate lines. * @author Vitor Balocco + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -12,6 +13,8 @@ /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/one-var-declaration-per-line.js b/lib/rules/one-var-declaration-per-line.js index b1e045b0dc5..340eac16932 100644 --- a/lib/rules/one-var-declaration-per-line.js +++ b/lib/rules/one-var-declaration-per-line.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to check multiple var declarations per line * @author Alberto Rodríguez + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -11,6 +12,8 @@ /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "suggestion", docs: { diff --git a/lib/rules/operator-linebreak.js b/lib/rules/operator-linebreak.js index 2b609f63576..3065e66be12 100644 --- a/lib/rules/operator-linebreak.js +++ b/lib/rules/operator-linebreak.js @@ -1,6 +1,7 @@ /** * @fileoverview Operator linebreak - enforces operator linebreak style of two types: after and before * @author Benoît Zugmeyer + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -18,6 +19,8 @@ const astUtils = require("./utils/ast-utils"); /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/padded-blocks.js b/lib/rules/padded-blocks.js index c6d1372ac75..ec4756ba739 100644 --- a/lib/rules/padded-blocks.js +++ b/lib/rules/padded-blocks.js @@ -1,6 +1,7 @@ /** * @fileoverview A rule to ensure blank lines within blocks. * @author Mathias Schreck + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -18,6 +19,8 @@ const astUtils = require("./utils/ast-utils"); /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/padding-line-between-statements.js b/lib/rules/padding-line-between-statements.js index 95e08736a9c..084651b6dff 100644 --- a/lib/rules/padding-line-between-statements.js +++ b/lib/rules/padding-line-between-statements.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to require or disallow newlines between statements * @author Toru Nagashima + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -383,6 +384,8 @@ const StatementTypes = { /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/quote-props.js b/lib/rules/quote-props.js index 8abab150c4e..fe26eed77de 100644 --- a/lib/rules/quote-props.js +++ b/lib/rules/quote-props.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to flag non-quoted property names in object literals. * @author Mathias Bynens + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -19,6 +20,8 @@ const keywords = require("./utils/keywords"); /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "suggestion", docs: { diff --git a/lib/rules/quotes.js b/lib/rules/quotes.js index 6eda7c0b40a..17d97dd697d 100644 --- a/lib/rules/quotes.js +++ b/lib/rules/quotes.js @@ -1,6 +1,7 @@ /** * @fileoverview A rule to choose between single and double quote marks * @author Matt DuVall , Brandon Payton + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -77,6 +78,8 @@ const AVOID_ESCAPE = "avoid-escape"; /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/rest-spread-spacing.js b/lib/rules/rest-spread-spacing.js index 7791238081e..287e56f014a 100644 --- a/lib/rules/rest-spread-spacing.js +++ b/lib/rules/rest-spread-spacing.js @@ -1,6 +1,7 @@ /** * @fileoverview Enforce spacing between rest and spread operators and their expressions. * @author Kai Cataldo + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -12,6 +13,8 @@ /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/semi-spacing.js b/lib/rules/semi-spacing.js index 770f62d41f1..35a49d2c22b 100644 --- a/lib/rules/semi-spacing.js +++ b/lib/rules/semi-spacing.js @@ -1,6 +1,7 @@ /** * @fileoverview Validates spacing before and after semicolon * @author Mathias Schreck + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -14,6 +15,8 @@ const astUtils = require("./utils/ast-utils"); /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/semi-style.js b/lib/rules/semi-style.js index 67ed1e478e7..caf2224df3d 100644 --- a/lib/rules/semi-style.js +++ b/lib/rules/semi-style.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to enforce location of semicolons. * @author Toru Nagashima + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -70,6 +71,8 @@ function isLastChild(node) { /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/semi.js b/lib/rules/semi.js index 6a473535d49..01586b8492d 100644 --- a/lib/rules/semi.js +++ b/lib/rules/semi.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to flag missing semicolons. * @author Nicholas C. Zakas + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -18,6 +19,8 @@ const astUtils = require("./utils/ast-utils"); /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/space-before-blocks.js b/lib/rules/space-before-blocks.js index a580a4f2249..a4a5449e17f 100644 --- a/lib/rules/space-before-blocks.js +++ b/lib/rules/space-before-blocks.js @@ -1,6 +1,7 @@ /** * @fileoverview A rule to ensure whitespace before blocks. * @author Mathias Schreck + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -37,6 +38,8 @@ function isFunctionBody(node) { /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/space-before-function-paren.js b/lib/rules/space-before-function-paren.js index c5faa8cf4dd..575a1597a74 100644 --- a/lib/rules/space-before-function-paren.js +++ b/lib/rules/space-before-function-paren.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to validate spacing before function paren. * @author Mathias Schreck + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -17,6 +18,8 @@ const astUtils = require("./utils/ast-utils"); /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/space-in-parens.js b/lib/rules/space-in-parens.js index c6c06d29a3f..d15a64317f4 100644 --- a/lib/rules/space-in-parens.js +++ b/lib/rules/space-in-parens.js @@ -1,6 +1,7 @@ /** * @fileoverview Disallows or enforces spaces inside of parentheses. * @author Jonathan Rajavuori + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -13,6 +14,8 @@ const astUtils = require("./utils/ast-utils"); /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/space-infix-ops.js b/lib/rules/space-infix-ops.js index 81a95f83bf2..40071019480 100644 --- a/lib/rules/space-infix-ops.js +++ b/lib/rules/space-infix-ops.js @@ -1,6 +1,7 @@ /** * @fileoverview Require spaces around infix operators * @author Michael Ficarra + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -13,6 +14,8 @@ const { isEqToken } = require("./utils/ast-utils"); /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/space-unary-ops.js b/lib/rules/space-unary-ops.js index 381381d6e5d..aed43e7249e 100644 --- a/lib/rules/space-unary-ops.js +++ b/lib/rules/space-unary-ops.js @@ -1,6 +1,7 @@ /** * @fileoverview This rule should require or disallow spaces before or after unary operations. * @author Marcin Kumorek + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -17,6 +18,8 @@ const astUtils = require("./utils/ast-utils"); /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/spaced-comment.js b/lib/rules/spaced-comment.js index 2eb7f0e3008..90ac7032d03 100644 --- a/lib/rules/spaced-comment.js +++ b/lib/rules/spaced-comment.js @@ -1,6 +1,7 @@ /** * @fileoverview Source code for spaced-comments rule * @author Gyandeep Singh + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -149,6 +150,8 @@ function createNeverStylePattern(markers) { /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "suggestion", docs: { diff --git a/lib/rules/switch-colon-spacing.js b/lib/rules/switch-colon-spacing.js index 45e401822a8..3ea63ca0eed 100644 --- a/lib/rules/switch-colon-spacing.js +++ b/lib/rules/switch-colon-spacing.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to enforce spacing around colons of switch statements. * @author Toru Nagashima + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -18,6 +19,8 @@ const astUtils = require("./utils/ast-utils"); /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/template-curly-spacing.js b/lib/rules/template-curly-spacing.js index cc9bbe306d5..1f8cc34c1d7 100644 --- a/lib/rules/template-curly-spacing.js +++ b/lib/rules/template-curly-spacing.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to enforce spacing around embedded expressions of template strings * @author Toru Nagashima + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -18,6 +19,8 @@ const astUtils = require("./utils/ast-utils"); /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/template-tag-spacing.js b/lib/rules/template-tag-spacing.js index 9bfdfc2288d..52e0bcf2073 100644 --- a/lib/rules/template-tag-spacing.js +++ b/lib/rules/template-tag-spacing.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to check spacing between template tags and their literals * @author Jonathan Wilsson + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -12,6 +13,8 @@ /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/wrap-iife.js b/lib/rules/wrap-iife.js index 4c448fa7993..518071067db 100644 --- a/lib/rules/wrap-iife.js +++ b/lib/rules/wrap-iife.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to flag when IIFE is not wrapped in parens * @author Ilya Volodin + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -40,6 +41,8 @@ function isCalleeOfNewExpression(node) { /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/wrap-regex.js b/lib/rules/wrap-regex.js index 8166c252f3c..9e2808d60c7 100644 --- a/lib/rules/wrap-regex.js +++ b/lib/rules/wrap-regex.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to flag when regex literals are not wrapped in parens * @author Matt DuVall + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -12,6 +13,8 @@ /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/lib/rules/yield-star-spacing.js b/lib/rules/yield-star-spacing.js index 9f9d918ae6c..9a67b78d25f 100644 --- a/lib/rules/yield-star-spacing.js +++ b/lib/rules/yield-star-spacing.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to check the spacing around the * in yield* expressions. * @author Bryan Smith + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -12,6 +13,8 @@ /** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { diff --git a/packages/js/src/configs/eslint-all.js b/packages/js/src/configs/eslint-all.js index 52f580035a8..f2f7a664af6 100644 --- a/packages/js/src/configs/eslint-all.js +++ b/packages/js/src/configs/eslint-all.js @@ -9,24 +9,13 @@ module.exports = Object.freeze({ "rules": { "accessor-pairs": "error", - "array-bracket-newline": "error", - "array-bracket-spacing": "error", "array-callback-return": "error", - "array-element-newline": "error", "arrow-body-style": "error", - "arrow-parens": "error", - "arrow-spacing": "error", "block-scoped-var": "error", - "block-spacing": "error", - "brace-style": "error", "camelcase": "error", "capitalized-comments": "error", "class-methods-use-this": "error", - "comma-dangle": "error", - "comma-spacing": "error", - "comma-style": "error", "complexity": "error", - "computed-property-spacing": "error", "consistent-return": "error", "consistent-this": "error", "constructor-super": "error", @@ -34,49 +23,30 @@ module.exports = Object.freeze({ "default-case": "error", "default-case-last": "error", "default-param-last": "error", - "dot-location": "error", "dot-notation": "error", - "eol-last": "error", "eqeqeq": "error", "for-direction": "error", - "func-call-spacing": "error", "func-name-matching": "error", "func-names": "error", "func-style": "error", - "function-call-argument-newline": "error", - "function-paren-newline": "error", - "generator-star-spacing": "error", "getter-return": "error", "grouped-accessor-pairs": "error", "guard-for-in": "error", "id-denylist": "error", "id-length": "error", "id-match": "error", - "implicit-arrow-linebreak": "error", - "indent": "error", "init-declarations": "error", - "jsx-quotes": "error", - "key-spacing": "error", - "keyword-spacing": "error", "line-comment-position": "error", - "linebreak-style": "error", - "lines-around-comment": "error", - "lines-between-class-members": "error", "logical-assignment-operators": "error", "max-classes-per-file": "error", "max-depth": "error", - "max-len": "error", "max-lines": "error", "max-lines-per-function": "error", "max-nested-callbacks": "error", "max-params": "error", "max-statements": "error", - "max-statements-per-line": "error", "multiline-comment-style": "error", - "multiline-ternary": "error", "new-cap": "error", - "new-parens": "error", - "newline-per-chained-call": "error", "no-alert": "error", "no-array-constructor": "error", "no-async-promise-executor": "error", @@ -87,7 +57,6 @@ module.exports = Object.freeze({ "no-class-assign": "error", "no-compare-neg-zero": "error", "no-cond-assign": "error", - "no-confusing-arrow": "error", "no-console": "error", "no-const-assign": "error", "no-constant-binary-expression": "error", @@ -117,10 +86,7 @@ module.exports = Object.freeze({ "no-extra-bind": "error", "no-extra-boolean-cast": "error", "no-extra-label": "error", - "no-extra-parens": "error", - "no-extra-semi": "error", "no-fallthrough": "error", - "no-floating-decimal": "error", "no-func-assign": "error", "no-global-assign": "error", "no-implicit-coercion": "error", @@ -141,12 +107,8 @@ module.exports = Object.freeze({ "no-loss-of-precision": "error", "no-magic-numbers": "error", "no-misleading-character-class": "error", - "no-mixed-operators": "error", - "no-mixed-spaces-and-tabs": "error", "no-multi-assign": "error", - "no-multi-spaces": "error", "no-multi-str": "error", - "no-multiple-empty-lines": "error", "no-negated-condition": "error", "no-nested-ternary": "error", "no-new": "error", @@ -180,12 +142,10 @@ module.exports = Object.freeze({ "no-shadow": "error", "no-shadow-restricted-names": "error", "no-sparse-arrays": "error", - "no-tabs": "error", "no-template-curly-in-string": "error", "no-ternary": "error", "no-this-before-super": "error", "no-throw-literal": "error", - "no-trailing-spaces": "error", "no-undef": "error", "no-undef-init": "error", "no-undefined": "error", @@ -215,19 +175,10 @@ module.exports = Object.freeze({ "no-var": "error", "no-void": "error", "no-warning-comments": "error", - "no-whitespace-before-property": "error", "no-with": "error", - "nonblock-statement-body-position": "error", - "object-curly-newline": "error", - "object-curly-spacing": "error", - "object-property-newline": "error", "object-shorthand": "error", "one-var": "error", - "one-var-declaration-per-line": "error", "operator-assignment": "error", - "operator-linebreak": "error", - "padded-blocks": "error", - "padding-line-between-statements": "error", "prefer-arrow-callback": "error", "prefer-const": "error", "prefer-destructuring": "error", @@ -241,38 +192,20 @@ module.exports = Object.freeze({ "prefer-rest-params": "error", "prefer-spread": "error", "prefer-template": "error", - "quote-props": "error", - "quotes": "error", "radix": "error", "require-atomic-updates": "error", "require-await": "error", "require-unicode-regexp": "error", "require-yield": "error", - "rest-spread-spacing": "error", - "semi": "error", - "semi-spacing": "error", - "semi-style": "error", "sort-imports": "error", "sort-keys": "error", "sort-vars": "error", - "space-before-blocks": "error", - "space-before-function-paren": "error", - "space-in-parens": "error", - "space-infix-ops": "error", - "space-unary-ops": "error", - "spaced-comment": "error", "strict": "error", - "switch-colon-spacing": "error", "symbol-description": "error", - "template-curly-spacing": "error", - "template-tag-spacing": "error", "unicode-bom": "error", "use-isnan": "error", "valid-typeof": "error", "vars-on-top": "error", - "wrap-iife": "error", - "wrap-regex": "error", - "yield-star-spacing": "error", "yoda": "error" } }); diff --git a/tests/bin/eslint.js b/tests/bin/eslint.js index 430f7112e96..0622d48e973 100644 --- a/tests/bin/eslint.js +++ b/tests/bin/eslint.js @@ -111,7 +111,12 @@ describe("bin/eslint.js", () => { fixableErrorCount: 0, fixableWarningCount: 0, output: "var foo = bar;\n", - usedDeprecatedRules: [] + usedDeprecatedRules: [ + { + ruleId: "no-extra-semi", + replacedBy: [] + } + ] } ]); diff --git a/tests/conf/eslint-all.js b/tests/conf/eslint-all.js index abee0c69b16..6475965a02a 100644 --- a/tests/conf/eslint-all.js +++ b/tests/conf/eslint-all.js @@ -31,7 +31,7 @@ describe("eslint-all", () => { const someRule = "yoda"; assert.include(ruleNames, someRule); - assert.isAbove(count, 200); + assert.isBelow(count, 200); }); it("should configure all rules as errors", () => { diff --git a/tests/lib/cli-engine/cli-engine.js b/tests/lib/cli-engine/cli-engine.js index 5012867c395..231501b364e 100644 --- a/tests/lib/cli-engine/cli-engine.js +++ b/tests/lib/cli-engine/cli-engine.js @@ -360,7 +360,12 @@ describe("CLIEngine", () => { fatalErrorCount: 0, fixableErrorCount: 0, fixableWarningCount: 0, - usedDeprecatedRules: [] + usedDeprecatedRules: [ + { + ruleId: "semi", + replacedBy: [] + } + ] }); }); @@ -725,7 +730,7 @@ describe("CLIEngine", () => { it("should return a `source` property when a parsing error has occurred", () => { engine = new CLIEngine({ useEslintrc: false, - rules: { semi: 2 } + rules: { eqeqeq: 2 } }); const report = engine.executeOnText("var bar = foothis is a syntax error.\n return bar;"); @@ -1774,7 +1779,7 @@ describe("CLIEngine", () => { engine = new CLIEngine({ cwd: originalDir, useEslintrc: false, - rules: { indent: 1, "valid-jsdoc": 0, "require-jsdoc": 0 } + rules: { eqeqeq: 1, "valid-jsdoc": 0, "require-jsdoc": 0 } }); const report = engine.executeOnFiles(["lib/cli*.js"]); diff --git a/tests/lib/eslint/eslint.js b/tests/lib/eslint/eslint.js index 60480b7cc14..b9db3543f7c 100644 --- a/tests/lib/eslint/eslint.js +++ b/tests/lib/eslint/eslint.js @@ -297,7 +297,9 @@ describe("ESLint", () => { assert.strictEqual(results[0].messages[4].ruleId, "eol-last"); assert.strictEqual(results[0].fixableErrorCount, 3); assert.strictEqual(results[0].fixableWarningCount, 0); - assert.strictEqual(results[0].usedDeprecatedRules.length, 0); + assert.strictEqual(results[0].usedDeprecatedRules.length, 2); + assert.strictEqual(results[0].usedDeprecatedRules[0].ruleId, "quotes"); + assert.strictEqual(results[0].usedDeprecatedRules[1].ruleId, "eol-last"); }); it("should report the total and per file warnings", async () => { @@ -324,7 +326,9 @@ describe("ESLint", () => { assert.strictEqual(results[0].messages[4].ruleId, "eol-last"); assert.strictEqual(results[0].fixableErrorCount, 0); assert.strictEqual(results[0].fixableWarningCount, 3); - assert.strictEqual(results[0].usedDeprecatedRules.length, 0); + assert.strictEqual(results[0].usedDeprecatedRules.length, 2); + assert.strictEqual(results[0].usedDeprecatedRules[0].ruleId, "quotes"); + assert.strictEqual(results[0].usedDeprecatedRules[1].ruleId, "eol-last"); }); }); @@ -343,7 +347,8 @@ describe("ESLint", () => { assert.strictEqual(results[0].errorCount, 1); assert.strictEqual(results[0].fixableErrorCount, 1); assert.strictEqual(results[0].warningCount, 0); - assert.strictEqual(results[0].usedDeprecatedRules.length, 0); + assert.strictEqual(results[0].usedDeprecatedRules.length, 1); + assert.strictEqual(results[0].usedDeprecatedRules[0].ruleId, "quotes"); }); it("should report the filename when passed in", async () => { @@ -455,7 +460,10 @@ describe("ESLint", () => { fixableErrorCount: 0, fixableWarningCount: 0, output: "var bar = foo;", - usedDeprecatedRules: [] + usedDeprecatedRules: [{ + ruleId: "semi", + replacedBy: [] + }] } ]); }); @@ -488,14 +496,14 @@ describe("ESLint", () => { cwd: getFixturePath() }); const options = { filePath: "file.js" }; - const results = await eslint.lintText("foo ()", options); + const results = await eslint.lintText("if (true) { foo() }", options); assert.strictEqual(results.length, 1); const { messages } = results[0]; // Some rules that should report errors in the given code. Not all, as we don't want to update this test when we add new rules. - const expectedRules = ["no-undef", "semi", "func-call-spacing"]; + const expectedRules = ["no-undef", "no-constant-condition"]; expectedRules.forEach(ruleId => { const messageFromRule = messages.find(message => message.ruleId === ruleId); @@ -853,7 +861,7 @@ describe("ESLint", () => { eslint = new ESLint({ useEslintrc: false, overrideConfig: { - rules: { semi: 2 } + rules: { eqeqeq: 2 } } }); const results = await eslint.lintText("var bar = foothis is a syntax error.\n return bar;"); @@ -1762,7 +1770,7 @@ describe("ESLint", () => { cwd: originalDir, useEslintrc: false, overrideConfig: { - rules: { indent: 1, "valid-jsdoc": 0, "require-jsdoc": 0 } + rules: { eqeqeq: 1, "valid-jsdoc": 0, "require-jsdoc": 0 } } }); const results = await eslint.lintFiles(["lib/cli*.js"]); @@ -1827,7 +1835,20 @@ describe("ESLint", () => { fixableErrorCount: 0, fixableWarningCount: 0, output: "true ? \"yes\" : \"no\";\n", - usedDeprecatedRules: [] + usedDeprecatedRules: [ + { + replacedBy: [], + ruleId: "semi" + }, + { + replacedBy: [], + ruleId: "quotes" + }, + { + replacedBy: [], + ruleId: "space-infix-ops" + } + ] }, { filePath: fs.realpathSync(path.resolve(fixtureDir, "fixmode/ok.js")), @@ -1838,7 +1859,20 @@ describe("ESLint", () => { fatalErrorCount: 0, fixableErrorCount: 0, fixableWarningCount: 0, - usedDeprecatedRules: [] + usedDeprecatedRules: [ + { + replacedBy: [], + ruleId: "semi" + }, + { + replacedBy: [], + ruleId: "quotes" + }, + { + replacedBy: [], + ruleId: "space-infix-ops" + } + ] }, { filePath: fs.realpathSync(path.resolve(fixtureDir, "fixmode/quotes-semi-eqeqeq.js")), @@ -1862,7 +1896,20 @@ describe("ESLint", () => { fixableErrorCount: 0, fixableWarningCount: 0, output: "var msg = \"hi\";\nif (msg == \"hi\") {\n\n}\n", - usedDeprecatedRules: [] + usedDeprecatedRules: [ + { + replacedBy: [], + ruleId: "semi" + }, + { + replacedBy: [], + ruleId: "quotes" + }, + { + replacedBy: [], + ruleId: "space-infix-ops" + } + ] }, { filePath: fs.realpathSync(path.resolve(fixtureDir, "fixmode/quotes.js")), @@ -1886,7 +1933,20 @@ describe("ESLint", () => { fixableErrorCount: 0, fixableWarningCount: 0, output: "var msg = \"hi\" + foo;\n", - usedDeprecatedRules: [] + usedDeprecatedRules: [ + { + replacedBy: [], + ruleId: "semi" + }, + { + replacedBy: [], + ruleId: "quotes" + }, + { + replacedBy: [], + ruleId: "space-infix-ops" + } + ] } ]); }); diff --git a/tests/lib/eslint/flat-eslint.js b/tests/lib/eslint/flat-eslint.js index 5cfeca351e7..f9f36d909fd 100644 --- a/tests/lib/eslint/flat-eslint.js +++ b/tests/lib/eslint/flat-eslint.js @@ -299,7 +299,9 @@ describe("FlatESLint", () => { assert.strictEqual(results[0].messages[3].ruleId, "eol-last"); assert.strictEqual(results[0].fixableErrorCount, 3); assert.strictEqual(results[0].fixableWarningCount, 0); - assert.strictEqual(results[0].usedDeprecatedRules.length, 0); + assert.strictEqual(results[0].usedDeprecatedRules.length, 2); + assert.strictEqual(results[0].usedDeprecatedRules[0].ruleId, "quotes"); + assert.strictEqual(results[0].usedDeprecatedRules[1].ruleId, "eol-last"); assert.strictEqual(results[0].suppressedMessages.length, 0); }); @@ -325,7 +327,9 @@ describe("FlatESLint", () => { assert.strictEqual(results[0].messages[3].ruleId, "eol-last"); assert.strictEqual(results[0].fixableErrorCount, 0); assert.strictEqual(results[0].fixableWarningCount, 3); - assert.strictEqual(results[0].usedDeprecatedRules.length, 0); + assert.strictEqual(results[0].usedDeprecatedRules.length, 2); + assert.strictEqual(results[0].usedDeprecatedRules[0].ruleId, "quotes"); + assert.strictEqual(results[0].usedDeprecatedRules[1].ruleId, "eol-last"); assert.strictEqual(results[0].suppressedMessages.length, 0); }); @@ -344,7 +348,8 @@ describe("FlatESLint", () => { assert.strictEqual(results[0].fixableErrorCount, 1); assert.strictEqual(results[0].warningCount, 0); assert.strictEqual(results[0].fatalErrorCount, 0); - assert.strictEqual(results[0].usedDeprecatedRules.length, 0); + assert.strictEqual(results[0].usedDeprecatedRules.length, 1); + assert.strictEqual(results[0].usedDeprecatedRules[0].ruleId, "quotes"); assert.strictEqual(results[0].suppressedMessages.length, 0); }); @@ -496,7 +501,12 @@ describe("FlatESLint", () => { fixableErrorCount: 0, fixableWarningCount: 0, output: "var bar = foo;", - usedDeprecatedRules: [] + usedDeprecatedRules: [ + { + ruleId: "semi", + replacedBy: [] + } + ] } ]); }); @@ -686,7 +696,7 @@ describe("FlatESLint", () => { eslint = new FlatESLint({ overrideConfigFile: true, overrideConfig: { - rules: { semi: 2 } + rules: { eqeqeq: 2 } } }); const results = await eslint.lintText("var bar = foothis is a syntax error.\n return bar;"); @@ -1956,7 +1966,7 @@ describe("FlatESLint", () => { cwd: originalDir, overrideConfigFile: true, overrideConfig: { - rules: { indent: 1, "valid-jsdoc": 0, "require-jsdoc": 0 } + rules: { eqeqeq: 1, "valid-jsdoc": 0, "require-jsdoc": 0 } } }); const results = await eslint.lintFiles(["lib/cli*.js"]); @@ -2051,7 +2061,20 @@ describe("FlatESLint", () => { fixableErrorCount: 0, fixableWarningCount: 0, output: "true ? \"yes\" : \"no\";\n", - usedDeprecatedRules: [] + usedDeprecatedRules: [ + { + replacedBy: [], + ruleId: "semi" + }, + { + replacedBy: [], + ruleId: "quotes" + }, + { + replacedBy: [], + ruleId: "space-infix-ops" + } + ] }, { filePath: fs.realpathSync(path.resolve(fixtureDir, "fixmode/ok.js")), @@ -2062,7 +2085,20 @@ describe("FlatESLint", () => { fatalErrorCount: 0, fixableErrorCount: 0, fixableWarningCount: 0, - usedDeprecatedRules: [] + usedDeprecatedRules: [ + { + replacedBy: [], + ruleId: "semi" + }, + { + replacedBy: [], + ruleId: "quotes" + }, + { + replacedBy: [], + ruleId: "space-infix-ops" + } + ] }, { filePath: fs.realpathSync(path.resolve(fixtureDir, "fixmode/quotes-semi-eqeqeq.js")), @@ -2086,7 +2122,20 @@ describe("FlatESLint", () => { fixableErrorCount: 0, fixableWarningCount: 0, output: "var msg = \"hi\";\nif (msg == \"hi\") {\n\n}\n", - usedDeprecatedRules: [] + usedDeprecatedRules: [ + { + replacedBy: [], + ruleId: "semi" + }, + { + replacedBy: [], + ruleId: "quotes" + }, + { + replacedBy: [], + ruleId: "space-infix-ops" + } + ] }, { filePath: fs.realpathSync(path.resolve(fixtureDir, "fixmode/quotes.js")), @@ -2110,7 +2159,20 @@ describe("FlatESLint", () => { fixableErrorCount: 0, fixableWarningCount: 0, output: "var msg = \"hi\" + foo;\n", - usedDeprecatedRules: [] + usedDeprecatedRules: [ + { + replacedBy: [], + ruleId: "semi" + }, + { + replacedBy: [], + ruleId: "quotes" + }, + { + replacedBy: [], + ruleId: "space-infix-ops" + } + ] } ]); });