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

Enhancement: Confusing error message when file is linted but not inparserOptions.project TSConfig #11797

Open
Labels
enhancementNew feature or requesttriageWaiting for team members to take a look
@jwbth

Description

@jwbth

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

Relevant Package

typescript-estree

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

The current error message for files that ESLint attempts to lint but aren't included in any TSConfig is confusing and seemingly contradictory:

Parsing error: ESLint was configured to run on `<tsconfigRootDir>/sandbox\test.mjs` using `parserOptions.project`:- <tsconfigRootDir>/jsconfig.json- <tsconfigRootDir>/src\jsconfig.json...However, none of those TSConfigs include this file.

Problem

The phrase "ESLint was configured to run on [file] usingparserOptions.project" is confusing because it sounds like the user explicitly configured ESLint to lint this file with those specific TSConfigs. In reality:

  1. ESLint's file inclusion rules determined the file should be linted
  2. TheparserOptions.project setting exists globally
  3. None of the TSConfigs actually cover this file

This creates an apparent contradiction: "configured to run using X" followed by "but X doesn't include this file" makes it sound like the configuration is broken or nonsensical.

Solution

Consider rewording to make the two-step process clearer:

Parsing error: ESLint is attempting to lint `<tsconfigRootDir>/sandbox\test.mjs`, but this file is not included in any of the TSConfigs specified in `parserOptions.project`:- <tsconfigRootDir>/jsconfig.json- <tsconfigRootDir>/src\jsconfig.json...Either:- Exclude this file from linting (add it to `ignores`)- Add this file's location to one of the TSConfig's `include` patterns- Create a new TSConfig that includes this file and add it to `parserOptions.project`- Use a separate ESLint configuration for this file without type-aware lintingSee the typescript-eslint docs for more info: https://typescript-eslint.io/troubleshooting/typed-linting#i-get-errors-telling-me-eslint-was-configured-to-run--however-that-tsconfig-does-not--none-of-those-tsconfigs-include-this-file

This makes it clear that:

  1. ESLint wants to lint the file (for reasons separate fromparserOptions.project)
  2. The type-checking feature requires TSConfig coverage
  3. There's a mismatch between these two things

Additional Info

Relevant file:https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/typescript-estree/src/create-program/createProjectProgramError.ts

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesttriageWaiting for team members to take a look

    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