import foo from "bar/foo";
with tslint.json configuration:
{
"defaultSeverity": "error",
"rules": {
"no-implicit-dependencies": [true, "dev"]
}
}
ERROR: /Users/elena/Projects/demo/ts/main.ts[1, 17]: Module 'bar' is not listed as dependency in package.json
{
"compilerOptions": {
"module": "commonjs",
"lib": ["es2017"],
"strict": true,
"baseUrl": "./",
"paths": {
"bar/*":["src/bar/*"]
},
}
}
Rule should be able to look into tsconfig and check if imported module matches one of the paths mapping. I think it can be parametrised behaviour.
Seems to be a duplicate of https://github.com/palantir/tslint/issues/3483 Refer to solution in that thread.
It's not a duplicate, it should automatically white-list everything that is listed in tsconfig paths
Most helpful comment
It's not a duplicate, it should automatically white-list everything that is listed in tsconfig paths