You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+37-35
Original file line number
Diff line number
Diff line change
@@ -54,46 +54,48 @@ Here's an example ESLint configuration that:
54
54
55
55
## <aname='Rules'></a>Rules
56
56
57
-
* ✔️ if the rule belongs to the `recommended` configuration
58
-
* 🛠 if some problems reported by the rule are automatically fixable by the `--fix`[command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) option
59
-
* 💡 if some problems reported by the rule are manually fixable by editor [suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions)
60
-
61
-
<!-- __BEGIN AUTOGENERATED TABLE__ -->
62
-
Name | ✔️ | 🛠 | 💡 | Description
63
-
----- | ----- | ----- | ----- | -----
64
-
[consistent-output](https://github.com/eslint-community/eslint-plugin-eslint-plugin/blob/master/docs/rules/consistent-output.md) | ✔️ | | | enforce consistent use of `output` assertions in rule tests
65
-
[fixer-return](https://github.com/eslint-community/eslint-plugin-eslint-plugin/blob/master/docs/rules/fixer-return.md) | ✔️ | | | require fixer functions to return a fix
66
-
[meta-property-ordering](https://github.com/eslint-community/eslint-plugin-eslint-plugin/blob/master/docs/rules/meta-property-ordering.md) | | 🛠 | | enforce the order of meta properties
67
-
[no-deprecated-context-methods](https://github.com/eslint-community/eslint-plugin-eslint-plugin/blob/master/docs/rules/no-deprecated-context-methods.md) | ✔️ | 🛠 | | disallow usage of deprecated methods on rule context objects
68
-
[no-deprecated-report-api](https://github.com/eslint-community/eslint-plugin-eslint-plugin/blob/master/docs/rules/no-deprecated-report-api.md) | ✔️ | 🛠 | | disallow the version of `context.report()` with multiple arguments
[no-missing-message-ids](https://github.com/eslint-community/eslint-plugin-eslint-plugin/blob/master/docs/rules/no-missing-message-ids.md) | ✔️ | | | disallow `messageId`s that are missing from `meta.messages`
[no-only-tests](https://github.com/eslint-community/eslint-plugin-eslint-plugin/blob/master/docs/rules/no-only-tests.md) | ✔️ | | 💡 | disallow the test case property `only`
[prefer-output-null](https://github.com/eslint-community/eslint-plugin-eslint-plugin/blob/master/docs/rules/prefer-output-null.md) | ✔️ | 🛠 | | disallow invalid RuleTester test cases where the `output` matches the `code`
79
-
[prefer-placeholders](https://github.com/eslint-community/eslint-plugin-eslint-plugin/blob/master/docs/rules/prefer-placeholders.md) | | | | require using placeholders for dynamic report messages
80
-
[prefer-replace-text](https://github.com/eslint-community/eslint-plugin-eslint-plugin/blob/master/docs/rules/prefer-replace-text.md) | | | | require using `replaceText()` instead of `replaceTextRange()`
81
-
[report-message-format](https://github.com/eslint-community/eslint-plugin-eslint-plugin/blob/master/docs/rules/report-message-format.md) | | | | enforce a consistent format for rule report messages
82
-
[require-meta-docs-description](https://github.com/eslint-community/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
83
-
[require-meta-docs-url](https://github.com/eslint-community/eslint-plugin-eslint-plugin/blob/master/docs/rules/require-meta-docs-url.md) | | 🛠 | | require rules to implement a `meta.docs.url` property
84
-
[require-meta-fixable](https://github.com/eslint-community/eslint-plugin-eslint-plugin/blob/master/docs/rules/require-meta-fixable.md) | ✔️ | | | require rules to implement a `meta.fixable` property
85
-
[require-meta-has-suggestions](https://github.com/eslint-community/eslint-plugin-eslint-plugin/blob/master/docs/rules/require-meta-has-suggestions.md) | ✔️ | 🛠 | | require suggestable rules to implement a `meta.hasSuggestions` property
86
-
[require-meta-schema](https://github.com/eslint-community/eslint-plugin-eslint-plugin/blob/master/docs/rules/require-meta-schema.md) | ✔️ | | 💡 | require rules to implement a `meta.schema` property
87
-
[require-meta-type](https://github.com/eslint-community/eslint-plugin-eslint-plugin/blob/master/docs/rules/require-meta-type.md) | ✔️ | | | require rules to implement a `meta.type` property
88
-
[test-case-property-ordering](https://github.com/eslint-community/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
89
-
[test-case-shorthand-strings](https://github.com/eslint-community/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
90
-
<!-- __END AUTOGENERATED TABLE__ -->
57
+
<!-- begin rules list -->
58
+
59
+
✅ Enabled in the `recommended` configuration.\
60
+
🔧 Automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--fix).\
61
+
💡 Manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions).
|[prefer-output-null](docs/rules/prefer-output-null.md)| disallow invalid RuleTester test cases where the `output` matches the `code`| ✅ | 🔧 ||
80
+
|[prefer-placeholders](docs/rules/prefer-placeholders.md)| require using placeholders for dynamic report messages ||||
81
+
|[prefer-replace-text](docs/rules/prefer-replace-text.md)| require using `replaceText()` instead of `replaceTextRange()`||||
82
+
|[report-message-format](docs/rules/report-message-format.md)| enforce a consistent format for rule report messages ||||
83
+
|[require-meta-docs-description](docs/rules/require-meta-docs-description.md)| require rules to implement a `meta.docs.description` property with the correct format ||||
84
+
|[require-meta-docs-url](docs/rules/require-meta-docs-url.md)| require rules to implement a `meta.docs.url` property || 🔧 ||
85
+
|[require-meta-fixable](docs/rules/require-meta-fixable.md)| require rules to implement a `meta.fixable` property | ✅ |||
86
+
|[require-meta-has-suggestions](docs/rules/require-meta-has-suggestions.md)| require suggestable rules to implement a `meta.hasSuggestions` property | ✅ | 🔧 ||
87
+
|[require-meta-schema](docs/rules/require-meta-schema.md)| require rules to implement a `meta.schema` property | ✅ || 💡 |
88
+
|[require-meta-type](docs/rules/require-meta-type.md)| require rules to implement a `meta.type` property | ✅ |||
89
+
|[test-case-property-ordering](docs/rules/test-case-property-ordering.md)| require the properties of a test case to be placed in a consistent order || 🔧 ||
90
+
|[test-case-shorthand-strings](docs/rules/test-case-shorthand-strings.md)| enforce consistent usage of shorthand strings for test cases with no options || 🔧 ||
91
+
92
+
<!-- end rules list -->
91
93
92
94
## <aname='Presets'></a>Presets
93
95
94
96
|| Name | Description |
95
97
|:--|:-----|:------------|
96
-
|✔️|`recommended`| enables all recommended rules in this plugin |
98
+
|✅|`recommended`| enables all recommended rules in this plugin |
97
99
||`rules-recommended`| enables all recommended rules that are aimed at linting ESLint rule files |
98
100
||`tests-recommended`| enables all recommended rules that are aimed at linting ESLint test files |
Copy file name to clipboardExpand all lines: docs/rules/consistent-output.md
+4-2
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,8 @@
1
-
# Enforce consistent use of `output` assertions in rule tests (consistent-output)
1
+
# Enforce consistent use of `output` assertions in rule tests (`eslint-plugin/consistent-output`)
2
2
3
-
✔️ The `"extends": "plugin:eslint-plugin/recommended"` property in a configuration file enables this rule.
3
+
✅ This rule is enabled in the `recommended` config.
4
+
5
+
<!-- end rule header -->
4
6
5
7
When writing tests for fixable rules, the `output` property on each test case can be used to assert what autofixed code is produced, or to assert that no autofix is produced using `output: null`.
Copy file name to clipboardExpand all lines: docs/rules/fixer-return.md
+4-2
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,8 @@
1
-
# Require fixer functions to return a fix (fixer-return)
1
+
# Require fixer functions to return a fix (`eslint-plugin/fixer-return`)
2
2
3
-
✔️ The `"extends": "plugin:eslint-plugin/recommended"` property in a configuration file enables this rule.
3
+
✅ This rule is enabled in the `recommended` config.
4
+
5
+
<!-- end rule header -->
4
6
5
7
In a [fixable](https://eslint.org/docs/developer-guide/working-with-rules#applying-fixes) rule, a fixer function is useless if it never returns anything.
Copy file name to clipboardExpand all lines: docs/rules/meta-property-ordering.md
+4-2
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,8 @@
1
-
# Enforce the order of meta properties (meta-property-ordering)
1
+
# Enforce the order of meta properties (`eslint-plugin/meta-property-ordering`)
2
2
3
-
⚒️ 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.
3
+
🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).
4
+
5
+
<!-- end rule header -->
4
6
5
7
This rule enforces that meta properties of a rule are placed in a consistent order.
Copy file name to clipboardExpand all lines: docs/rules/no-deprecated-context-methods.md
+5-3
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,10 @@
1
-
# Disallow usage of deprecated methods on rule context objects (no-deprecated-context-methods)
1
+
# Disallow usage of deprecated methods on rule context objects (`eslint-plugin/no-deprecated-context-methods`)
2
2
3
-
✔️ The `"extends": "plugin:eslint-plugin/recommended"` property in a configuration file enables this rule.
3
+
✅ This rule is enabled in the `recommended` config.
4
4
5
-
⚒️ 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.
5
+
🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).
6
+
7
+
<!-- end rule header -->
6
8
7
9
This rule disallows the use of deprecated methods on rule `context` objects.
Copy file name to clipboardExpand all lines: docs/rules/no-deprecated-report-api.md
+5-3
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,10 @@
1
-
# Disallow the version of `context.report()` with multiple arguments (no-deprecated-report-api)
1
+
# Disallow the version of `context.report()` with multiple arguments (`eslint-plugin/no-deprecated-report-api`)
2
2
3
-
✔️ The `"extends": "plugin:eslint-plugin/recommended"` property in a configuration file enables this rule.
3
+
✅ This rule is enabled in the `recommended` config.
4
4
5
-
⚒️ 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.
5
+
🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).
6
+
7
+
<!-- end rule header -->
6
8
7
9
ESLint has two APIs that rules can use to report problems.
✔️ The `"extends": "plugin:eslint-plugin/recommended"` property in a configuration file enables this rule.
3
+
✅ This rule is enabled in the `recommended` config.
4
4
5
-
⚒️ 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.
5
+
🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).
6
+
7
+
<!-- end rule header -->
6
8
7
9
Duplicate test cases can cause confusion, can be hard to detect manually in a long file, and serve no purpose.
Copy file name to clipboardExpand all lines: docs/rules/no-missing-message-ids.md
+4-2
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,8 @@
1
-
# Disallow `messageId`s that are missing from `meta.messages` (no-missing-message-ids)
1
+
# Disallow `messageId`s that are missing from `meta.messages` (`eslint-plugin/no-missing-message-ids`)
2
2
3
-
✔️ The `"extends": "plugin:eslint-plugin/recommended"` property in a configuration file enables this rule.
3
+
✅ This rule is enabled in the `recommended` config.
4
+
5
+
<!-- end rule header -->
4
6
5
7
When using `meta.messages` and `messageId` to report rule violations, it's possible to mistakenly use a `messageId` that doesn't exist in `meta.messages`.
0 commit comments