Skip to content

Commit f3d9ef6

Browse files
committed
refactor(@schematics/angular): remove explicit strict true in tsconfig template for TS6 compatibility
TypeScript 6 enables strict mode by default. This change updates the workspace schematic's `tsconfig.json` template to omit `"strict": true` when strict mode is desired (relying on the default), and explicitly sets `"strict": false` when it is disabled.
1 parent a0487d9 commit f3d9ef6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/schematics/angular/workspace/files/tsconfig.json.template

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
{
44
"compileOnSave": false,
55
"compilerOptions": {<% if (strict) { %>
6-
"strict": true,
76
"noImplicitOverride": true,
87
"noPropertyAccessFromIndexSignature": true,
98
"noImplicitReturns": true,
10-
"noFallthroughCasesInSwitch": true,<% } %>
9+
"noFallthroughCasesInSwitch": true,<% } else { %>
10+
"strict": false,<% } %>
1111
"skipLibCheck": true,
1212
"isolatedModules": true,
1313
"experimentalDecorators": true,

packages/schematics/angular/workspace/index_spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ describe('Workspace Schematic', () => {
9898
const { compilerOptions, angularCompilerOptions } = parseJson(
9999
tree.readContent('tsconfig.json').toString(),
100100
);
101-
expect(compilerOptions.strict).toBeUndefined();
101+
expect(compilerOptions.strict).toBeFalse();
102102
expect(angularCompilerOptions.strictTemplates).toBeFalse();
103103
expect(angularCompilerOptions.strictInputAccessModifiers).toBeUndefined();
104104
expect(angularCompilerOptions.strictInjectionParameters).toBeUndefined();
@@ -112,7 +112,7 @@ describe('Workspace Schematic', () => {
112112
const { compilerOptions, angularCompilerOptions } = parseJson(
113113
tree.readContent('tsconfig.json').toString(),
114114
);
115-
expect(compilerOptions.strict).toBeTrue();
115+
expect(compilerOptions.strict).toBeUndefined();
116116
expect(angularCompilerOptions.strictTemplates).toBeUndefined();
117117
expect(angularCompilerOptions.strictInputAccessModifiers).toBeTrue();
118118
expect(angularCompilerOptions.strictInjectionParameters).toBeTrue();

0 commit comments

Comments
 (0)