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 vue/no-root-v-if rule #2138

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

lib/rules/valid-template-root.js Outdated Show resolved Hide resolved
lib/rules/valid-template-root.js Outdated Show resolved Hide resolved
tests/lib/rules/valid-template-root.js Outdated Show resolved Hide resolved
@songpengyuan songpengyuan force-pushed the feat/valid-template-root branch 2 times, most recently from b1782bb to c019c6e Compare April 25, 2023 08:37
docs/rules/valid-template-root.md Outdated Show resolved Hide resolved
tests/lib/rules/valid-template-root.js Outdated Show resolved Hide resolved
tests/lib/rules/valid-template-root.js Outdated Show resolved Hide resolved
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!

@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 changed the title fix(valid-template-root): no v-if on template root Added valid-v-if-template-root rule. May 8, 2023
docs/rules/valid-v-if-template-root.md Outdated Show resolved Hide resolved
lib/rules/valid-v-if-template-root.js Outdated Show resolved Hide resolved
lib/rules/valid-v-if-template-root.js Outdated Show resolved Hide resolved
tests/lib/rules/valid-v-if-template-root.js Outdated Show resolved Hide resolved
lib/rules/valid-v-if-template-root.js Outdated Show resolved Hide resolved
@songpengyuan songpengyuan force-pushed the feat/valid-template-root branch 2 times, most recently from 3916413 to fcbc816 Compare May 9, 2023 02:30
tests/lib/rules/no-root-v-if.js Outdated Show resolved Hide resolved
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.

docs/rules/no-root-v-if.md Outdated Show resolved Hide resolved
tests/lib/rules/no-root-v-if.js Outdated Show resolved Hide resolved
lib/rules/no-root-v-if.js Outdated Show resolved Hide resolved
@FloEdelmann FloEdelmann changed the title Added valid-v-if-template-root rule. Add vue/no-root-v-if rule May 10, 2023
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!

docs/rules/no-root-v-if.md Outdated Show resolved Hide resolved
docs/rules/no-root-v-if.md Outdated Show resolved Hide resolved
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
14 checks passed
@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