From 2b4539502e9bdfd0d6574c526b794a5764233bd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Fra=C5=9B?= Date: Tue, 18 Nov 2025 13:01:59 +0100 Subject: [PATCH] fix(@schematics/angular): flag '--file-name-style-guide=2016' - wrong import in main.ts --- .../application/files/standalone-files/src/main.ts.template | 2 +- packages/schematics/angular/application/index_spec.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/schematics/angular/application/files/standalone-files/src/main.ts.template b/packages/schematics/angular/application/files/standalone-files/src/main.ts.template index 5df75f9c838e..104fe6b29ae7 100644 --- a/packages/schematics/angular/application/files/standalone-files/src/main.ts.template +++ b/packages/schematics/angular/application/files/standalone-files/src/main.ts.template @@ -1,6 +1,6 @@ import { bootstrapApplication } from '@angular/platform-browser'; import { appConfig } from './app/app.config'; -import { App } from './app/app'; +import { App } from './app/app<%= suffix %>'; bootstrapApplication(App, appConfig) .catch((err) => console.error(err)); diff --git a/packages/schematics/angular/application/index_spec.ts b/packages/schematics/angular/application/index_spec.ts index 737af0578b0d..4d95be8b5ea1 100644 --- a/packages/schematics/angular/application/index_spec.ts +++ b/packages/schematics/angular/application/index_spec.ts @@ -876,8 +876,10 @@ describe('Application Schematic', () => { const options = { ...defaultOptions, fileNameStyleGuide: '2016' as const }; const tree = await schematicRunner.runSchematic('application', options, workspaceTree); const component = tree.readContent('/projects/foo/src/app/app.component.ts'); + const main = tree.readContent('/projects/foo/src/main.ts'); expect(component).toContain(`templateUrl: './app.component.html'`); expect(component).toContain(`styleUrl: './app.component.css'`); + expect(main).toContain(`import { App } from './app/app.component'`); }); it('should create a test file with import from the path without suffix', async () => {