Skip to content

Change Request: make rule-tester stricter #18960

Open
@aladdin-add

Description

ESLint version

HEAD/v9.10.0

What problem do you want to solve?

test current behavior proposed behavior
valid: [{code: "", errors: [{message: "xxx"}]}] ❌ Valid test cases should not have an 'errors' property".
invalid: [{code: "", errors: [{}]}] ❌ Test error must specify either a 'messageId' or 'message'.
invalid: [{code: "", errors: [{message: "xxx", suggestions: null}]}] ❌ Test error object property 'suggestions' should be an array or a number.
valid: [{code: "foo"}], invalid: [{code: "foo", errors: 1}] ❌ detected duplicate test case
....

What do you think is the correct solution?

explained above.

Question: should this be a breaking change? or a normal bugfix(can be shipped in eslint v9)?

Participation

  • I am willing to submit a pull request for this change.

Additional comments

I had a wip https://github.com/aladdin-add/eslint/tree/issue13434-0

there may be more edge cases, opened the issue to track all these cases.🤓

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

breakingThis change is backwards-incompatiblecoreRelates to ESLint's core APIs and featuresenhancementThis change enhances an existing feature of ESLint

Projects

  • Status

    Feedback Needed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions