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
feat(@schematics/angular): support different file name style guides in ng new
Introduces the ability to configure the file naming convention for generated files directly within the `ng new` schematic. This allows users to create new workspaces that adhere to the 2016 style guide conventions, as an alternative to the default 2025 style guide. For more information, see the Angular Style Guide (https://angular.dev/style-guide).
When a user runs `ng new --file-name-style-guide 2016`:
- The `ng-new` schematic passes the style guide option down to the `application` sub-schematic.
- The `application` schematic configures the `schematics` section of the new `angular.json` to use the 2016 naming conventions for future `ng generate` commands.
- The `application` schematic generates the initial application files with the appropriate suffixes (e.g., `app.component.ts`).
This addresses community feedback requesting a way to maintain the previous file naming structure for consistency in existing projects and workflows.
Fixes#30594
Copy file name to clipboardExpand all lines: packages/schematics/angular/application/schema.json
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -127,6 +127,12 @@
127
127
"x-prompt": "Do you want to create a 'zoneless' application without zone.js?",
128
128
"type": "boolean",
129
129
"default": false
130
+
},
131
+
"fileNameStyleGuide": {
132
+
"type": "string",
133
+
"enum": ["2016", "2025"],
134
+
"default": "2025",
135
+
"description": "The file naming convention to use for generated files. The '2025' style guide (default) uses a concise format (e.g., `app.ts` for the root component), while the '2016' style guide includes the type in the file name (e.g., `app.component.ts`). For more information, see the Angular Style Guide (https://angular.dev/style-guide)."
"description": "The file naming convention to use for generated files. The '2025' style guide (default) uses a concise format (e.g., `app.ts` for the root component), while the '2016' style guide includes the type in the file name (e.g., `app.component.ts`). For more information, see the Angular Style Guide (https://angular.dev/style-guide)."
0 commit comments