GeezerVison is showing github.com — CLI: [command new] add option to enable previous suffix generation on create · Issue #30594 · angular/angular-cli
CLI: [command new] add option to enable previous suffix generation on create #30594DescriptionWhich @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. Reacted by Tomas Rimkus, denesh-r, Giacomo Barbalinardo, PythonPunktExe, Jochen Thiel, Angelo Pepe, Johannes Schölermann, casaelza, NeoScript, Kyle J. Kemp and 367 more Reacted by Alexander Ciesielski, Justin White, Marco Rinaldi, Adrián UB, michael faith, Angel D. Munoz and Clara Castillo Reacted by Adison Peña Martínez, anusha-bhat, Gustave, coderiyke, Joni Van Roost, Justin White, Rafael, Ariel Rennola, Fournet Enzo, Wilmer Blanco and 7 more Reacted by Jacob Samuel G., Davide Dal Santo, andreasreinkeivoflow, Spencer, Adam Thoor, Stephanie Leazer, Morte, Akatum, thibaut-st, Domas Trijonis and 38 more Activityangular-robot commented on Jun 25, 2025
This feature request is now candidate for our backlog! In the next phase, the community has 60 days to upvote. If the request receives more than 20 upvotes, we'll move it to our consideration list.
You can find more details about the feature request process in our documentation. jacsamg commented on Jun 25, 2025 This is very necessary 🙏🏾 Reacted by Vincent Wochnik, Duc Thang Vu, Justin White, Rafael, Ariel Rennola, Fournet Enzo, Wilmer Blanco, Ali Gamal, Jorge Cendal, Absalon and 8 more Echarnus commented on Jun 25, 2025 Makes it easy to identify files within a project. Have an upvote! Reacted by Vincent Wochnik, Duc Thang Vu, Ariel Rennola, Fournet Enzo, Ali Gamal, Jorge Cendal, Dimosthenis K., Konrad Stępień, Furkan Tas, Adhiraj Saha and 3 more Reacted by Aurélien Dussauge, Adrián UB and Angel D. Munoz andlewis commented on Jun 25, 2025 Seems like a good option to me! Reacted by Duc Thang Vu, Fournet Enzo, Wilmer Blanco, Ali Gamal, ivan-pleskonjic, Adhiraj Saha, Diego Rapoport and RomanDan haimyul commented on Jun 25, 2025 I like this feature request! Reacted by Duc Thang Vu, Wilmer Blanco, ivan-pleskonjic, Adhiraj Saha, Diego Rapoport and RomanDan thibaut-st commented on Jun 25, 2025 The damage control feature. Reacted by Ben, Adison Peña Martínez, Pablo Padilla, Farrukh, Steven Tuckness, DanielHilpoltsteiner, Adam Kuziemski, Duc Thang Vu, Tomas Rimkus, Daniel Schuba and 6 more thischarmingsam8 commented on Jun 25, 2025 Removing the suffixes increases ambiguity, opinionated defaults are a key reason people choose Angular. Reacted by Raluca Scorus, thibaut-st, yceron, Klaus Ferreira, Adison Peña Martínez, Abed Alaziz Owidat, jvenene, Giacomo Barbalinardo, Farrukh, NeoScript and 58 more Reacted by Aurélien Dussauge, Angel D. Munoz and Maurizio Cescon Reacted by Andre Mesquita ducthang-vu commented on Jun 25, 2025 Removing the suffixes in the first place was completely unnecessary. Reacted by Adison Peña Martínez, Abed Alaziz Owidat, jvenene, Pablo Padilla, Farrukh, NeoScript, Szymon Hełmecki, Gustave, James Jenkinson, fime-tst and 40 more Reacted by Andre Mesquita Milldrew commented on Aug 7, 2025 Am i talking to myself?
Is it not obvious that suffix is a misnomer?
@giacomo where did this suffix name come from?
It is certainly wrong and inaccurate.
replace suffix with sub-filetype and we are somewhat on track.
Besides the sub-filetypes should have never been removed. They prevent name space collisions among many other benefits that should be obvious. I am refraining from saying anything that will get this comment censored.
Love to see you all here trying to get things on track! 🙏🏻 thibaut-st commented on Aug 7, 2025
Am i talking to myself?
Apparently since most people calls it suffix for years now. giacomo commented on Aug 9, 2025 @francoqueirolo great seem not so complex your purpose. I hope the angular team finds the right solution it is annoing to rename all files created by new projects. srquev commented on Aug 10, 2025 I noticed that the Angular CLI no longer automatically appends the Component suffix when generating new components, a feature that existed in earlier versions. This change impacts consistency and clarity in component naming across projects.
Please revert it to avoid confusion between components and other classes or files. For example, a file named model.ts might be mistaken for an interface or data model file rather than a component. Appending Component makes the purpose explicit. Reacted by Andrew Miller and liviu-c Reacted by Andre Mesquita added 7 commits that reference this issue on Aug 27, 2025This issue will close once commit dc65b3a is merged into the 'main' branch.dc65b3a This issue will close once commit fc4a07e is merged into the 'main' branch.fc4a07e This issue will close once commit 2fd9912 is merged into the 'main' branch.2fd9912 This issue will close once commit 6fa0a72 is merged into the 'main' branch.6fa0a72 This issue will close once commit 869420a is merged into the 'main' branch.869420a This issue will close once commit 78d88bc is merged into the 'main' branch.78d88bc This issue will close once commit f85ac76 is merged into the 'main' branch.f85ac76 added a commit that references this issue on Sep 2, 2025This issue will close once commit 4e6c94f is merged into the 'main' branch.4e6c94f angular-automatic-lock-bot commented on Oct 3, 2025 This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|