Skip to content

Commit 66ac8fc

Browse files
committed
Breaking: Enable additional recommended rules for v4
1 parent 990f8f6 commit 66ac8fc

16 files changed

+29
-15
lines changed

README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -47,27 +47,27 @@ Then configure the rules you want to use under the rules section.
4747
<!-- __BEGIN AUTOGENERATED TABLE__ -->
4848
Name | ✔️ | 🛠 | 💡 | Description
4949
----- | ----- | ----- | ----- | -----
50-
[consistent-output](https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/blob/master/docs/rules/consistent-output.md) | | | | enforce consistent use of `output` assertions in rule tests
50+
[consistent-output](https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/blob/master/docs/rules/consistent-output.md) | ✔️ | | | enforce consistent use of `output` assertions in rule tests
5151
[fixer-return](https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/blob/master/docs/rules/fixer-return.md) | ✔️ | | | require fixer functions to return a fix
5252
[meta-property-ordering](https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/blob/master/docs/rules/meta-property-ordering.md) | | 🛠 | | enforce the order of meta properties
53-
[no-deprecated-context-methods](https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/blob/master/docs/rules/no-deprecated-context-methods.md) | | 🛠 | | disallow usage of deprecated methods on rule context objects
53+
[no-deprecated-context-methods](https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/blob/master/docs/rules/no-deprecated-context-methods.md) | ✔️ | 🛠 | | disallow usage of deprecated methods on rule context objects
5454
[no-deprecated-report-api](https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/blob/master/docs/rules/no-deprecated-report-api.md) | ✔️ | 🛠 | | disallow the version of `context.report()` with multiple arguments
5555
[no-identical-tests](https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/blob/master/docs/rules/no-identical-tests.md) | ✔️ | 🛠 | | disallow identical tests
5656
[no-missing-placeholders](https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/blob/master/docs/rules/no-missing-placeholders.md) | ✔️ | | | disallow missing placeholders in rule report messages
57-
[no-only-tests](https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/blob/master/docs/rules/no-only-tests.md) | | | 💡 | disallow the test case property `only`
57+
[no-only-tests](https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/blob/master/docs/rules/no-only-tests.md) | ✔️ | | 💡 | disallow the test case property `only`
5858
[no-unused-placeholders](https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/blob/master/docs/rules/no-unused-placeholders.md) | ✔️ | | | disallow unused placeholders in rule report messages
5959
[no-useless-token-range](https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/blob/master/docs/rules/no-useless-token-range.md) | ✔️ | 🛠 | | disallow unnecessary calls to `sourceCode.getFirstToken()` and `sourceCode.getLastToken()`
60-
[prefer-object-rule](https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/blob/master/docs/rules/prefer-object-rule.md) | | 🛠 | | disallow rule exports where the export is a function
60+
[prefer-object-rule](https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/blob/master/docs/rules/prefer-object-rule.md) | ✔️ | 🛠 | | disallow rule exports where the export is a function
6161
[prefer-output-null](https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/blob/master/docs/rules/prefer-output-null.md) | | 🛠 | | disallow invalid RuleTester test cases where the `output` matches the `code`
6262
[prefer-placeholders](https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/blob/master/docs/rules/prefer-placeholders.md) | | | | require using placeholders for dynamic report messages
6363
[prefer-replace-text](https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/blob/master/docs/rules/prefer-replace-text.md) | | | | require using `replaceText()` instead of `replaceTextRange()`
6464
[report-message-format](https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/blob/master/docs/rules/report-message-format.md) | | | | enforce a consistent format for rule report messages
6565
[require-meta-docs-description](https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/blob/master/docs/rules/require-meta-docs-description.md) | | | | require rules to implement a `meta.docs.description` property with the correct format
6666
[require-meta-docs-url](https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/blob/master/docs/rules/require-meta-docs-url.md) | | 🛠 | | require rules to implement a `meta.docs.url` property
6767
[require-meta-fixable](https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/blob/master/docs/rules/require-meta-fixable.md) | ✔️ | | | require rules to implement a `meta.fixable` property
68-
[require-meta-has-suggestions](https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/blob/master/docs/rules/require-meta-has-suggestions.md) | | 🛠 | | require suggestable rules to implement a `meta.hasSuggestions` property
69-
[require-meta-schema](https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/blob/master/docs/rules/require-meta-schema.md) | | 🛠 | | require rules to implement a `meta.schema` property
70-
[require-meta-type](https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/blob/master/docs/rules/require-meta-type.md) | | | | require rules to implement a `meta.type` property
68+
[require-meta-has-suggestions](https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/blob/master/docs/rules/require-meta-has-suggestions.md) | ✔️ | 🛠 | | require suggestable rules to implement a `meta.hasSuggestions` property
69+
[require-meta-schema](https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/blob/master/docs/rules/require-meta-schema.md) | ✔️ | 🛠 | | require rules to implement a `meta.schema` property
70+
[require-meta-type](https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/blob/master/docs/rules/require-meta-type.md) | ✔️ | | | require rules to implement a `meta.type` property
7171
[test-case-property-ordering](https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/blob/master/docs/rules/test-case-property-ordering.md) | | 🛠 | | require the properties of a test case to be placed in a consistent order
7272
[test-case-shorthand-strings](https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/blob/master/docs/rules/test-case-shorthand-strings.md) | | 🛠 | | enforce consistent usage of shorthand strings for test cases with no options
7373
<!-- __END AUTOGENERATED TABLE__ -->

