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

Creating a component with prefix makes linting to fail #5794

Closed
jmendiara opened this issue Apr 2, 2017 · 1 comment · Fixed by #5908
Closed

Creating a component with prefix makes linting to fail #5794

jmendiara opened this issue Apr 2, 2017 · 1 comment · Fixed by #5908
Labels
effort1: easy (hours) feature Issue that requests a new feature P5 The team acknowledges the request but does not plan to address it, it remains open for discussion

Comments

@jmendiara
Copy link

jmendiara commented Apr 2, 2017

Bug Report or Feature Request (mark with an x)

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

Versions.

$ ng --version
@angular/cli: 1.0.0
node: 6.10.0
os: darwin x64
@angular/animations: 4.0.1
@angular/common: 4.0.1
@angular/compiler: 4.0.1
@angular/core: 4.0.1
@angular/forms: 4.0.1
@angular/http: 4.0.1
@angular/material: 2.0.0-beta.2
@angular/platform-browser: 4.0.1
@angular/platform-browser-dynamic: 4.0.1
@angular/router: 4.0.1
@angular/cli: 1.0.0
@angular/compiler-cli: 4.0.1

Repro steps.

$ ng g m babies --routing
$ ng g c babies/detail --prefix babies

this generates

@Component({
  selector: 'babies-detail', // <- expected selector. OK!
  templateUrl: './detail.component.html',
  styleUrls: ['./detail.component.scss']
})
//...

But now, the linting fails!

The log given by the failure.

$ npm run lint
# ...
/src/app/babies/detail/detail.component.ts[4, 13]: The selector of the component 
"DetailComponent" should have one of the prefixes: app (https://goo.gl/cix8BY)

Lint errors found in the listed files.

Desired functionality.

Creating a component with a custom prefix should update tslint.json with the provided one
from

{
    "component-selector": [true, "element", "app", "kebab-case"],
}

to

{    
    "component-selector": [true, "element", ["app", "babies"], "kebab-case"],
}

Mention any other details that might be useful.

@sumitarora sumitarora self-assigned this Apr 4, 2017
@filipesilva filipesilva added effort1: easy (hours) P5 The team acknowledges the request but does not plan to address it, it remains open for discussion feature Issue that requests a new feature labels May 4, 2017
dond2clouds pushed a commit to d2clouds/speedray-cli that referenced this issue Apr 23, 2018
@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 Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
effort1: easy (hours) feature Issue that requests a new feature P5 The team acknowledges the request but does not plan to address it, it remains open for discussion
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants