Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Situation
Tests in the tests/lib/rules which run internally under ESLint
7.x
and8.x
are not compatible with ESLint9.x
.The guide Migrate to 9.0 > FlatRuleTester is now RuleTester explains:
This is a breaking change for the tests.
Goal
The enhancement goal is to be able to test the repo rules using each of the supported versions of ESLint:
7.x
,8.x
and9.x
.Migration steps
Achieving the goal requires separating the tests into a legacy copy, for use with the
RuleTester
class of ESLint7.x
and8.x
, and another copy which will be migrated to use theRuleTester
of ESLint9.x
.The migration is done in two steps:
RuleTester
class in ESLint9.x
. (This PR.)Changes
This PR deals with the second step of modifying the current copy of tests for compatibility with the new
RuleTester
class in ESLint9.x
.For all tests/lib/rules
*.js
test files:ChangeRemove unnecessaryparserOptions
to. Edit: See chore: migrate to RuleTester v9 #207 (comment)languageOptions
v9
RuleTester
and it is attempting to test a function of ESLint rather than the rule itself.For the CircleCI workflow
9.x
to use the modified current tests.References