Skip to content

vue/component-tags-order - Could it be made fixable? #1463

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

Closed
Ariane-B opened this issue Mar 23, 2021 · 3 comments · Fixed by #1811
Closed

vue/component-tags-order - Could it be made fixable? #1463

Ariane-B opened this issue Mar 23, 2021 · 3 comments · Fixed by #1811

Comments

@Ariane-B
Copy link

Ariane-B commented Mar 23, 2021

What rule do you want to change?

vue/component-tags-order

Does this change cause the rule to produce more or fewer warnings?

No

How will the change be implemented? (New option, new default behavior, etc.)?

I wish this rule could be auto-changed on --fix

Please provide some example code that this change will affect:

None. Rule stays the same.

What does the rule currently do for this code?

No changes.

What will the rule do after it's changed?

On --fix, it will swap a single-file component's main tags around so they're in the order prescribed by the rule.

Additional context

I've been thinking of putting together a regex that would allow me to run a mass replacement on my project to ensure all tags are in the proper order, and it seems like it's probably possible. If a regex can do it, it makes me think that it's probably possible too, and easier, for a tool that "understands" the code like ESLint.

@zoy-l
Copy link

zoy-l commented Jan 25, 2022

Can I handle this?

@Ariane-B
Copy link
Author

I certainly wouldn't complain.

@FloEdelmann
Copy link
Member

@l-zoy Sure, go for it! Please don't use regexes though, but an AST-based solution. That might make implementation more difficult, but you can give it a try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants