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

Auto-fix for vue/component-tags-order #1811

Merged
merged 4 commits into from Mar 6, 2022
Merged

Conversation

lsdsjy
Copy link
Contributor

@lsdsjy lsdsjy commented Mar 2, 2022

Fixes #1463.
This PR reflects the comments from @ota-meshi in #1512 . It yields a fix for each reported error, so eslint-disable comments work normally. Added a test case for eslint-disable comment.

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 this!

Looks fine from my side. I have just one minor suggestion.

tests/lib/rules/component-tags-order.js Outdated Show resolved Hide resolved
@lsdsjy
Copy link
Contributor Author

lsdsjy commented Mar 3, 2022

Wait, there's something I can't determine here. If there is a comment right above the element start tag, should we move the comment too? For example,

<style></style>
<!-- this is a comment -->
<script>
</script>

Should we move the comment together with the <script> element? What if the comment is a eslint-disable comment, like

<style></style>
<!-- eslint-disable-next-line vue/multi-word-component-names -->
<script>
export default {
  name: 'Comp'
}
</script>

@FloEdelmann @ota-meshi Would you have a look at this plz?

@lsdsjy lsdsjy marked this pull request as draft March 3, 2022 03:22
@FloEdelmann
Copy link
Member

Moving a comment together with the following block would be nice, regardless of whether it is an eslint-disable comment or not. However, I don't think that this would be merge-blocking for me.

@lsdsjy lsdsjy marked this pull request as ready for review March 3, 2022 07:46
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! I have a change request for testcase.

tests/lib/rules/component-tags-order.js Outdated Show resolved Hide resolved
tests/lib/rules/component-tags-order.js Outdated Show resolved Hide resolved
lsdsjy and others added 2 commits March 4, 2022 11:12
Apply suggestions from code review

Co-authored-by: Yosuke Ota <otameshiyo23@gmail.com>
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.

LGTM! Thank you!

@ota-meshi ota-meshi merged commit 8f09420 into vuejs:master Mar 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

vue/component-tags-order - Could it be made fixable?
4 participants