Skip to content

Issues in apps generated with --file-name-style-guide=2016 flag #31830

@pawelfras

Description

@pawelfras

Command

new

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

No response

Description

There are few issues in OOTB apps scaffolded with --file-name-style-guide=2016 flag.

  1. Application with standalone components:
  • The path in app.component.spec.ts refers to a path without the suffix .component, and thus to a non-existent file:
    Image
  1. Application with NgModules:
  • Import in app.component.spec.ts refers to a path without the suffix .component, and thus to a non-existing file:
    Image

  • Import in app-module.ts refers to a path without the suffix .component, and thus to a non-existing file:
    Image

  • File names app-model.ts and app-routing-model.ts use dashes as type separators, even though when generating the application with the flag --file-name-style-guide=2016, the configuration "typeSeparator: "." for module schematics:
    Image

    Mentioned files should have names app.module.ts and app-routing.module.ts instead

Minimal Reproduction

For application with standalone components:

npx @angular/cli@21.0.0-rc.4 new my-app --file-name-style-guide=2016

For application with NgModules:

npx @angular/cli@21.0.0-rc.4 new my-app --file-name-style-guide=2016 --standalone=false

Exception or Error


Your Environment

_                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI       : 21.0.0-rc.4
Angular           : 21.0.0-rc.2
Node.js           : 22.12.0
Package Manager   : yarn 1.22.22
Operating System  : darwin arm64

┌───────────────────────────┬───────────────────┬───────────────────┐
│ Package                   │ Installed Version │ Requested Version │
├───────────────────────────┼───────────────────┼───────────────────┤
│ @angular/build            │ 21.0.0-rc.4       │ ^21.0.0-rc.4      │
│ @angular/cli              │ 21.0.0-rc.4       │ ^21.0.0-rc.4      │
│ @angular/common           │ 21.0.0-rc.2       │ ^21.0.0-next.0    │
│ @angular/compiler         │ 21.0.0-rc.2       │ ^21.0.0-next.0    │
│ @angular/compiler-cli     │ 21.0.0-rc.2       │ ^21.0.0-next.0    │
│ @angular/core             │ 21.0.0-rc.2       │ ^21.0.0-next.0    │
│ @angular/forms            │ 21.0.0-rc.2       │ ^21.0.0-next.0    │
│ @angular/platform-browser │ 21.0.0-rc.2       │ ^21.0.0-next.0    │
│ @angular/router           │ 21.0.0-rc.2       │ ^21.0.0-next.0    │
│ rxjs                      │ 7.8.2             │ ~7.8.0            │
│ typescript                │ 5.9.3             │ ~5.9.2            │
│ vitest                    │ 4.0.9             │ ^4.0.8            │
└───────────────────────────┴───────────────────┴───────────────────┘

Anything else relevant?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions