Closed
Description
I have two projects, project-a
and project-b
, one importing the other via a paths
synonym defined in tsconfig.base.json
. Although the TypeScript compiler knows how to resolve the import, this plugin is complaining that it cannot resolve the path.
I've read the documentation of both this plugin and the TypeScript resolver plugin, and I think I configured everything right, but with no luck. Is there something wrong with my setup?
Minimal repro:
- clone https://github.com/SimonCockx/eslint-import-bug
cd ./eslint-import-bug
npm install
npx eslint project-a/src/index.ts
Snippets:
tsconfig.base.ts
"compilerOptions": {
"paths": {
"@importbug/b": ["project-b/src/index.ts"]
},
...
}
project-a/.eslintrc.json
{
"plugins": [
"@typescript-eslint",
"import"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": ["project-a/tsconfig.json"],
"sourceType": "module"
},
"settings": {
"import/resolver": {
"typescript": {
"alwaysTryTypes": true,
"project": "tsconfig.json",
"extensions": [".ts"]
}
},
"import/parsers": {
"@typescript-eslint/parser": [
".ts", ".tsx"
]
}
},
"extends": [
"plugin:import/typescript", "plugin:import/recommended"
]
}
project-a/src/index.ts
import { b } from "@importbug/b";
^^^^^^^^^^^
b;
Metadata
Metadata
Assignees
Labels
No labels