Skip to content

feat!: enable no-meta-replaced-by, no-meta-schema-default, require-meta-default-options, require-meta-schema-description as recommended rules #530

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ export default [
| [meta-property-ordering](docs/rules/meta-property-ordering.md) | enforce the order of meta properties | | 🔧 | | |
| [no-deprecated-context-methods](docs/rules/no-deprecated-context-methods.md) | disallow usage of deprecated methods on rule context objects | ✅ | 🔧 | | |
| [no-deprecated-report-api](docs/rules/no-deprecated-report-api.md) | disallow the version of `context.report()` with multiple arguments | ✅ | 🔧 | | |
| [no-meta-replaced-by](docs/rules/no-meta-replaced-by.md) | disallow using the `meta.replacedBy` rule property | | | | |
| [no-meta-schema-default](docs/rules/no-meta-schema-default.md) | disallow rules `meta.schema` properties to include defaults | | | | |
| [no-meta-replaced-by](docs/rules/no-meta-replaced-by.md) | disallow using the `meta.replacedBy` rule property | | | | |
| [no-meta-schema-default](docs/rules/no-meta-schema-default.md) | disallow rules `meta.schema` properties to include defaults | | | | |
| [no-missing-message-ids](docs/rules/no-missing-message-ids.md) | disallow `messageId`s that are missing from `meta.messages` | ✅ | | | |
| [no-missing-placeholders](docs/rules/no-missing-placeholders.md) | disallow missing placeholders in rule report messages | ✅ | | | |
| [no-property-in-node](docs/rules/no-property-in-node.md) | disallow using `in` to narrow node types instead of looking at properties | | | | 💭 |
Expand All @@ -87,14 +87,14 @@ export default [
| [prefer-placeholders](docs/rules/prefer-placeholders.md) | require using placeholders for dynamic report messages | | | | |
| [prefer-replace-text](docs/rules/prefer-replace-text.md) | require using `replaceText()` instead of `replaceTextRange()` | | | | |
| [report-message-format](docs/rules/report-message-format.md) | enforce a consistent format for rule report messages | | | | |
| [require-meta-default-options](docs/rules/require-meta-default-options.md) | require only rules with options to implement a `meta.defaultOptions` property | | 🔧 | | |
| [require-meta-default-options](docs/rules/require-meta-default-options.md) | require only rules with options to implement a `meta.defaultOptions` property | | 🔧 | | |
| [require-meta-docs-description](docs/rules/require-meta-docs-description.md) | require rules to implement a `meta.docs.description` property with the correct format | | | | |
| [require-meta-docs-recommended](docs/rules/require-meta-docs-recommended.md) | require rules to implement a `meta.docs.recommended` property | | | 💡 | |
| [require-meta-docs-url](docs/rules/require-meta-docs-url.md) | require rules to implement a `meta.docs.url` property | | 🔧 | | |
| [require-meta-fixable](docs/rules/require-meta-fixable.md) | require rules to implement a `meta.fixable` property | ✅ | | | |
| [require-meta-has-suggestions](docs/rules/require-meta-has-suggestions.md) | require suggestable rules to implement a `meta.hasSuggestions` property | ✅ | 🔧 | | |
| [require-meta-schema](docs/rules/require-meta-schema.md) | require rules to implement a `meta.schema` property | ✅ | | 💡 | |
| [require-meta-schema-description](docs/rules/require-meta-schema-description.md) | require rules `meta.schema` properties to include descriptions | | | | |
| [require-meta-schema-description](docs/rules/require-meta-schema-description.md) | require rules `meta.schema` properties to include descriptions | | | | |
| [require-meta-type](docs/rules/require-meta-type.md) | require rules to implement a `meta.type` property | ✅ | | | |

### Tests
Expand Down
2 changes: 2 additions & 0 deletions docs/rules/no-meta-replaced-by.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Disallow using the `meta.replacedBy` rule property (`eslint-plugin/no-meta-replaced-by`)

💼 This rule is enabled in the ✅ `recommended` [config](https://github.com/eslint-community/eslint-plugin-eslint-plugin#presets).

<!-- end auto-generated rule header -->

As of ESLint v9.21.0, the rule property `meta.deprecated` can be either a boolean or an object of type `DeprecatedInfo`. The `DeprecatedInfo` type includes an optional `replacedBy` array that replaces the now-deprecated `meta.replacedBy` property.
Expand Down
2 changes: 2 additions & 0 deletions docs/rules/no-meta-schema-default.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Disallow rules `meta.schema` properties to include defaults (`eslint-plugin/no-meta-schema-default`)

💼 This rule is enabled in the ✅ `recommended` [config](https://github.com/eslint-community/eslint-plugin-eslint-plugin#presets).

<!-- end auto-generated rule header -->

Since ESLint v9.15.0, rules' default options are supported using `meta.defaultOptions`. Additionally defining them using the `default` property in `meta.schema` is confusing, error-prone, and can be ambiguous for complex schemas.
Expand Down
2 changes: 2 additions & 0 deletions docs/rules/require-meta-default-options.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Require only rules with options to implement a `meta.defaultOptions` property (`eslint-plugin/require-meta-default-options`)

💼 This rule is enabled in the ✅ `recommended` [config](https://github.com/eslint-community/eslint-plugin-eslint-plugin#presets).

🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

<!-- end auto-generated rule header -->
Expand Down
2 changes: 2 additions & 0 deletions docs/rules/require-meta-schema-description.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Require rules `meta.schema` properties to include descriptions (`eslint-plugin/require-meta-schema-description`)

💼 This rule is enabled in the ✅ `recommended` [config](https://github.com/eslint-community/eslint-plugin-eslint-plugin#presets).

<!-- end auto-generated rule header -->

Defining a description in the schema for each rule option helps explain that option to users.
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-meta-replaced-by.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const rule = {
docs: {
description: 'disallow using the `meta.replacedBy` rule property',
category: 'Rules',
recommended: false,
recommended: true,
url: 'https://github.com/eslint-community/eslint-plugin-eslint-plugin/tree/HEAD/docs/rules/no-meta-replaced-by.md',
},
schema: [],
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-meta-schema-default.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const rule = {
description:
'disallow rules `meta.schema` properties to include defaults',
category: 'Rules',
recommended: false,
recommended: true,
url: 'https://github.com/eslint-community/eslint-plugin-eslint-plugin/tree/HEAD/docs/rules/no-meta-schema-default.md',
},
schema: [],
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/require-meta-default-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const rule = {
description:
'require only rules with options to implement a `meta.defaultOptions` property',
category: 'Rules',
recommended: false,
recommended: true,
url: 'https://github.com/eslint-community/eslint-plugin-eslint-plugin/tree/HEAD/docs/rules/require-meta-default-options.md',
},
fixable: 'code',
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/require-meta-schema-description.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const rule = {
description:
'require rules `meta.schema` properties to include descriptions',
category: 'Rules',
recommended: false,
recommended: true,
url: 'https://github.com/eslint-community/eslint-plugin-eslint-plugin/tree/HEAD/docs/rules/require-meta-schema-description.md',
},
schema: [],
Expand Down