-
Notifications
You must be signed in to change notification settings - Fork 235
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
component-selector: kebab-casing of components without prefix #192
Comments
Yes, the error message is not correct. |
Is it only the error message? Or shouldn't there be any error at all? |
Probably the rule doesn't validate the selector properly. |
Actually, this is against the standard - Web Components must have at least one dash in their name. The error message is not correct. I'll update it to:
I know it's a bit more restrictive so we can come up with a better solution in future. |
@mgechev |
@HFTSOL What about disabling the rule with tslint-aware comments in the special cases? |
@HFTSOL the dash is required for all custom elements. As @lazarljubenovic suggested you can disable the rule with a comment. |
@lazarljubenovic @mgechev It would be great if the rules could account for the desired modification of the typical standard. We still want the name validation on all selectors, but we can't have the requirement for the dash since it is in not required for our custom elements. I understand if it's industry standard, but you already have a significant number of alterations that allow for bending of those standards to account for custom scenarios. I don't see that this option would be out of place. I hope this isn't asking too much. We appreciate what you've built so far and would like to be able to fully utilize it in our applications. |
@HFTSOL That's why you have config files like |
atm it's not possible to keep just part of the selector validating rules - mgechev/codelyzer#192
what if the app location is replaced by [ ] in component-selector |
change dog to app-dog |
Any chance this will be happening? I don't want to use a prefix, as it doesn't make sense to use one in my application and the linting error is really annoying. |
It doesn't appear they intend to allow people to use standards that differ from their own. For this reason, and many others, I just disable tslint entirely on every project since it causes more problems than it solves. |
It is not about a standard that differs from their own. You can find it here: https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name
|
A mi me aparecía ese error cuando borraba la imagen de Angular en el app.component.html, pero me fui al app.module.ts y lo volví a compilar si efectuar ningún cambio y se desapareció el mensaje. |
What is the tslint rule's name for disable? |
it's |
Hey Minko
for the following component I do get a linting error:
Rule:
Linting result: The selector of the component "DogComponent" should be named kebab-case (https://goo.gl/mBg67Z)
In my opinion, the selector dog is perfectly kebab cased. When I change the selector to "d-og" it does work - but shouldn't it be possible to have selectors without dash for components that are named totally lowercase?
Thanks and Kind Regards
Joachim
The text was updated successfully, but these errors were encountered: