Closed
Description
This is a difficult one to describe but here is a failing test: OliverJAsh@e26fed2
Essentially the issue occurs when we import using a path that is relative to the baseUrl
, e.g. given:
tests/withPaths2/tsconfig.json
:
{
"compilerOptions": {
"baseUrl": "root/",
"paths": {
"other/*": ["../other/*"]
}
},
"files": ["root/foo.ts", "other/bar.ts"]
}
tests/withPaths2/root/foo.ts
:
// import using tsconfig.json path mapping
import 'other/bar'
tests/withPaths2/other/bar.ts
:
// import using tsconfig.json `baseUrl`
// This one fails ❌
import 'foo'
This fails with the following error:
/Users/oliverash/Development/eslint-import-resolver-typescript/tests/withPaths2/other/bar.ts
2:8 error Unable to resolve path to module 'foo' import/no-unresolved
This is a valid import—TypeScript understands it so I think this resolver should also understand it.
Metadata
Metadata
Assignees
Labels
No labels