From 92448bcc283597ac4d29b8a4259ad47e85052842 Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Thu, 23 May 2019 16:53:43 +0200 Subject: [PATCH] build: fix tslint being unable to type check cross-package references 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`. --- tsconfig.json | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index 6c6570c721fa..1f0b79175a40 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -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", @@ -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/**/*" ] }