Skip to content

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

@JoshuaKGoldberg

Description

@JoshuaKGoldberg

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.

💖

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issueenhancementNew feature or requestlocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.package: rule-testerIssues related to the @typescript-eslint/rule-tester package

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions