GeezerVison is showing github.com — feat(@schematics/angular): support different file name style guides in `ng new` by clydin · Pull Request #31053 · angular/angular-cli
Conversation
clydin
commented
Aug 27, 2025
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
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).
Fixes #30594
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
JeanMeche, Yberion, and michael-small reacted with rocket emoji
…n `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 angular#30594
…t schematics
Introduces a new `addTypeToClassName` option to the `component`, `directive`, and `service` schematics. This option controls whether the schematic's `type` (e.g., 'Component', 'Directive', 'Service') is appended to the generated class name.
When `fileNameStyleGuide` is set to `'2016'` in `ng new`, `addTypeToClassName` is automatically set to `false` for these schematics in `angular.json`. This ensures that while file names follow the 2016 style (e.g., `app.component.ts`), class names remain concise (e.g., `AppComponent` instead of `AppComponentComponent`), aligning with future selectorless template conventions.
This change provides greater flexibility in naming conventions, allowing users to choose between more verbose class names (default for 2025 style guide) and more concise ones (for 2016 style guide).
|
@clydin @dgp1130
just in case this are my scheme settings that i use:
"schematics": {
"@schematics/angular:component": {
"type": "component",
"style": "scss",
"standalone": false
},
"@schematics/angular:directive": {
"type": "directive",
"standalone": false
},
"@schematics/angular:service": {
"type": "service"
},
"@schematics/angular:guard": {
"typeSeparator": "."
},
"@schematics/angular:interceptor": {
"typeSeparator": "."
},
"@schematics/angular:module": {
"typeSeparator": "."
},
"@schematics/angular:pipe": {
"typeSeparator": ".",
"standalone": false
},
"@schematics/angular:resolver": {
"typeSeparator": "."
}
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
|
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|