You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please describe what the rule should do:
The rule should allow developers to set a maximum number of props for Vue components in a project.
In my personal experience a high of number of props correlates strongly with complexity of a component.
Therfore, I think it would be a good addition to the vue eslint rule set, to give developers the option to enforce this rule.
What category should the rule belong to?
[x] Enforces code style (layout)
[ ] Warns about a potential error (problem)
[ ] Suggests an alternate way of doing something (suggestion)
[ ] Other (please specify:)
Provide 2-3 code examples that this rule should warn about:
<!-- BAD with maxProps set to 5 -->
<script setup>
defineProps({
prop1: String,
prop2: String,
prop3: String,
prop4: String,
prop5: String,
prop6: String,
prop7: String,
prop8: String,
})
</script>
<!-- GOOD with maxProps set to 5 -->
<script setup>
defineProps({
prop1: String,
prop2: String,
prop3: String,
})
</script>
Additional context
So far I haven't found a similar rule proposal.
But given the ruleset includes the vue/max-len rule, which similarly helps control the complexity of components, I think it would be a good addition.
The text was updated successfully, but these errors were encountered:
Please describe what the rule should do:
The rule should allow developers to set a maximum number of props for Vue components in a project.
In my personal experience a high of number of props correlates strongly with complexity of a component.
Therfore, I think it would be a good addition to the vue eslint rule set, to give developers the option to enforce this rule.
What category should the rule belong to?
[x] Enforces code style (layout)
[ ] Warns about a potential error (problem)
[ ] Suggests an alternate way of doing something (suggestion)
[ ] Other (please specify:)
Provide 2-3 code examples that this rule should warn about:
<!-- BAD with maxProps set to 5 --> <script setup> defineProps({ prop1: String, prop2: String, prop3: String, prop4: String, prop5: String, prop6: String, prop7: String, prop8: String, }) </script>
<!-- GOOD with maxProps set to 5 --> <script setup> defineProps({ prop1: String, prop2: String, prop3: String, }) </script>
Additional context
So far I haven't found a similar rule proposal.
But given the ruleset includes the vue/max-len rule, which similarly helps control the complexity of components, I think it would be a good addition.
The text was updated successfully, but these errors were encountered: