Skip to content

Commit 85e623c

Browse files
committed
v7.0.0
1 parent 3f53ff2 commit 85e623c

File tree

5 files changed

+122
-36
lines changed

5 files changed

+122
-36
lines changed

CHANGELOG.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,43 @@
11
# Change Log
22

3+
## [7.0.0] - 2025-10-20
4+
5+
### New naming conventions
6+
7+
Angular 20 changed the naming conventions for class and file names:
8+
- no more class and file names suffix for components, directives and services:
9+
- `ProductCardComponent` in `product-card.component.ts` => `ProductCard` in `product-card.ts`
10+
- `ProductApiService` in `product-api.service.ts` => `ProductApi` in `product-api.ts`
11+
- `MissingProductDirective` in `missing-product.directive.ts` => `MissingProduct` in `missing-product.ts`
12+
- suffix kept for the other concepts, but file name suffix separator changed from `.` to `-`:
13+
- `CustomDatePipe` in `custom-date.pipe.ts` => `CustomDatePipe ` in `custom-date-pipe.ts`
14+
- `ProductsPage` in `products.page.ts` => `ProductsPage ` in `products-page.ts`
15+
- `authInterceptor` in `auth.interceptor.ts` => `authInterceptor ` in `auth-interceptor.ts`
16+
- `authGuard` in `auth.guard.ts` => `authGuard ` in `auth-guard.ts`
17+
- `dataResolver` in `data.resolver.ts` => `dataResolver ` in `data-resolver.ts`
18+
19+
Angular refers to these 2 different naming conventions as:
20+
- the former 2016 style guide, up to Angular 19
21+
- the new 2025 style guide, which is the default since Angular 20
22+
23+
**This extension now follows the new naming conventions by default.** But you can switch back to the legacy naming conventions in one click with the configuration helper (it must be done in each workspace).
24+
25+
**As a reminder, this extension is not developed by the Angular team or affiliated to Google in any way. It is months of unpaid work by a single contributor. So if you do not like this change, I am not responsible for it, and again, you can switch back to the previous behavior.**
26+
27+
"Copy settings from angular.json" will take into account `type` and `typeSeparator` options (which are automatically added when migrating an Angular 19 project to Angular 20 via `ng update`).
28+
29+
Pro edition users can additionnaly:
30+
- set custom suffixes
31+
- set a suffix only for the class name but not for the file name
32+
- set a suffix only for the file name but not for the class name
33+
34+
Also for the Pro edition users having custom schematics with `suffix`, a new `fileNameSuffix` property is introduced for the `schematic.json` configuration. For backward compatibility, it defaults to `.suffix`, but this behavior may be removed in the future. **It is strongly recommended to add an explicit `fileNameSuffix` to all your `schematic.json` using `suffix`.**
35+
36+
### Other changes
37+
38+
- `skipClassSuffix` option for components, directives and services is removed, as it is now the default behavior
39+
- Angular ESLint suffixes management (both in the configuration helper and the `angularEslintComponentSuffix` feature for custom schematics) is removed as it does not make sense anymore and as `angular-eslint` removed the rule from the recommended set in version 20
40+
341
## [6.23.0] - 2024-12-27
442

543
In the Pro edition, you can now enable automatic classes prefixes, for example to generate `MatButtonComponent` instead of `ButtonComponent` (given "mat" is set as the selector prefix). It is useful when doing a library of components.

walkthroughs/configuration.md

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
Some common options can be customized in a one click with the configuration helper:
44

55
- Copy settings from angular.json
6+
- Use legacy naming conventions ⚙️
67
- Enable SCSS, Sass or Less styles ⚙️
78
- Disable styles ⚙️
89
- Enable external HTML templates ⚙️
@@ -13,7 +14,6 @@ Some common options can be customized in a one click with the configuration help
1314
- Disable block CSS display ⚙️
1415
- Enable shadow DOM ⚙️
1516
- Set the selector prefix ⚙️
16-
- Disable classes suffixes 💎
1717
- Force NgModules 💎
1818
- Force class interceptors 💎
1919
- Force class guards and resolvers 💎
@@ -41,6 +41,7 @@ This extension stores the configuration in VS Code *workspace* settings. It mean
4141
## Copy settings from angular.json
4242

4343
This extension uses its own configuration. But if you have an *official and valid* `angular.json` with some `schematics` settings, the extension can copy them. It should detect the following settings:
44+
- legacy naming conventions (`type` and `typeSeparator`)
4445
- SCSS, Sass or Less styles
4546
- no style
4647
- external HTML templates
@@ -50,6 +51,33 @@ This extension uses its own configuration. But if you have an *official and vali
5051

5152
<br>
5253

54+
## Use legacy naming conventions
55+
56+
Angular 20 changed the naming conventions for class and file names:
57+
- no more class and file names suffix for components, directives and services:
58+
- `ProductCardComponent` in `product-card.component.ts` => `ProductCard` in `product-card.ts`
59+
- `ProductApiService` in `product-api.service.ts` => `ProductApi` in `product-api.ts`
60+
- `MissingProductDirective` in `missing-product.directive.ts` => `MissingProduct` in `missing-product.ts`
61+
- suffix kept for the other concepts, but file name suffix separator changed from `.` to `-`:
62+
- `CustomDatePipe` in `custom-date.pipe.ts` => `CustomDatePipe ` in `custom-date-pipe.ts`
63+
- `ProductsPage` in `products.page.ts` => `ProductsPage ` in `products-page.ts`
64+
- `authInterceptor` in `auth.interceptor.ts` => `authInterceptor ` in `auth-interceptor.ts`
65+
- `authGuard` in `auth.guard.ts` => `authGuard ` in `auth-guard.ts`
66+
- `dataResolver` in `data.resolver.ts` => `dataResolver ` in `data-resolver.ts`
67+
68+
Angular refers to these 2 different naming conventions as:
69+
- the former 2016 style guide, up to Angular 19
70+
- the new 2025 style guide, which is the default since Angular 20
71+
72+
Since its version 7, this extension follows the new naming conventions by default. But you can switch back to the legacy naming conventions.
73+
74+
💎 Pro edition users can additionnaly (manually):
75+
- set custom suffixes
76+
- set a suffix only for the class name but not for the file name
77+
- set a suffix only for the file name but not for the class name
78+
79+
<br>
80+
5381
## Enable SCSS, Sass or Less styles
5482

5583
For projects with a design system still using CSS preprocessors (like SCSS for Angular Material or PrimeNG).
@@ -152,16 +180,6 @@ In the Pro edition, you can enable automatic classes prefixes, for example to ge
152180

153181
<br>
154182

