-
-
Notifications
You must be signed in to change notification settings - Fork 685
New: Add vue/single-attribute-single-line
rule
#1431
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
New: Add vue/single-attribute-single-line
rule
#1431
Conversation
… to be on a single line Signed-off-by: Jackson Gross <jackson.gross@gmail.com>
Thank you for PR. But I think |
I did consider catering for this behaviour as an option to the Not sure how this has been approached in the past where rules might collide based on options from another rule, so was hoping I could find some insight into that, and possibly some suggestions to improve this, and whether it would be an issue incorporating this rule. |
Even if it's opt-in, I think rule conflicts can confuse users. I think we most avoid conflicts within a single plugin. I'm not a fan of your style, so I'm not familiar with the details, I think we can abolish the |
By the way, I don't think your current rule can resolve the error for the following one attribute: <MyComponent :lorem="{
prop: 42
}"/> |
Yeah that actually sounds like a better idea if we want to avoid conflicts but provide the functionality of both rules. Considering that the |
ah yes good catch! |
I was searching a rule like this, but forcing some max number of attributes into single line, like 3 attributes is a single line, 4 and more multiline. Looks like this was not merged? |
@vedmant should be able to achieve that with https://eslint.vuejs.org/rules/max-attributes-per-line.html |
@jacksongross I'm not able to make it turn multiline tags like: <DisclosureButton
class="flex items-center text-lg font-medium text-left"
/> to single line <DisclosureButton class="flex items-center text-lg font-medium text-left" /> It works only opposite direction, from single line to multi line. |
This PR adds the
vue/single-attribute-single-line
rule.Idea based on #1110
First time contributing so hopefully I've followed the rules here 😄