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

implements proposed max-props rule #2430

Merged
merged 9 commits into from
Jul 13, 2024

Conversation

kevsommer
Copy link
Contributor

This is a WIP PR that addresses issue #2429.

It implements the rule for both, the Composition and Options API.

However, I haven't been able to get the case for defineProps with type-only declaration to work.

<script setup lang="ts">
defineProps<{ prop1: string, prop2: string, }>();
</script>

@kevsommer kevsommer marked this pull request as ready for review June 25, 2024 08:27
@kevsommer
Copy link
Contributor Author

Should work for defineProps with type-only declaration now.

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, this looks quite good! 🙂
I only have some minor nitpicks.

docs/rules/max-props.md Outdated Show resolved Hide resolved
lib/rules/max-props.js Outdated Show resolved Hide resolved
lib/rules/max-props.js Outdated Show resolved Hide resolved
lib/rules/max-props.js Outdated Show resolved Hide resolved
tests/lib/rules/max-props.js Outdated Show resolved Hide resolved
@kevsommer
Copy link
Contributor Author

Thank you for the review! I have implemented the requested changes :)

@kevsommer kevsommer requested a review from FloEdelmann July 3, 2024 10:06
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 🙂

@FloEdelmann FloEdelmann requested a review from ota-meshi July 3, 2024 10:17
@FloEdelmann FloEdelmann linked an issue Jul 8, 2024 that may be closed by this pull request
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! Thanks!

@ota-meshi ota-meshi merged commit 291c6f9 into vuejs:master Jul 13, 2024
18 checks passed
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 Proposal: Maximum number of props
3 participants