From dab363011c04806030243b189101774d47c061fb Mon Sep 17 00:00:00 2001 From: Kristiyan Kostadinov Date: Sun, 23 Aug 2026 14:37:43 +0200 Subject: [PATCH] build: enable stableTypeOrdering tsconfig flag `stableTypeOrdering` was recently enabled in the internal builds. While there aren't any breakages in Angular, these changes enable it so we can catch potential issues earlier. (cherry picked from commit c18261f3fd87f70a0c8cce16c64c9bd38d16e6c7) --- dev-app/tsconfig.json | 1 + goldens/public-api/common/index.api.md | 2 +- goldens/public-api/core/index.api.md | 2 +- modules/tsconfig.json | 7 ++----- .../language-service/test/legacy/project/tsconfig.json | 10 +++------- packages/tsconfig-build.json | 7 ++++--- packages/tsconfig.json | 1 + packages/zone.js/test/typings/tsconfig.json | 1 + packages/zone.js/tsconfig.json | 1 + vscode-ng-language-service/tsconfig.json | 1 + 10 files changed, 16 insertions(+), 17 deletions(-) diff --git a/dev-app/tsconfig.json b/dev-app/tsconfig.json index 71d83035d54..870328cabf1 100644 --- a/dev-app/tsconfig.json +++ b/dev-app/tsconfig.json @@ -1,6 +1,7 @@ { "compileOnSave": false, "compilerOptions": { + "stableTypeOrdering": true, "strict": true, "noImplicitOverride": true, "noPropertyAccessFromIndexSignature": true, diff --git a/goldens/public-api/common/index.api.md b/goldens/public-api/common/index.api.md index 4a5a43b7a27..f589acbe28b 100644 --- a/goldens/public-api/common/index.api.md +++ b/goldens/public-api/common/index.api.md @@ -1042,7 +1042,7 @@ export abstract class ViewportScroller { abstract setHistoryScrollRestoration(scrollRestoration: 'auto' | 'manual'): void; abstract setOffset(offset: [number, number] | (() => [number, number])): void; // (undocumented) - static ɵprov: i0.ɵɵInjectableDeclaration; + static ɵprov: i0.ɵɵInjectableDeclaration; } // @public @deprecated diff --git a/goldens/public-api/core/index.api.md b/goldens/public-api/core/index.api.md index d1002e1ec71..a529c1a3471 100644 --- a/goldens/public-api/core/index.api.md +++ b/goldens/public-api/core/index.api.md @@ -80,7 +80,7 @@ export interface AfterViewInit { } // @public -export const ANIMATION_MODULE_TYPE: InjectionToken<"NoopAnimations" | "BrowserAnimations">; +export const ANIMATION_MODULE_TYPE: InjectionToken<"BrowserAnimations" | "NoopAnimations">; // @public export type AnimationCallbackEvent = { diff --git a/modules/tsconfig.json b/modules/tsconfig.json index 2a4d54e4ad5..e4378b0e97b 100644 --- a/modules/tsconfig.json +++ b/modules/tsconfig.json @@ -8,6 +8,7 @@ "moduleResolution": "node", "outDir": "../dist/all/", "noImplicitAny": true, + "stableTypeOrdering": true, "noFallthroughCasesInSwitch": true, "paths": { "selenium-webdriver": ["../node_modules/@types/selenium-webdriver/index.d.ts"], @@ -22,11 +23,7 @@ "target": "es5", "types": ["angular"] }, - "exclude": [ - "payload_tests", - "playground/", - "benchmarks/" - ], + "exclude": ["payload_tests", "playground/", "benchmarks/"], "angularCompilerOptions": { "strictTemplates": true, "skipTemplateCodegen": true diff --git a/packages/language-service/test/legacy/project/tsconfig.json b/packages/language-service/test/legacy/project/tsconfig.json index 36d6c348cf6..84942609822 100644 --- a/packages/language-service/test/legacy/project/tsconfig.json +++ b/packages/language-service/test/legacy/project/tsconfig.json @@ -1,19 +1,15 @@ { "//00": "This file is used for both IDE and the actual Project creation in Ivy language service for testing purpose", "compilerOptions": { - "lib": [ - "es2015", - "dom" - ], + "stableTypeOrdering": true, + "lib": ["es2015", "dom"], "strict": true, "experimentalDecorators": true, "moduleResolution": "node", "target": "es2015", "baseUrl": "../../../../../", "paths": { - "@angular/*": [ - "packages/*" - ] + "@angular/*": ["packages/*"] } }, "angularCompilerOptions": { diff --git a/packages/tsconfig-build.json b/packages/tsconfig-build.json index ea0e84bc1e4..2325a6ec145 100644 --- a/packages/tsconfig-build.json +++ b/packages/tsconfig-build.json @@ -10,6 +10,7 @@ "noImplicitAny": true, "noImplicitOverride": true, "strictNullChecks": true, + "stableTypeOrdering": true, "noImplicitReturns": true, "noPropertyAccessFromIndexSignature": true, "esModuleInterop": true, @@ -36,9 +37,9 @@ "@angular/common/locales/*": ["./common/locales/*"], "@angular/compiler-cli": ["./compiler-cli"], "@angular/compiler-cli/*": ["./compiler-cli/*"], - "@angular/compiler-cli/src/ngtsc/reflection": ["./compiler-cli/src/ngtsc/reflection/index"], - "@angular/compiler-cli/src/ngtsc/metadata": ["./compiler-cli/src/ngtsc/metadata/index"], - "@angular/compiler-cli/private/migrations": ["./compiler-cli/private/migrations"], + "@angular/compiler-cli/src/ngtsc/reflection": ["./compiler-cli/src/ngtsc/reflection/index"], + "@angular/compiler-cli/src/ngtsc/metadata": ["./compiler-cli/src/ngtsc/metadata/index"], + "@angular/compiler-cli/private/migrations": ["./compiler-cli/private/migrations"], "@angular/core/schematics/utils/tsurge/*": ["./core/schematics/utils/tsurge/*"] } }, diff --git a/packages/tsconfig.json b/packages/tsconfig.json index 46955a117ca..f3cb6b081ca 100644 --- a/packages/tsconfig.json +++ b/packages/tsconfig.json @@ -13,6 +13,7 @@ "moduleResolution": "node", "esModuleInterop": true, "strictNullChecks": true, + "stableTypeOrdering": true, "noImplicitReturns": true, "noPropertyAccessFromIndexSignature": true, "strictPropertyInitialization": true, diff --git a/packages/zone.js/test/typings/tsconfig.json b/packages/zone.js/test/typings/tsconfig.json index fabaf133d4d..e9454947485 100644 --- a/packages/zone.js/test/typings/tsconfig.json +++ b/packages/zone.js/test/typings/tsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "stableTypeOrdering": true, "forceConsistentCasingInFileNames": true, "noImplicitReturns": true, "noFallthroughCasesInSwitch": true, diff --git a/packages/zone.js/tsconfig.json b/packages/zone.js/tsconfig.json index c4f34e08f94..2873d926e6b 100644 --- a/packages/zone.js/tsconfig.json +++ b/packages/zone.js/tsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "stableTypeOrdering": true, "module": "esnext", "target": "es2022", "moduleResolution": "node", diff --git a/vscode-ng-language-service/tsconfig.json b/vscode-ng-language-service/tsconfig.json index c16efe42acd..97f8c5038c4 100644 --- a/vscode-ng-language-service/tsconfig.json +++ b/vscode-ng-language-service/tsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "stableTypeOrdering": true, "target": "es2017", "module": "commonjs", "moduleResolution": "node",