<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Tom White</title>
    <description>The latest articles on DEV Community by Tom White (@tom_white_ec9c64700e677a9).</description>
    <link>https://dev.to/tom_white_ec9c64700e677a9</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2078787%2F725a346b-51fa-43b7-b536-8f62710ea871.jpg</url>
      <title>DEV Community: Tom White</title>
      <link>https://dev.to/tom_white_ec9c64700e677a9</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tom_white_ec9c64700e677a9"/>
    <language>en</language>
    <item>
      <title>Renaming Angular Suffixes in 2026: A Pragmatic Guide for "Legacy" Projects</title>
      <dc:creator>Tom White</dc:creator>
      <pubDate>Sun, 08 Feb 2026 09:55:31 +0000</pubDate>
      <link>https://dev.to/tom_white_ec9c64700e677a9/renaming-angular-suffixes-in-2026-a-pragmatic-guide-for-legacy-projects-48im</link>
      <guid>https://dev.to/tom_white_ec9c64700e677a9/renaming-angular-suffixes-in-2026-a-pragmatic-guide-for-legacy-projects-48im</guid>
      <description>&lt;p&gt;I know, I know. We're already on Angular v21. If you're starting a greenfield project today, you're probably already using the latest style guide conventions without a second thought. But let's be real: plenty of us are maintaining codebases that are at least a year old - ancient history in Angular Renaissance time.&lt;/p&gt;

&lt;p&gt;If you're working on one of these "legacy" projects (and by legacy, I mean anything created before breakfast yesterday), you might be looking at the &lt;a href="https://angular.dev/style-guide" rel="noopener noreferrer"&gt;Angular style guide's suggestion to drop the &lt;code&gt;.component&lt;/code&gt;, &lt;code&gt;.service&lt;/code&gt;, and &lt;code&gt;.directive&lt;/code&gt; suffixes&lt;/a&gt; and thinking, "That looks clean, but I have 500+ components. So, no thanks."&lt;/p&gt;

&lt;p&gt;I felt the same way. The Angular CLI gives us great scaffolding, but now the long-standing convention has changed, we're left with a mountain of technical debt. Renaming files manually is tedious, error-prone, and let's be honest, boring.&lt;/p&gt;

&lt;p&gt;So, I updated my VS Code extension, &lt;a href="https://marketplace.visualstudio.com/items?itemName=tomwhite007.rename-angular-component" rel="noopener noreferrer"&gt;Rename Angular Component&lt;/a&gt;, with a feature called &lt;strong&gt;"Rename all Angular suffixes to v20 styleguide"&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;But there's a catch.&lt;/p&gt;

&lt;h2&gt;
  
  
  💥 The Namespace Collision Problem
&lt;/h2&gt;

&lt;p&gt;When you strip suffixes, you quickly run into a problem I call "Namespace Collision."&lt;/p&gt;

&lt;p&gt;Imagine you have:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;user.component.ts&lt;/code&gt; (Class: &lt;code&gt;UserComponent&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;user.service.ts&lt;/code&gt; (Class: &lt;code&gt;UserService&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;user.interface.ts&lt;/code&gt; (Interface: &lt;code&gt;User&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you blindly run a script to remove "Component" and "Service" suffixes, you end up with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;user.ts&lt;/code&gt; (Class: &lt;code&gt;User&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;user.ts&lt;/code&gt; (Class: &lt;code&gt;User&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;user.ts&lt;/code&gt; (Interface: &lt;code&gt;User&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Three classes named &lt;code&gt;User&lt;/code&gt; in three files named &lt;code&gt;user.ts&lt;/code&gt;. The compiler screams, the linter faints, and you reach for &lt;code&gt;git reset --hard&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;I wanted to find the best way to handle this, so I took the &lt;a href="https://github.com/realworld-apps/angular-realworld-example-app" rel="noopener noreferrer"&gt;Angular Realworld Example App&lt;/a&gt; for a spin to test two different approaches using the extension.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;⚠️ Note:&lt;/strong&gt; Whichever path you choose, &lt;strong&gt;do not commit&lt;/strong&gt; your changes immediately after running the bulk rename command (although you can stage them). You need the file changes to sit in your working tree so that &lt;code&gt;git diff&lt;/code&gt; is available. This diff is the evidence that either you (in Approach 1) or the AI agent (in Approach 2) will use to identify what happened and spot the collisions.&lt;/p&gt;

&lt;h2&gt;
  
  
  🛠️ Approach 1: The Deterministic (Manual) Way
&lt;/h2&gt;

&lt;p&gt;This is for those who trust their own hands more than a probabilistic model.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;Run the "Rename all Angular file types" option.&lt;/strong&gt;
You'll immediately see the collisions. Git is your friend here. Note down the offenders (e.g., &lt;code&gt;profile.component&lt;/code&gt;, &lt;code&gt;profile.service&lt;/code&gt;, &lt;code&gt;user.component&lt;/code&gt;, &lt;code&gt;user.service&lt;/code&gt;, &lt;code&gt;article.component&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Revert and Retry.&lt;/strong&gt;&lt;br&gt;
Reset your changes. Run the command again, but this time, enter the colliding distinct names into the &lt;strong&gt;exclusions list&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The tool will rename your app—classes, filenames, selectors, and imports - leaving just the tricky ones untouched.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Finish with the Scalpel.&lt;/strong&gt;&lt;br&gt;
Now, use the extension's main feature: &lt;strong&gt;Rename Angular Component&lt;/strong&gt;. Usage is simple: right-click a file, type the new name.&lt;/p&gt;

&lt;p&gt;For the collisions, you can make semantic decisions. Rename &lt;code&gt;UserService&lt;/code&gt; to &lt;code&gt;UserDataAccess&lt;/code&gt; or &lt;code&gt;UserAuth&lt;/code&gt;. The extension handles the heavy lifting of updating every reference, import, and template selector in less than a second.&lt;/p&gt;

&lt;p&gt;It’s fast. It’s cleaner. And frankly, for a handful of files, it's quicker than explaining the context to an LLM.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  🤖 Approach 2: The "AI Assisted" Way
&lt;/h2&gt;

&lt;p&gt;If scale is your problem (or you're just tired), the extension now comes with a specifically crafted &lt;strong&gt;AI Agent Prompt&lt;/strong&gt;.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;Run the "Rename all Angular file types" option.&lt;/strong&gt;
Let the collisions happen. Let the build break.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Summon the Agent.&lt;/strong&gt;&lt;br&gt;
Copy the &lt;a href="https://github.com/tomwhite007/rename-angular-component/blob/main/assets/ANGULAR-SUFFIX-REMOVAL.md#ai-agent-prompt" rel="noopener noreferrer"&gt;provided prompt&lt;/a&gt; (it's built into the extension documentation, and pops up when you run the command).&lt;/p&gt;

&lt;p&gt;The prompt basically tells your AI agent (Cursor, Windsurf, or whatever you're using):&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"I just broke my build by renaming everything to &lt;code&gt;User&lt;/code&gt;. Please look at the usage. If a service has HTTP calls, rename it &lt;code&gt;UserDataAccess&lt;/code&gt;. If it has Signals, rename it &lt;code&gt;UserState&lt;/code&gt;. Fix the imports."&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Review the Magic.&lt;/strong&gt;&lt;br&gt;
The AI will typically parse your code, understand that &lt;code&gt;UserService&lt;/code&gt; was actually handling API calls, and rename it to &lt;code&gt;UserDataAccess&lt;/code&gt; automatically.&lt;/p&gt;

&lt;p&gt;And then it gives you a simple exportable summary of the changes it made.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I tried this on the &lt;a href="https://github.com/realworld-apps/angular-realworld-example-app" rel="noopener noreferrer"&gt;Angular Realworld Example App&lt;/a&gt;. It correctly identified that &lt;code&gt;UserService&lt;/code&gt; and &lt;code&gt;UserComponent&lt;/code&gt; were colliding, and renamed the service to &lt;code&gt;UserDataAccess&lt;/code&gt; (because it saw the HTTP client usage), resolving the conflict without me typing a single character. I've submitted the output as a &lt;a href="https://github.com/realworld-apps/angular-realworld-example-app/pull/342" rel="noopener noreferrer"&gt;PR on their GitHub repo&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  🤔 Why Not Just Use AI for Everything?
&lt;/h2&gt;

&lt;p&gt;You might ask, "Why do I need an extension? I'll just ask ChatGPT to rename my project."&lt;/p&gt;

&lt;p&gt;Have you tried asking an LLM to rename 500 files, update their imports, fix the usage in templates, and ensure the selectors match the new file structure? It will take quite a few iterations, and on a large project, disappear your month's tokens.&lt;/p&gt;

&lt;p&gt;Specialised tools like &lt;strong&gt;Rename Angular Component&lt;/strong&gt; are deterministic. They follow the AST. They don't guess. They burn significantly fewer trees (and GPU cycles) than spinning up a massive model just to rename a string.&lt;/p&gt;

&lt;p&gt;Use AI for the hard stuff—deciding &lt;em&gt;what&lt;/em&gt; to name a colliding service. Use the extension for the grunt work—renaming the other 498 files correctly.&lt;/p&gt;

&lt;h2&gt;
  
  
  🏁 Conclusion
&lt;/h2&gt;

&lt;p&gt;If you're updating your "legacy" Angular project to modern standards:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Embrace the Angular v21 styleguide.&lt;/li&gt;
&lt;li&gt; Use tools that respect your time.&lt;/li&gt;
&lt;li&gt; Check out &lt;strong&gt;Rename Angular Component&lt;/strong&gt; on the &lt;a href="https://marketplace.visualstudio.com/items?itemName=tomwhite007.rename-angular-component" rel="noopener noreferrer"&gt;VS Code Marketplace&lt;/a&gt;, or the &lt;a href="https://open-vsx.org/extension/tomwhite007/rename-angular-component" rel="noopener noreferrer"&gt;Open VSIX Registry&lt;/a&gt; if you use Cursor or Antigravity.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frllud49aiap86uwow4r0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frllud49aiap86uwow4r0.png" alt=" " width="50" height="50"&gt;&lt;/a&gt; By the way, the &lt;strong&gt;Rename Angular Component&lt;/strong&gt; extension also renames individual Angular Components! ...Services, Directives, Modules, Guards, Pipes, and regular interfaces, enums, classes, functions, and variables that follow the rule of "&lt;a href="https://angular.dev/style-guide#one-concept-per-file" rel="noopener noreferrer"&gt;One concept per file&lt;/a&gt;" (with matching filename), just by right-clicking it in the Explorer panel.&lt;/p&gt;

&lt;p&gt;Happy renaming!&lt;/p&gt;

</description>
      <category>angular</category>
      <category>frontend</category>
      <category>tutorial</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
