Skip to content

CLI does not generate suffix for components by default #30566

Description

@aron123

Command

generate

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

19.1.0

Description

When I try to generate a new component, files are expected to have a suffix .component and class name expected to have a suffix Component.

However in version 20.0.3, these suffixes are not generated by default:

> ng g c login
CREATE src/app/login/login.spec.ts (544 bytes)
CREATE src/app/login/login.ts (193 bytes)
CREATE src/app/login/login.scss (0 bytes)
CREATE src/app/login/login.html (21 bytes)

This also applies to services. I haven't tried other sub-commands.

I use Windows 11 and Powershell 7.

Minimal Reproduction

ng new test
cd test
ng g c login

Exception or Error

Your Environment

20.0.3

Anything else relevant?

As a workaround, using the --type component option when generating the components is working.

Activity

  1. alan-agius4 commented on Jun 19, 2025

    @alan-agius4
    Collaborator

    This is expected as per changes to the style guide that were introduced in version 20.

    See: https://angular.dev/style-guide

  2. aron123 commented on Jun 19, 2025

    @aron123
    Author
  3. added
    area: docs
    freq1: low
    on Jun 19, 2025
  4. added theissue type on Jun 19, 2025
  5. added 3 commits that reference this issue on Jun 20, 2025
    d6d5b13
    ae77952
    5f67c24
  6. added 2 commits that reference this issue on Jun 20, 2025
    caf70d8
    03aff1e
  7. angular-automatic-lock-bot commented on Jul 21, 2025

    @angular-automatic-lock-bot

    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.

  8. locked and limited conversation to collaborators on Jul 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: @schematics/angulararea: docsfreq1: lowseverity1: confusing

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions