Skip to content

Add vue/no-root-v-if rule #2138

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

Merged
merged 7 commits into from
May 10, 2023

Conversation

songpengyuan
Copy link
Contributor

@songpengyuan songpengyuan commented Apr 25, 2023

Added valid-v-if-template-root rule.

#1467

@songpengyuan songpengyuan force-pushed the feat/valid-template-root branch 2 times, most recently from b1782bb to c019c6e Compare April 25, 2023 08:37
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.

Looks good to me now. Thanks for the contribution!

@FloEdelmann FloEdelmann requested a review from ota-meshi April 25, 2023 10:07
@ota-meshi ota-meshi linked an issue Apr 30, 2023 that may be closed by this pull request
@ota-meshi
Copy link
Member

Thank you for this PR!
However, I think the new option is better implemented as a separate rule. Because the valid-template-root rule is aimed at catching problems early, I think the new check is aimed at checking for template definitions that don't fit your project's tastes.
What do you think?

CC @FloEdelmann

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.

@songpengyuan songpengyuan force-pushed the feat/valid-template-root branch from db45036 to 118568b Compare May 8, 2023 10:50
@songpengyuan songpengyuan changed the title fix(valid-template-root): no v-if on template root Added valid-v-if-template-root rule. May 8, 2023
@songpengyuan songpengyuan force-pushed the feat/valid-template-root branch from 118568b to cdd3ac9 Compare May 8, 2023 10:51
@songpengyuan songpengyuan force-pushed the feat/valid-template-root branch 2 times, most recently from 3916413 to fcbc816 Compare May 9, 2023 02:30
@songpengyuan songpengyuan force-pushed the feat/valid-template-root branch from fcbc816 to e1621ca Compare May 9, 2023 02:58
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.

Please run npm run update to regenerate the docs.

@FloEdelmann FloEdelmann changed the title Added valid-v-if-template-root rule. Add vue/no-root-v-if rule May 10, 2023
@songpengyuan songpengyuan force-pushed the feat/valid-template-root branch from f3be1fa to 9d6cf76 Compare May 10, 2023 11:37
@songpengyuan songpengyuan requested a review from ota-meshi May 10, 2023 11:40
@songpengyuan songpengyuan requested a review from FloEdelmann May 10, 2023 11:40
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.

Apart from two little suggestions, this looks fine by me. Thanks!

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 1a0bd29 into vuejs:master May 10, 2023
@songpengyuan
Copy link
Contributor Author

Thank you for your patient review.

@songpengyuan songpengyuan deleted the feat/valid-template-root branch May 11, 2023 01:26
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.

rule: no v-if on template root
3 participants