Skip to content

Bug: v8 RuleTester crashes on ESLint >=9.5.0 #9676

Closed
@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

When I set up a very standard usage of @typescript-eslint/rule-tester@8.0.0-alpha.59 with eslint@9.5.0 in Vitest, test runs crash with:

 FAIL  src/no-loop-over-enum.test.ts > no-loop-over-enum > invalid >
          enum Values { value }
          for (const a in Values) {}

TypeError: Cannot read properties of undefined (reading 'parse')
 ❯ parse node_modules/eslint/lib/linter/linter.js:906:29
 ❯ Linter._verifyWithFlatConfigArrayAndWithoutProcessors node_modules/eslint/lib/linter/linter.js:1660:33
 ❯ Linter._verifyWithFlatConfigArray node_modules/eslint/lib/linter/linter.js:2017:21
 ❯ Linter.verify node_modules/eslint/lib/linter/linter.js:1492:61
 ❯ RuleTester.runRuleForItem node_modules/@typescript-eslint/rule-tester/src/RuleTester.ts:710:33
 ❯ RuleTester.#testInvalidTemplate node_modules/@typescript-eslint/rule-tester/src/RuleTester.ts:862:25
 ❯ node_modules/@typescript-eslint/rule-tester/src/RuleTester.ts:513:40

This does not reproduce with eslint@9.4.0.

Full repro on: https://github.com/JoshuaKGoldberg/repros/tree/repro-rule-tester-eslint-parse-error

Additional Info

No response

Metadata

Metadata

Labels

bugSomething isn't workinglocked 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 packageteam assignedA member of the typescript-eslint team should work on this.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions