Skip to content
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

require-meta-schema: Add requireSchemaPropertyWhenOptionless option #179

Closed
bmish opened this issue Sep 23, 2021 · 0 comments · Fixed by #180
Closed

require-meta-schema: Add requireSchemaPropertyWhenOptionless option #179

bmish opened this issue Sep 23, 2021 · 0 comments · Fixed by #180

Comments

@bmish
Copy link
Member

bmish commented Sep 23, 2021

Add requireSchemaPropertyWhenOptionless option to require-meta-schema rule (default true initially to match current behavior, could be changed in major release).

Why?

  • Some people don't want to bother including schema: [] when their rules have no options (example)
  • schema: [] might not be necessary in the future if the ESLint default behavior changes (see below)

I have an update to share regarding the require-meta-schema rule. I have recommended to the ESLint team that schemas should be required for rules with options and they are interested in this idea so I'll be opening an RFC for it targeting ESLint 9.

With this change, rules without options will no longer need to specify schema: [], as that will be the default behavior. That means we can update the require-meta-schema rule to only require the schema property for rules that actually have options (which is the same as how require-meta-fixable only requires the fixable property for rules with fixers).

As a result of this change, we should be able to enable the require-meta-schema rule as recommended in eslint-plugin-eslint-plugin v4.

Originally posted by @bmish in #120 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant