Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

no-implicit-dependencies should consider paths compiler option #4083

Closed
vilchik-elena opened this issue Jul 31, 2018 · 2 comments
Closed

no-implicit-dependencies should consider paths compiler option #4083

vilchik-elena opened this issue Jul 31, 2018 · 2 comments

Comments

@vilchik-elena
Copy link
Contributor

vilchik-elena commented Jul 31, 2018

Bug Report

  • TSLint version: 5.11.0
  • TypeScript version: 2.9.2
  • Running TSLint via: CLI

TypeScript code being linted

import foo from "bar/foo";

with tslint.json configuration:

{
    "defaultSeverity": "error",
    "rules": {
        "no-implicit-dependencies": [true, "dev"]
    }
}

Actual behavior

ERROR: /Users/elena/Projects/demo/ts/main.ts[1, 17]: Module 'bar' is not listed as dependency in package.json

tsconfig

{
  "compilerOptions": {
    "module": "commonjs", 
    "lib": ["es2017"],
    "strict": true,

    "baseUrl": "./",
    "paths": {
      "bar/*":["src/bar/*"]
    },   
  }
}

Expected behavior

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.

@jeznag
Copy link

jeznag commented Aug 9, 2018

Seems to be a duplicate of #3483 Refer to solution in that thread.

@qialex
Copy link

qialex commented Feb 12, 2020

It's not a duplicate, it should automatically white-list everything that is listed in tsconfig paths

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants