Skip to content

Bug: tsconfig.json not respected in new files when multiple tsconfigs include the same directory with projectService enabled #8835

Open
@fire332

Description

@fire332

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 have searched for related issues and found none that matched my issue.
  • I have read the FAQ and my problem is not listed.

Issue Description

When EXPERIMENTAL_useProjectService: true and at least two tsconfig.jsons include a non-empty common directory, typescript-eslint will not respect tsconfig.json for new/renamed files until ESLint is reloaded.

Possibly related: #8206 #7435

Reproduction Repository Link

https://github.com/fire332/typescript-eslint-bug-repro/

Repro Steps

  1. clone the repo
  2. pnpm install
  3. open project in VSCode with the ESLint extension installed
  4. IMPORTANT: open .prettierrc.js or eslint.config.js and wait for ESLint to initialize
  5. create a new .ts file in ./src or ./src-alt
  6. problems reported will show:
This rule requires the `strictNullChecks` compiler option to be turned on to function correctly. eslint(@typescript-eslint/no-unnecessary-condition)
  1. run Developer: Reload Window from the command palette
  2. check the file you created and note there's no problems reported
  3. rename the file and note that the same problem will be reported again

Versions

package version
typescript-eslint 7.5.0
TypeScript 5.4.3
ESLint 8.57.0
node >=20.11.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingevaluating community engagementwe're looking for community engagement on this issue to show that this problem is widely important

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions