From ba5fe7b3ee2ae268c4f5e69fb6984af12f3a73fc Mon Sep 17 00:00:00 2001 From: Alan Agius <17563226+alan-agius4@users.noreply.github.com> Date: Tue, 24 Mar 2026 09:03:16 +0000 Subject: [PATCH 1/2] feat(@schematics/angular): rely on strict template default in generated workspaces Since strict templates are now the default in the Angular compiler, this change removes the explicit "strictTemplates": true setting when creating a new strict workspace. We now only explicitly set "strictTemplates": false when the workspace is created with --strict=false to maintain consistent behavior for non-strict setups. See: https://github.com/angular/angular/pull/67802 --- .../angular/workspace/files/tsconfig.json.template | 4 ++-- packages/schematics/angular/workspace/index_spec.ts | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/schematics/angular/workspace/files/tsconfig.json.template b/packages/schematics/angular/workspace/files/tsconfig.json.template index d51e03ac01fe..799cff73365a 100644 --- a/packages/schematics/angular/workspace/files/tsconfig.json.template +++ b/packages/schematics/angular/workspace/files/tsconfig.json.template @@ -18,8 +18,8 @@ "angularCompilerOptions": { "enableI18nLegacyMessageIdFormat": false<% if (strict) { %>, "strictInjectionParameters": true, - "strictInputAccessModifiers": true, - "strictTemplates": true<% } %> + "strictInputAccessModifiers": true<% } else { %>, + "strictTemplates": false<% } %> }, "files": [] } diff --git a/packages/schematics/angular/workspace/index_spec.ts b/packages/schematics/angular/workspace/index_spec.ts index bc7a9366b68b..5eaa3d6408ce 100644 --- a/packages/schematics/angular/workspace/index_spec.ts +++ b/packages/schematics/angular/workspace/index_spec.ts @@ -99,9 +99,9 @@ describe('Workspace Schematic', () => { tree.readContent('tsconfig.json').toString(), ); expect(compilerOptions.strict).toBeUndefined(); - expect( - Object.keys(angularCompilerOptions).filter((option) => option.startsWith('strict')), - ).toEqual([]); + expect(angularCompilerOptions.strictTemplates).toBeFalse(); + expect(angularCompilerOptions.strictInputAccessModifiers).toBeUndefined(); + expect(angularCompilerOptions.strictInjectionParameters).toBeUndefined(); }); it('should add strict compiler options when true', async () => { @@ -112,8 +112,8 @@ describe('Workspace Schematic', () => { const { compilerOptions, angularCompilerOptions } = parseJson( tree.readContent('tsconfig.json').toString(), ); - expect(compilerOptions.strict).toBe(true); - expect(angularCompilerOptions.strictTemplates).toBe(true); + expect(compilerOptions.strict).toBeTrue(); + expect(angularCompilerOptions.strictTemplates).toBeUndefined(); }); it('should add vscode testing configuration', async () => { From 4b8888473a02c0459cb29d3f5a385a5c8124f7d2 Mon Sep 17 00:00:00 2001 From: Alan Agius <17563226+alan-agius4@users.noreply.github.com> Date: Tue, 24 Mar 2026 09:11:15 +0000 Subject: [PATCH 2/2] fixup! feat(@schematics/angular): rely on strict template default in generated workspaces --- packages/schematics/angular/workspace/index_spec.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/schematics/angular/workspace/index_spec.ts b/packages/schematics/angular/workspace/index_spec.ts index 5eaa3d6408ce..7941fbac96cc 100644 --- a/packages/schematics/angular/workspace/index_spec.ts +++ b/packages/schematics/angular/workspace/index_spec.ts @@ -114,6 +114,8 @@ describe('Workspace Schematic', () => { ); expect(compilerOptions.strict).toBeTrue(); expect(angularCompilerOptions.strictTemplates).toBeUndefined(); + expect(angularCompilerOptions.strictInputAccessModifiers).toBeTrue(); + expect(angularCompilerOptions.strictInjectionParameters).toBeTrue(); }); it('should add vscode testing configuration', async () => {