Skip to content

Flag a violation when rule options are used but an empty schema is specified in require-meta-schema rule #138

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

Merged

Conversation

bmish
Copy link
Member

@bmish bmish commented Jun 19, 2021

Flags a violation if an empty schema is specified but rule options are used.

This new check is similar to how:

  • require-meta-fixable checks that fixable: true is specified when an autofixer is found
  • require-meta-has-suggestions checks that hasSuggestions: true is specified when suggestions are provided

Note: this is not a breaking change, since ESLint itself already prevents rules from using options when an empty rule schema is specified, so it's not possible that this new violation could be flagged on existing rules.

@bmish bmish force-pushed the require-meta-schema-detect-usage branch 2 times, most recently from a2fc7fe to d01141d Compare June 19, 2021 18:16
@bmish bmish changed the title Flag a violation when rule options are used but an empty schema is present in require-meta-schema rule Flag a violation when rule options are used but an empty schema is specified in require-meta-schema rule Jun 19, 2021
…is present in `require-meta-schema` rule

This new check is similar to how:
* `require-meta-fixable` checks that `fixable: true` is specified when an autofixer is found
* `require-meta-has-suggestions` checks that `hasSuggestions: true` is specified when suggestions are provided

Note: this is *not* a breaking change, since ESLint itself already prevents rules from using options when an empty rule schema is specified, so it's not possible that this new violation could be flagged on existing rules.
@bmish bmish force-pushed the require-meta-schema-detect-usage branch from d01141d to ba05f82 Compare June 19, 2021 21:21
@aladdin-add
Copy link
Contributor

yes! per eslint's versioning policy(https://github.com/eslint/eslint#semantic-versioning-policy), it can be released in a minor.

Copy link
Contributor

@aladdin-add aladdin-add left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks! 💯

@aladdin-add aladdin-add merged commit 6ffddd7 into eslint-community:master Jun 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants