r/angular • u/devGiacomo • Jun 25 '25
Bring back suffixes in Angular 20 CLI — need 20 upvotes to get it considered 🚀
Hey Angular devs 👋
Angular v20 dropped a small but impactful change: by default, the CLI no longer adds suffixes like .component.ts, .service.ts, .pipe.ts, etc., when generating files.
While this might make things “cleaner” for newcomers, it introduces friction for a lot of real-world teams — especially in enterprise environments where:
✅ Clear suffixes help developers quickly identify file purpose
✅ Large codebases demand consistent, searchable naming conventions
✅ Suffix-based tooling or architecture relies on those filenames
✅ Teams often onboard new devs who benefit from explicit file naming
✅ Legacy code and shared standards depend on the old format
Right now, there's no built-in way to re-enable suffixes when creating a new project. The only workaround is manually editing angular.json, which is tedious and error-prone.
👉 I’ve opened a feature request on GitHub asking the Angular team to support this via a simple flag:
ng new my-app --with-suffix
This would automatically set up angular.json to restore suffix generation (e.g., app.component.ts instead of app.ts, user.service.ts, etc.).
🗳️ We need 20 upvotes for the Angular team to consider it. If you agree this would be helpful, please upvote the issue here:
🔗 https://github.com/angular/angular-cli/issues/30594
Let’s help keep Angular flexible for real-world use cases — especially for large teams and long-term projects. Thanks for the support 🙌
23
u/Gortyser Jun 25 '25
First time hearing about that, what’s the reasoning behind the removal?
5
u/devGiacomo Jun 26 '25
ok guys thank you all, the request in now under consideration. finger crossed 🤞
13
u/Vaakmeister Jun 25 '25
I find it ironic that they barely mention services in their docs at all anymore, and when it’s mentioned the examples still use suffixes.
https://angular.dev/guide/di/creating-injectable-service#
60
u/Yatwer92 Jun 25 '25
I love everything they did recently since v16 (standalone, inject(), signals, etc).
But this one is fucking dumb. Suffix makes everything clearer. Especially when working with a team and in need of strong conventions.
Now every team/company will have it's own convention and it will be a pain.
27
u/Hirayoki22 Jun 25 '25
Funny how everyone and their moms complained about it when it was first proposed, and the Angular team still pushed through.
8
u/IHateYallmfs Jun 25 '25
Thank god you actually cared to propose this. The switch has no rationale anyway.
1
u/JEHonYakuSha Jun 25 '25
Why not just update your schematics? One change and it’s forever back to your original preference.
2
u/imDDS Jun 25 '25
Done!
2
u/andlewis Jun 25 '25
I don’t have strong feelings either way, but I’m supportive of making it an options. I’m assuming a comment is a vote?
2
u/ClueProof5893 Jun 25 '25
Done! Thanks!
2
u/prameshbajra Jun 25 '25
Here here ! Take this upvote. It just makes sense to have this.
2
u/CatEatsDogs Jun 25 '25
I doubt they revert this stupid change. But I voted just in case.
1
u/SolidShook Jun 25 '25
Suffixes after a . are not file names they are extensions, bring them back
1
u/FlyingFishSwimBird Jun 26 '25
Done! Thanks!
1
u/saiyaff Jun 28 '25
In the CLI you have the schematics which you could add to keep the suffixes going. And, I see that in your proposal as well. And, appreciate the suggestion of the CLI command. Should come handy if that doesn’t exist already which is the case I think.
And, I’ve been dealing with the same problem when the RFC was published. And, I’ve wrote about it once I’ve started adapting the change. Here’s the link if you want to have a read - https://javascript.plainenglish.io/from-resistance-to-reason-making-sense-of-angulars-v20-style-guide-changes-e1a068c8dae8
Let me know whether y’all could wrap your heads around it.
1
u/AlexTheNordicOne Jun 30 '25
I support having the option, even though I'm not 100% certain where I personally stand on this.
I've seen the argument that "user.service.ts" doesn't really convey any information about it. Generally I'd agree, but I think the actual problem is not the .service extension, but rather bad naming in general. Removing the suffix certainly will make a lot of devs think more about the naming of their file, however I believe there are are also other ways to achieve this. Could be through project or company naming conventions, it doesn't really matter. And likely there will still be plenty of devs that will keep naming services just "user.ts" and then import them with an alias if necessary.
So what I'm trying to say is, that "removing suffixes to improve naming of files" is certainly an argument, but I think it ignores the fact, that this is not the only way to do so and really is on us devs. With or without suffixes, its our job to name things properly.
Also regarding arguments like "service/component could be anything and therefore it doesn't add value": I kinda disagree. There are 2 sides to this:
The one is: What is this file in the context of my app or business logics? - Here the suffix doesn't help you. A proper name should be in place
The second one is: What kind of (Angular) code does it contain? - This matters, as some have pointed out, for finding a specific file. Or even simply just having a quick overview. A proper file name can also help with that, but may not always be clear enough. But even more so, if for example you believe during debugging, that a service could be responsible for a bug, then you can simply find all interceptors by its suffix.
The point is: Suffixes add the information about what kind of puzzle piece you are dealing with and the file name adds the information about its purpose. I don't think its as clear cut as either side wants it to be and that we should always aim for proper names.
0
u/pheasant___plucker Jun 25 '25
What's the issue? If you're creating a service why wouldn't you name it accordingly, eg "ng g s bank-service" so that Angular generates bank-service.ts? This is what is done in other languages.
-11
u/Psychological-Leg413 Jun 25 '25
Can we stop with the AI written text please..
0
u/morgo_mpx Jun 26 '25
The problem with the suffixes is that they are not details enough. A component or service can be so many things so it just gets annoying.
-20
u/mamwybejane Jun 25 '25
Disagree