Skip to content

Commit

Permalink
build: fix tslint being unable to type check cross-package references
Browse files Browse the repository at this point in the history
Since we use a `tsconfig.json` for TSLint which does not have any path
mappings, TSlint is unable to use the `ts.TypeChecker` for nodes which
are declared in a separate entry-point or package. This causes custom
TSLint rules such as the `undecorated-base-class-di`  rule to accidentally
ignore issues such as that `MatCheckbox` (from mdc-checkbox) depends on
the undecorated base class `MatMenu`.
  • Loading branch information
devversion authored and mmalerba committed May 23, 2019
1 parent 6cf2dd2 commit 92448bc
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,19 @@
"skipLibCheck": true,
"target": "es2015",
"lib": ["es5", "es2015", "dom"],
"types": ["jasmine"]
"types": ["jasmine"],
"baseUrl": ".",
"paths": {
"@angular/cdk": ["./src/cdk"],
"@angular/cdk/*": ["./src/cdk/*"],
"@angular/material/*": ["./src/material/*"],
"@angular/material-experimental/*": ["./src/material-experimental/*"],
"@angular/material-experimental": ["./src/material-experimental"],
"@angular/cdk-experimental/*": ["./src/cdk-experimental/*"],
"@angular/cdk-experimental": ["./src/cdk-experimental"],
"@angular/material-moment-adapter": ["./src/material-moment-adapter"],
"@angular/material-examples": ["./src/packages/material-examples"]
}
},
"include": [
"src/**/*.ts",
Expand All @@ -33,6 +45,12 @@

// IDEs should not type-check the different node_modules directories of the different packages.
// This would cause the IDEs to be slower and also linters would check the node_modules.
"node_modules/"
"node_modules/",

// Exclude schematic template files and test cases which aren't valid TS files.
"src/material/schematics/ng-generate/*/files/**/*",
"src/cdk/schematics/ng-generate/*/files/**/*",
"src/cdk/schematics/ng-update/test-cases/**/*",
"src/material/schematics/ng-update/test-cases/**/*"
]
}

0 comments on commit 92448bc

Please sign in to comment.