Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Description
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
I have identified two issues with project services.
- If the default project's
tsconfig.jsonhas anextends, to say atsconfig.base.jsonwith a common set of compiler options, those compiler options are not used. The example repo is a monorepo with liberal use of project references. An example published package that uses a similar setup ishttps://github.com/Effect-TS/effect. - Fixing or working around the first issue (both are demonstrated in the example), reveals that
parserOptions.extraFileExtensionsis not working as expected to setuptsserverfor type checking using project references with non-standard file extensions. The example demonstrates how.vuefiles are not type checking correctly.
I have created a basicpatch that solves both issues (minus rigorous testing).
The first issue is triggered bytsserver.readConfigFile at
typescript-eslint/packages/typescript-estree/src/create-program/createProjectService.ts
Line 74 in5ca7f6e
| configRead=tsserver.readConfigFile( |
Replacing withtsserver.getParsedCommandLineOfConfigFile solves the extends issue. This was pretty much lifted from
typescript-eslint/packages/typescript-estree/src/create-program/useProvidedPrograms.ts
Line 66 in5ca7f6e
| constparsed=ts.getParsedCommandLineOfConfigFile( |
Fixing this issue will reveal the second issue with file extensions. The patch corrects this by forwardingextraFileExtensions totsserver usingservice.setHostConfiguration.
Reproduction Repository Link
https://github.com/higherorderfunctor/example-typescript-eslint-bug
Repro Steps
Directions are located in the example repo'sREADME.
The repo has a patch to fix the bugs (enabled by default) and needs to disabled to demonstrate the bugs.
Versions
node --versionv20.12.2pnpm --version8.15.5pnpm list -rLegend: production dependency, optional only, dev onlyexample-typescript-eslint-bug@1.0.0 <REDACTED>/example-typescript-eslint-bug (PRIVATE)devDependencies:eslint 8.57.0eslint-plugin-vue 9.26.0typescript 5.4.5typescript-eslint 7.11.0vue-eslint-parser 9.4.3vue-tsc 2.0.19package-a@1.0.0 <REDACTED>/example-typescript-eslint-bug/packages/package-a (PRIVATE)dependencies:@types/jsdom 21.1.7@types/node 20.13.0vite 5.2.12vue 3.4.27cat /etc/os-releaseANSI_COLOR="1;34"BUG_REPORT_URL="https://github.com/NixOS/nixpkgs/issues"BUILD_ID="24.11.20240529.ad57eef"DOCUMENTATION_URL="https://nixos.org/learn.html"HOME_URL="https://nixos.org/"ID=nixosIMAGE_ID=""IMAGE_VERSION=""LOGO="nix-snowflake"NAME=NixOSPRETTY_NAME="NixOS 24.11 (Vicuña)"SUPPORT_URL="https://nixos.org/community.html"VERSION="24.11 (Vicuña)"VERSION_CODENAME="vicuña"VERSION_ID="24.11"