GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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

@clydin clydin commented Aug 27, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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
All reactions
  • 🚀 3 reactions
@clydin clydin added the target: major This PR is targeted for the next major release label Aug 27, 2025
@angular-robot angular-robot Bot added detected: feature PR contains a feature commit area: @schematics/angular labels Aug 27, 2025
@clydin
clydin marked this pull request as ready for review August 27, 2025 15:57
@clydin clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label Aug 27, 2025
@clydin
clydin force-pushed the ng-schematics/ng-new-style-guide branch 3 times, most recently from 5e447cd to 00bca37 Compare August 28, 2025 15:40
@clydin
clydin requested a review from alan-agius4 August 28, 2025 16:27
clydin added 2 commits August 28, 2025 12:28
@clydin
feat(@schematics/angular): support different file name style guides i…
f85ac76
…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
@clydin
feat(@schematics/angular): Add addTypeToClassName option to relevan…
13b34ce
…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
clydin force-pushed the ng-schematics/ng-new-style-guide branch from 00bca37 to 13b34ce Compare August 28, 2025 16:28
@clydin
clydin requested review from dgp1130 and removed request for alan-agius4 August 29, 2025 00:43
@giacomo

giacomo commented Aug 29, 2025

Copy link
Copy Markdown

@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": "."
                }
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

alan-agius4
alan-agius4 reviewed Aug 29, 2025
View reviewed changes
Comment thread packages/schematics/angular/component/schema.json Resolved

Uh oh!

There was an error while loading. Please reload this page.

alan-agius4
alan-agius4 approved these changes Sep 2, 2025
View reviewed changes
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Sep 2, 2025
@clydin
clydin merged commit e417c89 into angular:main Sep 2, 2025
@clydin
clydin deleted the ng-schematics/ng-new-style-guide branch September 2, 2025 12:08
@clydin
clydin removed the request for review from dgp1130 September 2, 2025 12:08
@JeanMeche JeanMeche mentioned this pull request Sep 5, 2025
Is Angular becoming React? angular/angular#63609
Closed
@angular-automatic-lock-bot

angular-automatic-lock-bot Bot commented Oct 3, 2025

Copy link
Copy Markdown

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators Oct 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@alan-agius4 alan-agius4 alan-agius4 approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

action: merge The PR is ready for merge by the caretaker area: @schematics/angular detected: feature PR contains a feature commit target: major This PR is targeted for the next major release

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

CLI: [command new] add option to enable previous suffix generation on create

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@clydin @giacomo @alan-agius4
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.