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

Update: require meta for fixable rules in RuleTester (refs #13349) #13489

Merged
merged 3 commits into from Jul 31, 2020

Conversation

mdjermanovic
Copy link
Member

@mdjermanovic mdjermanovic commented Jul 13, 2020

Prerequisites checklist

What is the purpose of this pull request? (put an "X" next to an item)

[X] Add something to the core

refs #13349, fixes step 2 from this comment.

This PR updates RuleTester to require meta property in fixable rules.

What changes did you make? (Give an overview)

An invalid test case, where the rule being tested has fixed the given code, will now fail if the rule doesn't have meta property.

Is there anything you'd like reviewers to focus on?

  • RuleTester still doesn't check for meta.fixable, because linter already throws an error if the rule that provided a fix does have meta but doesn't have meta.fixable.
  • This change doesn't affect legacy-format rules (functions). They will be still allowed to make fixes. I guess that was decided?
  • This change also affects legacy-format rules (functions). RuleTester will no longer allow fixable legacy-format rules.
  • This change can break plugins' builds.

@mdjermanovic mdjermanovic added core Relates to ESLint's core APIs and features accepted There is consensus among the team that this change meets the criteria for inclusion labels Jul 13, 2020
@mdjermanovic mdjermanovic reopened this Jul 15, 2020
@mdjermanovic mdjermanovic added the do not merge This pull request should not be merged yet label Jul 16, 2020
@mdjermanovic mdjermanovic removed the do not merge This pull request should not be merged yet label Jul 23, 2020
@mdjermanovic
Copy link
Member Author

This is now ready for review.

As agreed in #13349, this change should have an announcement.

Regarding the announcement, I'm not sure should it be published before this change gets released, or in the release blog post.

@kaicataldo kaicataldo merged commit ecb2b73 into master Jul 31, 2020
@kaicataldo kaicataldo deleted the ruletester-fixable-no-meta branch July 31, 2020 22:47
@kaicataldo
Copy link
Member

Thanks for contributing!

kaicataldo added a commit that referenced this pull request Jul 31, 2020
moeriki added a commit to moeriki/eslint that referenced this pull request Aug 9, 2020
…gnore-default-values

* upstream/master: (66 commits)
  Sponsors: Sync README with website
  Sponsors: Sync README with website
  Sponsors: Sync README with website
  Sponsors: Sync README with website
  Sponsors: Sync README with website
  Chore: remove leche (fixes eslint#13287) (eslint#13533)
  Sponsors: Sync README with website
  Sponsors: Sync README with website
  7.6.0
  Build: changelog update for 7.6.0
  Update: require `meta` for fixable rules in RuleTester (refs eslint#13349) (eslint#13489)
  Docs: fix broken links in developer guide (eslint#13518)
  Fix: Do not output `undefined` as line and column when it's unavailable (eslint#13519)
  Sponsors: Sync README with website
  Sponsors: Sync README with website
  Fix: Update the chatroom link to go directly to help channel (eslint#13536)
  Sponsors: Sync README with website
  Update: Change no-duplicate-case to comparing tokens (fixes eslint#13485) (eslint#13494)
  Docs: add ECMAScript 2020 to README (eslint#13510)
  7.5.0
  ...
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Jan 28, 2021
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Jan 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion core Relates to ESLint's core APIs and features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants