Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Errors present for correct import paths using baseUrl in tsconfig.json. #228

Open
BBaysinger opened this issue Jun 28, 2018 · 0 comments
Open

Comments

@BBaysinger
Copy link

I'm getting errors for paths that are correct, using root relative imports in Angular, via this solution. My linter error looks like:

Cannot find module 'header/header.component'.

My tsconfig.json file:

{
  "compileOnSave": false,
  "compilerOptions": {
    "baseUrl": "app",
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "target": "es5",
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2017",
      "dom"
    ]
  }
}

My src/tsconfig.json file:

{
  "extends": "../tsconfig.json",
  "compilerOptions": {
    "outDir": "../out-tsc/app",
    "module": "es2015",
    "types": [],
    "baseUrl": "app"
  },
  "exclude": [
    "src/test.ts",
    "**/*.spec.ts"
  ]
}

The project compiles fine, and accepts the import paths, but linter-tslint thinks the paths are wrong.

I am using Angular 6.0.3, and TypeScript 2.7.2.

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

No branches or pull requests

1 participant