-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Labels
Description
Describe the bug
The vue-mess-detector plugin is triggering the "Big v-if" rule for my component, but I don't believe the v-if condition is large or complex enough to warrant this warning. The rule is being triggered on a relatively simple condition.
To Reproduce
- What is the exact code you are analyzing?
<script setup lang="ts">
defineProps({
fieldError: {
type: String as () => string,
default: () => undefined,
},
generalErrors: {
type: Array as () => string[],
default: () => [],
},
})
</script>
<template>
<ion-text
v-if="fieldError"
class="ml-4 text-red-500"
>
{{ fieldError }}
</ion-text>
<div
v-if="generalErrors.length"
class="text-red-500 mt-4"
>
<ul>
<li
v-for="(error) in generalErrors"
:key="error"
>
{{ error }}
</li>
</ul>
</div>
</template>
- What is the output you are getting?
- rrd ~ big v-if
src/components/FormErrors.vue
👉 Big v-if can be moved out to its own component. See: https://vue-mess-detector.webmania.cc/rules/rrd/big-vif.html
line #9 has a v-if with 13 lines 🚨
Expected behavior
I expect the rule to not be triggered since the v-if condition is not that complex or large. The generalErrors condition is a simple check for an array length, and it does not seem to meet the threshold for a "big v-if" as per the rule.
Screenshots
N/A
Used version number of vue-mess-detector:
0.65.0
Used version number of node & yarn:
[email protected]
Additional context