Skip to content

CLI does not generate suffix for components by default #30566

@aron123

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

alan-agius4

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

aron123

aron123 commented on Jun 19, 2025

@aron123
Author

Thanks. Then the reference documentation is not up-to-date: https://angular.dev/cli/generate/component

added theissue type on Jun 19, 2025
added a commit that references this issue on Jun 20, 2025
d6d5b13
added 2 commits that reference this issue on Jun 20, 2025
ae77952
5f67c24
added 2 commits that reference this issue on Jun 20, 2025
caf70d8
03aff1e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @aron123@alan-agius4

      Issue actions

        CLI does not generate suffix for components by default · Issue #30566 · angular/angular-cli