You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+38Lines changed: 38 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,43 @@
1
1
# Change Log
2
2
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
+
3
41
## [6.23.0] - 2024-12-27
4
42
5
43
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.
Copy file name to clipboardExpand all lines: walkthroughs/configuration.md
+29-11Lines changed: 29 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,7 @@
3
3
Some common options can be customized in a one click with the configuration helper:
4
4
5
5
- Copy settings from angular.json
6
+
- Use legacy naming conventions ⚙️
6
7
- Enable SCSS, Sass or Less styles ⚙️
7
8
- Disable styles ⚙️
8
9
- Enable external HTML templates ⚙️
@@ -13,7 +14,6 @@ Some common options can be customized in a one click with the configuration help
13
14
- Disable block CSS display ⚙️
14
15
- Enable shadow DOM ⚙️
15
16
- Set the selector prefix ⚙️
16
-
- Disable classes suffixes 💎
17
17
- Force NgModules 💎
18
18
- Force class interceptors 💎
19
19
- Force class guards and resolvers 💎
@@ -41,6 +41,7 @@ This extension stores the configuration in VS Code *workspace* settings. It mean
41
41
## Copy settings from angular.json
42
42
43
43
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`)
44
45
- SCSS, Sass or Less styles
45
46
- no style
46
47
- external HTML templates
@@ -50,6 +51,33 @@ This extension uses its own configuration. But if you have an *official and vali
50
51
51
52
<br>
52
53
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
+
53
81
## Enable SCSS, Sass or Less styles
54
82
55
83
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
152
180
153
181
<br>
154
182
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
-
165
183
## 💎 Force NgModules
166
184
167
185
In the Pro edition, if your project uses Angular <=13 or is not ready for standalone components yet.
Copy file name to clipboardExpand all lines: walkthroughs/customSchematics.md
+13-7Lines changed: 13 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,7 +54,7 @@ The extension uses Handlebars (`.hbs` files) as the templating syntax, which is
54
54
55
55
Available expressions:
56
56
-`{{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)
58
58
-`{{className}}` HelloWorld or HelloWorldSuffix (PascalCased user input)
59
59
-`{{camelName}}` helloWorld or helloWorldSuffix (camelCased user input)
60
60
-`{{options.someOption}}` value of an option defined in schematic.json
@@ -100,11 +100,22 @@ Optional properties:
100
100
-`description`: directly visible below the schematic label
101
101
-`tooltipDescription`: displayed when the user click on the "?" icon
102
102
-`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)
104
103
-`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)
105
104
-`features`: list of special features enabled for this schematic, see below
106
105
-`options`: list of options configurable by the user, see below
107
106
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
+
108
119
<br>
109
120
110
121
## Schematic options
@@ -239,11 +250,6 @@ Options reserved: `export`
239
250
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`.
240
251
</details>
241
252
<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>
247
253
<summary>angularAddComponentRoute</summary>
248
254
249
255
For Angular page component schematic, will ask and add a route in the closest `.routes.ts` or `-routing.module.ts` file.
Copy file name to clipboardExpand all lines: walkthroughs/pro/configuration.md
+29-11Lines changed: 29 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,7 @@
3
3
Some common options can be customized in a one click with the configuration helper:
4
4
5
5
- Copy settings from angular.json
6
+
- Use legacy naming conventions
6
7
- Enable SCSS, Sass or Less styles
7
8
- Disable styles
8
9
- Enable external HTML templates
@@ -13,7 +14,6 @@ Some common options can be customized in a one click with the configuration help
13
14
- Disable block CSS display
14
15
- Enable shadow DOM
15
16
- Set the selector prefix
16
-
- Disable classes suffixes 💎
17
17
- Force NgModules 💎
18
18
- Force class interceptors 💎
19
19
- Force class guards and resolvers 💎
@@ -39,6 +39,7 @@ This extension stores the configuration in VS Code *workspace* settings. It mean
39
39
## Copy settings from angular.json
40
40
41
41
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`)
42
43
- SCSS, Sass or Less styles
43
44
- no style
44
45
- external HTML templates
@@ -48,6 +49,33 @@ This extension uses its own configuration. But if you have an *official and vali
48
49
49
50
<br>
50
51
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
+
51
79
## Enable SCSS, Sass or Less styles
52
80
53
81
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
150
178
151
179
<br>
152
180
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
-
163
181
## 💎 Force NgModules
164
182
165
183
In your Pro edition, if your project uses Angular <=13 or is not ready for standalone components yet.
Copy file name to clipboardExpand all lines: walkthroughs/pro/customSchematics.md
+13-7Lines changed: 13 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,7 @@ The extension uses Handlebars (`.hbs` files) as the templating syntax, which is
44
44
45
45
Available expressions:
46
46
-`{{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)
48
48
-`{{className}}` HelloWorld or HelloWorldSuffix (PascalCased user input)
49
49
-`{{camelName}}` helloWorld or helloWorldSuffix (camelCased user input)
50
50
-`{{options.someOption}}` value of an option defined in schematic.json
@@ -90,11 +90,22 @@ Optional properties:
90
90
-`description`: directly visible below the schematic label
91
91
-`tooltipDescription`: displayed when the user click on the "?" icon
92
92
-`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)
94
93
-`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)
95
94
-`features`: list of special features enabled for this schematic, see below
96
95
-`options`: list of options configurable by the user, see below
97
96
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
+
98
109
<br>
99
110
100
111
## Schematic options
@@ -229,11 +240,6 @@ Options reserved: `export`
229
240
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`.
230
241
</details>
231
242
<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>
237
243
<summary>angularAddComponentRoute</summary>
238
244
239
245
For Angular page component schematic, will ask and add a route in the closest `.routes.ts` or `-routing.module.ts` file.
0 commit comments