155-
## 💎 Disable classes suffixes
156-
157-
In the Pro edition, you can disable automatic classes suffixes, for example to generate `SomeButton` instead of `SomeButtonComponent`, or `SomeApiClient` instead of `SomeApiClientService`.
158-
159-
This option allows to partly align with the upcoming [new Angular style guide](https://gist.github.com/jelbourn/0158b02cfb426e69c172db4ec92e3c0c), being discussed in [this RFC](https://github.com/angular/angular/discussions/58412).
160-
161-
It has also been the standard in some design systems libraries since always, like Angular Material itself (it is `MatButton`, not `MatButtonComponent`).
162-
163-
<br>
164-
165183
## 💎 Force NgModules
166184

167185
In the Pro edition, if your project uses Angular <=13 or is not ready for standalone components yet.

walkthroughs/customSchematics.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ The extension uses Handlebars (`.hbs` files) as the templating syntax, which is
5454

5555
Available expressions:
5656
- `{{name}}` hello-world (raw user input)
57-
- `{{fileName}}` hello-world or hello-world.suffix (kebab-cased user input)
57+
- `{{fileName}}` hello-world or hello-worldfileNameSuffix (kebab-cased user input)
5858
- `{{className}}` HelloWorld or HelloWorldSuffix (PascalCased user input)
5959
- `{{camelName}}` helloWorld or helloWorldSuffix (camelCased user input)
6060
- `{{options.someOption}}` value of an option defined in schematic.json
@@ -100,11 +100,22 @@ Optional properties:
100100
- `description`: directly visible below the schematic label
101101
- `tooltipDescription`: displayed when the user click on the "?" icon
102102
- `pathSubfolder`: should the new files be generated directly inside the destination path (example: /path/to/hello-world.component.ts), which is the default, or inside a subfolder (example: path/to/hello-world/hello-world.component.ts), which is often a better option when multiple files are generated
103-
- `suffix`: lowercased suffix for file and class names (example: "component" suffix will result in hello-world.component file name and HelloWorldComponent class name)
104103
- `dependenciesRequired`: dependencies required to enable this schematic (example: ["@angular/core"]), it only makes sense if you share schematics between projects (otherwise if you create a schematic for a specific project, you already know you want to activate it)
105104
- `features`: list of special features enabled for this schematic, see below
106105
- `options`: list of options configurable by the user, see below
107106

107+
### Suffixes
108+
109+
2 optional properties allow to configure the suffix:
110+
- `suffix`: lowercased suffix for the entity (class or else) name (example: "component" will result in HelloWorldComponent `className` or "guard" will result in helloWorldGuard `camelName`)
111+
- `fileNameSuffix`: full suffix for the file name, including the separator (example: ".component" or "-component")
112+
113+
While it is recommended to be consistent with the same suffix for the class and file names, there are 2 different options to allow to define only one of them (for example, add a suffix to the file name but not to the class).
114+
115+
Note that for backward compatibility, if `suffix` is defined and `fileNameSuffix` is not defined, the later will default to `.suffix`:
116+
- but do not rely on this implicit behavior which may be deleted in the future, set an explicit `fileNameSuffix`
117+
- if you want a `suffix` but no `fileNameSuffix`, set the later to an empty string
118+
108119
<br>
109120

110121
## Schematic options
@@ -239,11 +250,6 @@ Options reserved: `export`
239250
Should be enabled for all Angular schematics. Activates low-level Angular features, like checking the generation is done in a project configured in `angular.json`.
240251
</details>
241252
<details>
242-
<summary>angularEslintComponentSuffix</summary>
243-
244-
Should be enabled for Angular component schematics using a `suffix` different from "component" (example: "page"). If Angular ESLint is installed, it will automatically configure it to allow this suffix.
245-
</details>
246-
<details>
247253
<summary>angularAddComponentRoute</summary>
248254

249255
For Angular page component schematic, will ask and add a route in the closest `.routes.ts` or `-routing.module.ts` file.

walkthroughs/pro/configuration.md

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
Some common options can be customized in a one click with the configuration helper:
44

55
- Copy settings from angular.json
6+
- Use legacy naming conventions
67
- Enable SCSS, Sass or Less styles
78
- Disable styles
89
- Enable external HTML templates
@@ -13,7 +14,6 @@ Some common options can be customized in a one click with the configuration help
1314
- Disable block CSS display
1415
- Enable shadow DOM
1516
- Set the selector prefix
16-
- Disable classes suffixes 💎
1717
- Force NgModules 💎
1818
- Force class interceptors 💎
1919
- Force class guards and resolvers 💎
@@ -39,6 +39,7 @@ This extension stores the configuration in VS Code *workspace* settings. It mean
3939
## Copy settings from angular.json
4040

4141
This extension uses its own configuration. But if you have an *official and valid* `angular.json` with some `schematics` settings, the extension can copy them. It should detect the following settings:
42+
- legacy naming conventions (`type` and `typeSeparator`)
4243
- SCSS, Sass or Less styles
4344
- no style
4445
- external HTML templates
@@ -48,6 +49,33 @@ This extension uses its own configuration. But if you have an *official and vali
4849

4950
<br>
5051

52+
## Use legacy naming conventions
53+
54+
Angular 20 changed the naming conventions for class and file names:
55+
- no more class and file names suffix for components, directives and services:
56+
- `ProductCardComponent` in `product-card.component.ts` => `ProductCard` in `product-card.ts`
57+
- `ProductApiService` in `product-api.service.ts` => `ProductApi` in `product-api.ts`
58+
- `MissingProductDirective` in `missing-product.directive.ts` => `MissingProduct` in `missing-product.ts`
59+
- suffix kept for the other concepts, but file name suffix separator changed from `.` to `-`:
60+
- `CustomDatePipe` in `custom-date.pipe.ts` => `CustomDatePipe ` in `custom-date-pipe.ts`
61+
- `ProductsPage` in `products.page.ts` => `ProductsPage ` in `products-page.ts`
62+
- `authInterceptor` in `auth.interceptor.ts` => `authInterceptor ` in `auth-interceptor.ts`
63+
- `authGuard` in `auth.guard.ts` => `authGuard ` in `auth-guard.ts`
64+
- `dataResolver` in `data.resolver.ts` => `dataResolver ` in `data-resolver.ts`
65+
66+
Angular refers to these 2 different naming conventions as:
67+
- the former 2016 style guide, up to Angular 19
68+
- the new 2025 style guide, which is the default since Angular 20
69+
70+
Since its version 7, this extension follows the new naming conventions by default. But you can switch back to the legacy naming conventions.
71+
72+
💎 In your Pro edition, you can additionnaly (manually):
73+
- set custom suffixes
74+
- set a suffix only for the class name but not for the file name
75+
- set a suffix only for the file name but not for the class name
76+
77+
<br>
78+
5179
## Enable SCSS, Sass or Less styles
5280

5381
For projects with a design system still using CSS preprocessors (like SCSS for Angular Material or PrimeNG).
@@ -150,16 +178,6 @@ In your Pro edition, you can enable automatic classes prefixes, for example to g
150178

151179
<br>
152180

153-
## 💎 Disable classes suffixes
154-
155-
In your Pro edition, you can disable automatic classes suffixes, for example to generate `SomeButton` instead of `SomeButtonComponent`, or `SomeApiClient` instead of `SomeApiClientService`.
156-
157-
This option allows to partly align with the upcoming [new Angular style guide](https://gist.github.com/jelbourn/0158b02cfb426e69c172db4ec92e3c0c), being discussed in [this RFC](https://github.com/angular/angular/discussions/58412).
158-
159-
It has also been the standard in some design systems libraries since always, like Angular Material itself (it is `MatButton`, not `MatButtonComponent`).
160-
161-
<br>
162-
163181
## 💎 Force NgModules
164182

165183
In your Pro edition, if your project uses Angular <=13 or is not ready for standalone components yet.

walkthroughs/pro/customSchematics.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ The extension uses Handlebars (`.hbs` files) as the templating syntax, which is
4444

4545
Available expressions:
4646
- `{{name}}` hello-world (raw user input)
47-
- `{{fileName}}` hello-world or hello-world.suffix (kebab-cased user input)
47+
- `{{fileName}}` hello-world or hello-worldfileNameSuffix (kebab-cased user input)
4848
- `{{className}}` HelloWorld or HelloWorldSuffix (PascalCased user input)
4949
- `{{camelName}}` helloWorld or helloWorldSuffix (camelCased user input)
5050
- `{{options.someOption}}` value of an option defined in schematic.json
@@ -90,11 +90,22 @@ Optional properties:
9090
- `description`: directly visible below the schematic label
9191
- `tooltipDescription`: displayed when the user click on the "?" icon
9292
- `pathSubfolder`: should the new files be generated directly inside the destination path (example: /path/to/hello-world.component.ts), which is the default, or inside a subfolder (example: path/to/hello-world/hello-world.component.ts), which is often a better option when multiple files are generated
93-
- `suffix`: lowercased suffix for file and class names (example: "component" suffix will result in hello-world.component file name and HelloWorldComponent class name)
9493
- `dependenciesRequired`: dependencies required to enable this schematic (example: ["@angular/core"]), it only makes sense if you share schematics between projects (otherwise if you create a schematic for a specific project, you already know you want to activate it)
9594
- `features`: list of special features enabled for this schematic, see below
9695
- `options`: list of options configurable by the user, see below
9796

97+
### Suffixes
98+
99+
2 optional properties allow to configure the suffix:
100+
- `suffix`: lowercased suffix for the entity (class or else) name (example: "component" will result in HelloWorldComponent `className` or "guard" will result in helloWorldGuard `camelName`)
101+
- `fileNameSuffix`: full suffix for the file name, including the separator (example: ".component" or "-component")
102+
103+
While it is recommended to be consistent with the same suffix for the class and file names, there are 2 different options to allow to define only one of them (for example, add a suffix to the file name but not to the class).
104+
105+
Note that for backward compatibility, if `suffix` is defined and `fileNameSuffix` is not defined, the later will default to `.suffix`:
106+
- but do not rely on this implicit behavior which may be deleted in the future, set an explicit `fileNameSuffix`
107+
- if you want a `suffix` but no `fileNameSuffix`, set the later to an empty string
108+
98109
<br>
99110

100111
## Schematic options
@@ -229,11 +240,6 @@ Options reserved: `export`
229240
Should be enabled for all Angular schematics. Activates low-level Angular features, like checking the generation is done in a project configured in `angular.json`.
230241
</details>
231242
<details>
232-
<summary>angularEslintComponentSuffix</summary>
233-
234-
Should be enabled for Angular component schematics using a `suffix` different from "component" (example: "page"). If Angular ESLint is installed, it will automatically configure it to allow this suffix.
235-
</details>
236-
<details>
237243
<summary>angularAddComponentRoute</summary>
238244

239245
For Angular page component schematic, will ask and add a route in the closest `.routes.ts` or `-routing.module.ts` file.

0 commit comments

Comments
 (0)