docs/rules/consistent-output.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Enforce consistent use of `output` assertions in rule tests (consistent-output)
22

3+
✔️ The `"extends": "plugin:eslint-plugin/recommended"` property in a configuration file enables this rule.
4+
35
When writing tests for a fixable rule with `RuleTester`, you can assert the autofix output of your test cases. However, it can be easy to forget to assert the output of a particular test case.
46

57
[As of ESLint 7](https://eslint.org/docs/user-guide/migrating-to-7.0.0#additional-validation-added-to-the-ruletester-class), test cases that trigger an autofix are required to provide the `output` property.

docs/rules/no-deprecated-context-methods.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Disallow usage of deprecated methods on rule context objects (no-deprecated-context-methods)
22

3+
✔️ The `"extends": "plugin:eslint-plugin/recommended"` property in a configuration file enables this rule.
4+
35
⚒️ The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#--fix) can automatically fix some of the problems reported by this rule.
46

57
This rule disallows the use of deprecated methods on rule `context` objects.

docs/rules/no-only-tests.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Disallow the test case property `only` (no-only-tests)
22

3+
✔️ The `"extends": "plugin:eslint-plugin/recommended"` property in a configuration file enables this rule.
4+
35
💡 Some problems reported by this rule are manually fixable by editor [suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions).
46

57
The [`only` property](https://eslint.org/docs/developer-guide/unit-tests#running-individual-tests) can be used as of [ESLint 7.29](https://eslint.org/blog/2021/06/eslint-v7.29.0-released#highlights) for running individual rule test cases with less-noisy debugging. This feature should be only used in development, as it prevents all the tests from running. Mistakenly checking-in a test case with this property can cause CI tests to incorrectly pass.

docs/rules/prefer-object-rule.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Disallow rule exports where the export is a function (prefer-object-rule)
22

3+
✔️ The `"extends": "plugin:eslint-plugin/recommended"` property in a configuration file enables this rule.
4+
35
⚒️ The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#--fix) can automatically fix some of the problems reported by this rule.
46

57
## Rule Details

docs/rules/require-meta-has-suggestions.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Require suggestable rules to implement a `meta.hasSuggestions` property (require-meta-has-suggestions)
22

3+
✔️ The `"extends": "plugin:eslint-plugin/recommended"` property in a configuration file enables this rule.
4+
35
⚒️ The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#--fix) can automatically fix some of the problems reported by this rule.
46

57
A suggestable ESLint rule should specify the `meta.hasSuggestions` property with a value of `true`. This makes it easier for both humans and tooling to tell whether a rule provides suggestions. [As of ESLint 8](https://eslint.org/blog/2021/06/whats-coming-in-eslint-8.0.0#rules-with-suggestions-now-require-the-metahassuggestions-property), an exception will be thrown if a suggestable rule is missing this property.

docs/rules/require-meta-schema.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Require rules to implement a `meta.schema` property (require-meta-schema)
22

3+
✔️ The `"extends": "plugin:eslint-plugin/recommended"` property in a configuration file enables this rule.
4+
35
⚒️ The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#--fix) can automatically fix some of the problems reported by this rule.
46

57
Defining a schema for each rule allows eslint to validate that configuration options are passed correctly. Even when there are no options for a rule, a schema should still be defined (as an empty array) so that eslint can validate that no data is mistakenly passed to the rule.

docs/rules/require-meta-type.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Require rules to implement a `meta.type` property (require-meta-type)
22

3+
✔️ The `"extends": "plugin:eslint-plugin/recommended"` property in a configuration file enables this rule.
4+
35
ESLint v5.9.0 introduces a new `--fix-type` option for the command line interface. This option allows users to filter the type of fixes applied when using `--fix`.
46

57
Fixes in custom rules will not be applied when using `--fix-type` unless they include a `meta.type` field.

lib/rules/consistent-output.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ module.exports = {
1717
docs: {
1818
description: 'enforce consistent use of `output` assertions in rule tests',
1919
category: 'Tests',
20-
recommended: false,
20+
recommended: true,
2121
},
2222
fixable: null, // or "code" or "whitespace"
2323
schema: [

lib/rules/no-deprecated-context-methods.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ module.exports = {
4040
docs: {
4141
description: 'disallow usage of deprecated methods on rule context objects',
4242
category: 'Rules',
43-
recommended: false,
43+
recommended: true,
4444
},
4545
fixable: 'code',
4646
schema: [],

lib/rules/no-only-tests.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module.exports = {
99
docs: {
1010
description: 'disallow the test case property `only`',
1111
category: 'Tests',
12-
recommended: false,
12+
recommended: true,
1313
},
1414
schema: [],
1515
messages: {

lib/rules/prefer-object-rule.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module.exports = {
1616
docs: {
1717
description: 'disallow rule exports where the export is a function',
1818
category: 'Rules',
19-
recommended: false,
19+
recommended: true,
2020
},
2121
fixable: 'code',
2222
schema: [],

lib/rules/require-meta-docs-description.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ module.exports = {
1515
docs: {
1616
description: 'require rules to implement a `meta.docs.description` property with the correct format',
1717
category: 'Rules',
18-
recommended: false, // TODO: enable it in a major release.
18+
recommended: false,
1919
},
2020
fixable: null,
2121
schema: [

lib/rules/require-meta-has-suggestions.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ module.exports = {
1313
docs: {
1414
description: 'require suggestable rules to implement a `meta.hasSuggestions` property',
1515
category: 'Rules',
16-
recommended: false,
16+
recommended: true,
1717
},
1818
fixable: 'code',
1919
schema: [],

lib/rules/require-meta-schema.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ module.exports = {
1313
docs: {
1414
description: 'require rules to implement a `meta.schema` property',
1515
category: 'Rules',
16-
recommended: false, // TODO: enable it in a major release.
16+
recommended: true,
1717
},
1818
fixable: 'code',
1919
schema: [

lib/rules/require-meta-type.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ module.exports = {
1919
docs: {
2020
description: 'require rules to implement a `meta.type` property',
2121
category: 'Rules',
22-
recommended: false, // TODO: enable it in a major release.
22+
recommended: true,
2323
},
2424
fixable: null,
2525
schema: [],

0 commit comments

Comments
 (0)