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

New: Add requireSchemaPropertyWhenOptionless option to require-meta-schema rule #180

Conversation

bmish
Copy link
Member

@bmish bmish commented Sep 23, 2021

Fixes #179.

@bmish bmish marked this pull request as draft September 23, 2021 15:28
@bmish bmish force-pushed the require-meta-schema-requireSchemaPropertyWhenOptionless branch from 3166727 to 588b60d Compare September 23, 2021 15:35
@bmish bmish marked this pull request as ready for review September 23, 2021 15:37
@bmish bmish mentioned this pull request Sep 23, 2021
20 tasks
node: metaNode,
messageId: 'missing',
fix (fixer) {
return utils.insertProperty(fixer, metaNode, 'schema: []', sourceCode);
Copy link
Contributor

Choose a reason for hiding this comment

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

is it likely to change the runtime behavior?

  • before fixing: skip validating
  • after fixing: no options allowed.

or it can be a suggestion?

Copy link
Member Author

Choose a reason for hiding this comment

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

This PR does not change the existing autofixing behavior. However, you just discovered a bug. The goal is that the rule should only autofix to schema: [] if no options are used. I can fix this autofixing bug as a follow-up PR once this PR is merged.

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~

@aladdin-add aladdin-add merged commit 483f78f into eslint-community:master Sep 24, 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.

require-meta-schema: Add requireSchemaPropertyWhenOptionless option
2 participants