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: more informatively explain when tsconfigRootDir doesn't include the cwd #6883

Open
Labels
accepting prsGo ahead, send a pull request that resolves this issuebugSomething isn't workingpackage: typescript-estreeIssues related to @typescript-eslint/typescript-estree
@artola

Description

@artola

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

typescript-estree

Playground Link

No response

Repro Code

The logic ingetProjectConfigFiles compares the length ofparseSettings.filePath (dirname) andparseSettings.tsconfigRootDir to stop looking for the config.

But whentsconfigRootDir is not set in the.eslintrc.js config, they can be totally different paths, for example, depending where VSCode was installed (value used fortsconfigRootDir) for tooling.

Then, it is correct to stop looking for config "only" if theparseSettings.filePath starts withtsconfigRootDir, otherwise just keep looking up to the root.

directory.length>=parseSettings.tsconfigRootDir.length

ESLint Config

module.exports={parser:"@typescript-eslint/parser",rules:{"@typescript-eslint/<rule-name>":["error", ...<options>],},parserOptions:{project:true}};

tsconfig

{"compilerOptions": {// ...  }}

Expected Result

The config file should be found.

Actual Result

The config file is not found because it stops prematurely.

Additional Info

No response

Versions

packageversion
@typescript-eslint/eslint-plugin5.58.0
@typescript-eslint/parser5.58.0
@typescript-eslint/scope-manager5.58.0
@typescript-eslint/typescript-estree5.58.0
@typescript-eslint/type-utils5.58.0
@typescript-eslint/utils5.58.0
TypeScript5.0.4
ESLint8.38.0
node18.14.1

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp