-
-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to resolve path to module eslint(import/no-unresolved) when using "paths" in tsconfig.json #71
Comments
We need online runnable reproduction, use a git repo instead please. |
@JounQin alright:
|
Should be related to tsconfig-paths You can add a |
Yep, that did it. Thank you, @JounQin. Adding
in the .eslintrc file. (Your gitpod.io link doesn't work for me, but the fix is simple enough.) |
If anyone else encounters the same issue, in my case I'm using a .eslintrc.js file and simply having ie: settings: {
'import/resolver': {
typescript: {
alwaysTryTypes: true,
project: path.resolve(__dirname, 'tsconfig.json'),
},
},
}, |
I have a simple project in a ClientApp/ folder.
In it, I have tsconfig.json, .eslintrc, package.json and a /src/components folder containing my ts/tsx files.
I want to use the "paths" config in tsconfig so that I can simplify/shorten my imports.
However, I always get the same "import/no-unresolved" error message: Unable to resolve path to module 'common'.eslint(import/no-unresolved)
Any idea on whether this is a bug or I'm doing something wrong?
Sample Project:
sample-unresolved.zip
Sample Code:
tsconfig.json:
.eslintrc
packages.json
App.tsx (this is the problematic import)
In my VSCode settings file for that project:
The text was updated successfully, but these errors were encountered: