Skip to content

Commit 4cf3517

Browse files
committed
unusedStandaloneImports is a warning during dev #11812
Production builds will keep erroring with `unusedStandaloneImports` (so CI will fail). But dev and test builds, will only emit a warning. This make it easier to develop and add/remove components temporarily.
1 parent ac0c075 commit 4cf3517

3 files changed

Lines changed: 15 additions & 1 deletion

File tree

‎angular.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
},
5555
"configurations": {
5656
"production": {
57+
"tsConfig": "client/tsconfig.app.prod.json",
5758
"define": {
5859
"globalThis.__DEV__": "false"
5960
},

‎client/tsconfig.app.prod.json‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"extends": "./tsconfig.app.json",
3+
"angularCompilerOptions": {
4+
"extendedDiagnostics": {
5+
"checks": {
6+
"unusedStandaloneImports": "error"
7+
}
8+
}
9+
}
10+
}

‎tsconfig.json‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@
2828
// Remove this when https://github.com/angular/angular/issues/37619 is fixed
2929
"strictSafeNavigationTypes": false,
3030
"extendedDiagnostics": {
31-
"defaultCategory": "error"
31+
"defaultCategory": "error",
32+
"checks": {
33+
"unusedStandaloneImports": "warning"
34+
}
3235
}
3336
},
3437
// Otherwise, eslint parses our temp files and crashes, see https://github.com/typescript-eslint/typescript-eslint/issues/1192

0 commit comments

Comments
 (0)