'javascript/typescript - es-lint import/no-unresolved is not working for ts files
I'm working on a project that uses the same code base for various brands. Some imports are done dynamically and are managed by webpack.
We use javascript in one part of the code and typescript in another part.
So we use something like the code below to do the dynamic imports:
import { comp } ../brand/../..
As this import is not found, the es-lint shows the error: Unable to resolve path to module ...
To solve this problem we can do something as simple as 'import/no-unresolved': [2, { ignore: ['brand'] }] on eslintrc file.
This solves the issue for JS files but it doesn't solve for TS files.
We have already installed
"eslint": "7.16.0",
"eslint-plugin-import": "2.22.1",
"@types/react": "17.0.14",
"@typescript-eslint/eslint-plugin": "4.28.4",
"@typescript-eslint/parser": "4.28.4",
"babel-eslint": "10.1.0",
"eslint-plugin-jsx-a11y": "6.4.1",
"eslint-plugin-react": "7.24.0",
"eslint-plugin-react-hooks": "4.2.0"
Any idea how to solve that for TS files ?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
