-
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
Support for multiple selector type in directive-selector and component-selector rules #290
Comments
It makes sense to be more configurable. I'll try to introduce it as part of 3.0.0. |
Hi. Thanks for taking care of this. Currently, the schema there says:
What is the syntax to allow both attribute selector and element-based selector?
Can I submit a pull request to the docs? Thanks! |
The schema has different format compared to the example. This seems corrext to me. |
@mgechev Not sure what you mean. Consider:
either -- http://codelyzer.com/rules/component-selector/ It does not mention the option of allowing both. Another thing is how to use it to allow both: is it:
? I guess you understood that I confused/assumed that the schema should look the same as the example :). Which is not the case. I think the schema in the doc should have |
Yes, "either" might not be the most appropriate. I'll be happy to merge a more detailed description of the configuration options if you want to open a PR. |
master...karol-depka:patch-1 - wdyt? |
LGTM! Open the PR so I can merge. |
@mgechev , can you provide an example of how the rule should look like to set up kebab style for elements and camel case for attributes, please? |
The rules directive-selector and component-selector should allow the directives/components to accept both element and attribute type . With the rule definition, I'm forced to choose between an element and an attribute because If I don't respect it I get the following warning: "this.typeValidator is not function"
I would be great if I can set this type as null (so it would accept elements and attributes) or as a string/array with the both types accepted. For example:
"directive-selector": [true, null, "bm", "kebab-case"]
or
"directive-selector": [true, "attribute|element", "bm", "kebab-case"]
or
"directive-selector": [true, [ "attribute", "element" ], "bm", "kebab-case"]
Thanks for taking a look at it :)
The text was updated successfully, but these errors were encountered: