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

Add new attributes order for dynamic and static props #2068

Merged

Conversation

GreatGui
Copy link
Contributor

@GreatGui GreatGui commented Dec 31, 2022

This PR adds [ 'ATTR_STATIC', 'ATTR_DYNAMIC', 'ATTR_SHORTHAND_BOOL' ] attribute to vue/attributes-order. And OTHER_ATTR become an alias for [ 'ATTR_STATIC', 'ATTR_DYNAMIC', 'ATTR_SHORTHAND_BOOL' ]

close #1728, close #1870

Copy link
Member

@FloEdelmann FloEdelmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice, thank you! I don't know why the Netlify deployment is failing, but it doesn't seem to be related to your changes. @ota-meshi, could you please have a look at that?

@GreatGui, I commented a few smaller issues. Also, have you seen #1870? It would be great to implement both options in one pull request to avoid a breaking change.

So, would you fancy also implementing the following to fix #1870?

  1. OTHER_ATTR_STATIC should only match non-shorthand attributes (e.g. foo="bar" but not foo on its own).
  2. Introduce new option OTHER_ATTR_SHORTHAND_BOOL that matches shorthand boolean attributes.
  3. OTHER_ATTR should be an alias for [OTHER_ATTR_DYNAMIC, OTHER_ATTR_STATIC, OTHER_ATTR_SHORTHAND_BOOL].

lib/rules/attributes-order.js Outdated Show resolved Hide resolved
lib/rules/attributes-order.js Outdated Show resolved Hide resolved
lib/rules/attributes-order.js Outdated Show resolved Hide resolved
lib/rules/attributes-order.js Outdated Show resolved Hide resolved
docs/rules/attributes-order.md Outdated Show resolved Hide resolved
lib/rules/attributes-order.js Outdated Show resolved Hide resolved
lib/rules/attributes-order.js Show resolved Hide resolved
@GreatGui
Copy link
Contributor Author

GreatGui commented Jan 3, 2023

@FloEdelmann I corrected everything I could and added the ATTR_SHORTHAND_BOOL

lib/rules/attributes-order.js Outdated Show resolved Hide resolved
lib/rules/attributes-order.js Outdated Show resolved Hide resolved
lib/rules/attributes-order.js Outdated Show resolved Hide resolved
lib/rules/attributes-order.js Show resolved Hide resolved
@FloEdelmann
Copy link
Member

FloEdelmann commented Jan 11, 2023

@GreatGui It would be good to get this into the next version, could you please check the open threads? If you don't have time, I'll do the rest.

@GreatGui
Copy link
Contributor Author

@FloEdelmann fixed the points and added the OTHER_ATTR check

Copy link
Member

@ota-meshi ota-meshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this PR! LGTM!

Copy link
Member

@FloEdelmann FloEdelmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for implementing all the feedback!

@FloEdelmann FloEdelmann merged commit 0b816dc into vuejs:master Jan 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants