You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This one is a rabbit hole. The problem is similar to import-js/eslint-plugin-import#2301, but is more localized to typescript-eslint-language-service.
I've got a monorepo project set up with yarn workspaces. Inside one of the workspaces is a Typescript project with ESLint (based on Vite). This project is configured to use typescript-eslint-language-service while ESLint is configured to use eslint-import-plugin. We are using a path/alias configuration to avoid relative imports, so that src/* imports are mapped to the src directory. This configuration is added to both tsconfig.json (compilerOptions.path) and also to vite.config.ts (which is probably irrelevant to this issue, since ESLint doesn't normally read this setting).
My editor configuration is using typescript-language-server, which runs tsserver which in turn runs typescript-eslint-language-service.
Now the actual problem: standalone tsc has no problem building the project, standalone ESLint does not find any problems in the codebase either, so we can presume it's clean from both TypeScript and ESLint point of view. However, eslint-import-plugin running inside typescript-eslint-language-service inside tsserver started by typescript-language-server started from my editor cannot resolve src/MyModule, while it can resolve every third-party module from package.json.
I can resolve this problem in the editor by setting a eslint-import-resolver-typescript project configuration:
but this breaks ESLint's import resolution from the console.
So I've got a lot of moving parts and basically no idea anymore what I could do differently. I'm not sure this is a bug, possibly a configuration error. Any idea what could be wrong?
The text was updated successfully, but these errors were encountered:
This one is a rabbit hole. The problem is similar to import-js/eslint-plugin-import#2301, but is more localized to
typescript-eslint-language-service
.I've got a monorepo project set up with
yarn
workspaces. Inside one of the workspaces is a Typescript project with ESLint (based on Vite). This project is configured to usetypescript-eslint-language-service
while ESLint is configured to useeslint-import-plugin
. We are using a path/alias configuration to avoid relative imports, so thatsrc/*
imports are mapped to thesrc
directory. This configuration is added to bothtsconfig.json
(compilerOptions.path
) and also tovite.config.ts
(which is probably irrelevant to this issue, since ESLint doesn't normally read this setting).My editor configuration is using
typescript-language-server
, which runstsserver
which in turn runstypescript-eslint-language-service
.Now the actual problem: standalone
tsc
has no problem building the project, standalone ESLint does not find any problems in the codebase either, so we can presume it's clean from both TypeScript and ESLint point of view. However,eslint-import-plugin
running insidetypescript-eslint-language-service
insidetsserver
started bytypescript-language-server
started from my editor cannot resolvesrc/MyModule
, while it can resolve every third-party module frompackage.json
.I can resolve this problem in the editor by setting a
eslint-import-resolver-typescript
project configuration:but this breaks ESLint's import resolution from the console.
So I've got a lot of moving parts and basically no idea anymore what I could do differently. I'm not sure this is a bug, possibly a configuration error. Any idea what could be wrong?
The text was updated successfully, but these errors were encountered: