Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Bug:RuleTester: cannot read properties ofundefined (reading'parse' ) #10191

Closed
Labels
accepting prsGo ahead, send a pull request that resolves this issuebugSomething isn't workinglocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.
@jeremybanka

Description

@jeremybanka

Before You File a Bug Report Please Confirm You Have Done The Following...

  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I havesearched for related issues and found none that matched my issue.
  • I haveread the FAQ and my problem is not listed.

Issue Description

RuleTester is no longer able to function in any test case I have been able to find, always throwing a type error before handling the test case.

Looking into the issue, it seems to stem from providedConfig always being undefined. I suspect the issue was introduced by#10147 .

At some point, a property is accessed and we get the TypeError given in the title. In detail, it looks like

 FAIL  lint.test.ts > only-ever-use-literal-number-type > valid > type is numberError: Caught an error while linting ❯ Linter.RuleTester.#linter.linter.verify node_modules/@typescript-eslint/rule-tester/src/RuleTester.ts:204:17 ❯ RuleTester.runRuleForItem node_modules/@typescript-eslint/rule-tester/src/RuleTester.ts:770:33 ❯ RuleTester.#testValidTemplate node_modules/@typescript-eslint/rule-tester/src/RuleTester.ts:863:25 ❯ node_modules/@typescript-eslint/rule-tester/src/RuleTester.ts:541:40Caused by: TypeError: Cannot read properties of undefined (reading 'parse') ❯ ParserService.parseSync node_modules/eslint/lib/services/parser-service.js:36:33 ❯ Linter.#flatVerifyWithoutProcessors node_modules/eslint/lib/linter/linter.js:1680:47 ❯ Linter._verifyWithFlatConfigArrayAndWithoutProcessors node_modules/eslint/lib/linter/linter.js:1992:49 ❯ Linter._verifyWithFlatConfigArray node_modules/eslint/lib/linter/linter.js:2081:21 ❯ Linter.verify node_modules/eslint/lib/linter/linter.js:1528:61 ❯ Linter.RuleTester.#linter.linter.verify node_modules/@typescript-eslint/rule-tester/src/RuleTester.ts:202:18 ❯ RuleTester.runRuleForItem node_modules/@typescript-eslint/rule-tester/src/RuleTester.ts:770:33 ❯ RuleTester.#testValidTemplate node_modules/@typescript-eslint/rule-tester/src/RuleTester.ts:863:25 ❯ node_modules/@typescript-eslint/rule-tester/src/RuleTester.ts:541:40

Reproduction Repository Link

https://github.com/jeremybanka/tseslint-parsing-bug

Repro Steps

# 1. clone the repogit clone https://github.com/jeremybanka/tseslint-parsing-bug.git# 2. install dependenciesnpm install# 3. run testsnpmtest

You will see the error shown above.

To verify that it does not occur with the previous version8.10.0, simply revert my most recent commit:

# 1. go back one commit without leaving any staged changesgit reset --hard HEAD^# 2. reinstall depsnpm install# 3. rerun testsnpmtest

Versions

packageversion
@typescript-eslint/eslint-plugin8.11.0
@typescript-eslint/parser8.11.0
@typescript-eslint/rule-tester8.11.0
TypeScript5.6.3
ESLint9.13.0
node22.10.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issuebugSomething isn't workinglocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp