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

Enhancement(rule-tester): assert suggestion messages are unique #8969

Closed
4 tasks done
JoshuaKGoldberg opened this issue Apr 22, 2024 · 1 comment
Closed
4 tasks done
Labels
accepting prs Go ahead, send a pull request that resolves this issue enhancement New feature or request package: rule-tester Issues related to the @typescript-eslint/rule-tester package
Milestone

Comments

@JoshuaKGoldberg
Copy link
Member

JoshuaKGoldberg commented Apr 22, 2024

Before You File a Proposal Please Confirm You Have Done The Following...

Relevant Package

rule-tester

My proposal is suitable for this project

  • I believe my proposal would be useful to the broader TypeScript community (meaning it is not a niche proposal).

Description

From #8211: there are quite a few enhancements to the ESLint RuleTester that we'll need to reflect in our own rule-tester class.

  • Rule Tester checks for missing placeholder data in the message
  • Stricter rule test validations
  • detect duplicate test cases
  • check for parsing errors in suggestion fixes
  • assert suggestion messages are unique in rule testers

Per the discussion in that thread, we'd like to not treat this as a breaking change:

TBH I'm actually okay with us updating @typescript-eslint/rule-tester with these changes. Yes it will cause errors in tests for people - but they're all correct errors that should have been caught previously. I think it's okay treating it the same as a lint rule i.e. "A change to the plugins shall not be considered breaking if it: ... Adds additional checks to an existing rule that causes new reports in a small-to-medium set of cases in an average codebase".

...so unless someone protests, we'll merge this into the main branch rather than v8.

Additional Info

Adding to the v8 milestone as it's required for ESLint 9 support, even though we'd like to land this sooner.

💖

@JoshuaKGoldberg JoshuaKGoldberg added enhancement New feature or request accepting prs Go ahead, send a pull request that resolves this issue package: rule-tester Issues related to the @typescript-eslint/rule-tester package labels Apr 22, 2024
@JoshuaKGoldberg JoshuaKGoldberg added this to the 8.0.0 milestone Apr 22, 2024
@JoshuaKGoldberg JoshuaKGoldberg changed the title Enhancement(rule-tester): Update RuleTester for new features in ESLint 9 Enhancement(rule-tester): assert suggestion messages are unique Apr 28, 2024
@JoshuaKGoldberg
Copy link
Member Author

For the sake of easier tracking, retargeting this issue to be specifically about the first of the changes (assert suggestion messages are unique). Filing new issues for the rest of them.

#8995 was merged into main, so marking this as fixed by #8995.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepting prs Go ahead, send a pull request that resolves this issue enhancement New feature or request package: rule-tester Issues related to the @typescript-eslint/rule-tester package
Projects
None yet
Development

No branches or pull requests

1 participant