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: Confusing error when unknown parser used with getParserServices(context, true) in flat config #8891

Open
Labels
accepting prsGo ahead, send a pull request that resolves this issuebugSomething isn't workingpackage: utilsIssues related to the @typescript-eslint/utils package
@JoshuaKGoldberg

Description

@JoshuaKGoldberg

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.

Relevant Package

utils

Playground Link

No response

Repro Code

{}

ESLint Config

import*asparserJsoncfrom"jsonc-eslint-parser";importtseslintfrom"typescript-eslint";exportdefaulttseslint.config(tseslint.configs.base,{files:["**/package.json"],languageOptions:{parser:parserJsonc}},{languageOptions:{parserOptions:{project:true,},},rules:{"@typescript-eslint/consistent-type-assertions":"error"}},);

tsconfig

n/a

Expected Result

getParserServices should give a complaint saying that the parser is some other one, not@typescript-eslint/parser.

Actual Result

> eslint package.jsonOops! Something went wrong! :(ESLint: 8.57.0Error: Error while loading rule '@typescript-eslint/consistent-type-assertions': You have used a rule which requires parserServices to be generated. You must therefore provide a value for the "parserOptions.project" property for @typescript-eslint/parser.Parser: undefinedNote: detected a parser other than @typescript-eslint/parser. Make sure the parser is configured to forward "parserOptions.project" to @typescript-eslint/parser.Occurred while linting /Users/josh/repos/repros/package.json    at throwError (/Users/josh/repos/repros/node_modules/@typescript-eslint/utils/dist/eslint-utils/getParserServices.js:40:11)    at getParserServices (/Users/josh/repos/repros/node_modules/@typescript-eslint/utils/dist/eslint-utils/getParserServices.js:20:9)    at create (/Users/josh/repos/repros/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-assertions.js:88:61)    at Object.create (/Users/josh/repos/repros/node_modules/@typescript-eslint/utils/dist/eslint-utils/RuleCreator.js:38:20)    at createRuleListeners (/Users/josh/repos/repros/node_modules/eslint/lib/linter/linter.js:895:21)    at /Users/josh/repos/repros/node_modules/eslint/lib/linter/linter.js:1066:110    at Array.forEach (<anonymous>)    at runRules (/Users/josh/repos/repros/node_modules/eslint/lib/linter/linter.js:1003:34)    at Linter._verifyWithFlatConfigArrayAndWithoutProcessors (/Users/josh/repos/repros/node_modules/eslint/lib/linter/linter.js:1730:31)    at Linter._verifyWithFlatConfigArray (/Users/josh/repos/repros/node_modules/eslint/lib/linter/linter.js:1861:21)

Additional Info

See isolated repro:https://github.com/JoshuaKGoldberg/repros/tree/ts-eslint-unknown-parser-flat-config

Versions

packageversion
typescript-eslint7.6.0
ESLint8.57.0

😩

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issuebugSomething isn't workingpackage: utilsIssues related to the @typescript-eslint/utils package

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp