Skip to content
This repository was archived by the owner on Aug 7, 2023. It is now read-only.
This repository was 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

@BBaysinger

Description

@BBaysinger

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions