Description
Which @angular/* package(s) are relevant/related to the feature request?
compiler-cli
Description
The problem:
Starting in Angular v20, by default Angular CLI will not generate suffixes
As written in https://blog.angular.dev/announcing-angular-v20-b5c9c06cf301
Starting in Angular v20, by default Angular CLI will not generate suffixes for your components, directives, services, and pipes. For existing projects, ng update will enable suffix generation by updating your angular.json. To enable suffix generation in new projects, use the following schematic configuration:
{
"projects": {
"app": {
...
"schematics": {
"@schematics/angular:component": { "type": "component" },
"@schematics/angular:directive": { "type": "directive" },
"@schematics/angular:service": { "type": "service" },
"@schematics/angular:guard": { "typeSeparator": "." },
"@schematics/angular:interceptor": { "typeSeparator": "." },
"@schematics/angular:module": { "typeSeparator": "." },
"@schematics/angular:pipe": { "typeSeparator": "." },
"@schematics/angular:resolver": { "typeSeparator": "." }
},
...
}
Proposed solution
The solution:
To add an option to the new command, to be able to create a new application with suffixes:
ng new angular-app --with-suffix
This command will automatically add schematics to the angular.json
and creates e.g. app.component.ts
instead off app.ts
Alternatives considered
The only way to achive this, add manually the schematics and rename the auto generated files manually.
This is time consuming.