Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[rule-tester] support multipass fixes #8554

Closed
@bradzacher

Description

@bradzacher

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

Relevant Package

utils

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

eslint/eslint#18007 was rejected as a breaking change enhancement.

Given this impacts us directly (eg #8251) we should build this into our fork.

I propose the following changes:

  1. if the test case has output and the output value is a string and the test case requires more than 1 pass to fix then the test case fails with a message like "test requires multiple fixes to resolve due to overlapping fix ranges - please use the array form of output to declare all of the expected fix passes".
  2. accept an array for output which declares the expected fix passes for a test case.
    • An array of size 0 is disallowed.
    • An array of size 1 is equivalent to the string form.
    • An array of size n asserts that there are exactly n fix passes
    • The rule tester asserts that after each fix pass the output matches the nth element of the array.

Additional Info

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issuebreaking changeThis change will require a new major version to be releasedenhancementNew 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