Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent numbers in module/pipe names #12868

Closed
nikita-fuchs opened this issue Nov 5, 2018 · 1 comment · Fixed by #23485
Closed

Prevent numbers in module/pipe names #12868

nikita-fuchs opened this issue Nov 5, 2018 · 1 comment · Fixed by #23485
Labels
2022Q3 Fixit Candidates for the Q3 2022 fix-it area: @schematics/angular freq1: low Only reported by a handful of users who observe it rarely severity2: inconvenient type: bug/fix workaround1: obvious
Milestone

Comments

@nikita-fuchs
Copy link

nikita-fuchs commented Nov 5, 2018

Bug Report or Feature Request (mark with an x)

- [X] bug report -> please search issues before submitting
- [ ] feature request

Command (mark with an x)

- [ ] new
- [ ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [X] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Versions

Angular CLI: 6.2.1
Node: 8.11.2
OS: darwin x64
Angular: 6.1.7
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, platform-server, router

Package Version

@angular-devkit/architect 0.8.1
@angular-devkit/build-angular 0.8.1
@angular-devkit/build-webpack 0.8.1
@angular-devkit/core 0.8.1
@angular-devkit/schematics 0.8.1
@angular/cdk 6.4.7
@angular/cli 6.2.1
@angular/material 6.4.7
@schematics/angular 0.8.1
@schematics/update 0.8.1
rxjs 6.3.2
typescript 2.9.2
webpack 4.19.0

Repro steps

ng generate pipe 18decimals

The log given by the failure

Everything performs smoothly. The pipe is created, but referencing modules with numbers in name creates problems, like here, referencing names with numbers.

import { 18decimalsPipe } from './18decimals.pipe';

describe('18decimalsPipe', () => {
  it('create an instance', () => {
    const pipe = new 18decimalsPipe();
    expect(pipe).toBeTruthy();
  });
});

Desired functionality

The cli should disallow names with numbers to prevent issues.

@alan-agius4 alan-agius4 added freq1: low Only reported by a handful of users who observe it rarely severity2: inconvenient area: @schematics/angular labels Nov 6, 2018
@ngbot ngbot bot added this to the needsTriage milestone Nov 6, 2018
@ngbot ngbot bot modified the milestones: needsTriage, Backlog May 26, 2020
@alan-agius4 alan-agius4 added the 2022Q3 Fixit Candidates for the Q3 2022 fix-it label Jul 1, 2022
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Jul 1, 2022
With this change we prevent creating classes with invalid characters.

Closes angular#12868
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Jul 1, 2022
With this change we prevent creating classes with invalid characters.

Closes angular#12868
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Jul 1, 2022
With this change we prevent creating classes with invalid characters.

Closes angular#12868
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Jul 1, 2022
…parallel to `RoutingModule`

Prior to this commit, we defined routes in two places example:
```ts
@NgModule({
  declarations: [
    HomeComponent
  ],
  imports: [
    CommonModule,
    RouterModule.forChild(routes),
    HomeRoutingModule
  ]
})
export class HomeModule { }
```

Closes angular#12868
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Jul 1, 2022
…o `RoutingModule`

Prior to this commit, we defined routes in two places example:
```ts
@NgModule({
  declarations: [
    HomeComponent
  ],
  imports: [
    CommonModule,
    RouterModule.forChild(routes),
    HomeRoutingModule
  ]
})
export class HomeModule { }
```

Closes angular#12868
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Jul 3, 2022
With this change we prevent creating classes with invalid characters.

Closes angular#12868
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Jul 21, 2022
With this change we prevent creating classes with invalid characters.

Closes angular#12868
clydin pushed a commit that referenced this issue Jul 21, 2022
With this change we prevent creating classes with invalid characters.

Closes #12868
clydin pushed a commit that referenced this issue Jul 21, 2022
With this change we prevent creating classes with invalid characters.

Closes #12868

(cherry picked from commit e995bda)
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Aug 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
2022Q3 Fixit Candidates for the Q3 2022 fix-it area: @schematics/angular freq1: low Only reported by a handful of users who observe it rarely severity2: inconvenient type: bug/fix workaround1: obvious
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants