rrd108 / vue-mess-detector

A static code analysis tool for detecting code smells and best practice violations in Vue.js and Nuxt.js projects
MIT License
250 stars 9 forks source link

False Positive for 'Big v-if' Rule #466

Open bchanez opened 4 days ago

bchanez commented 4 days ago

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

  1. 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>

2. What is the output you are getting?

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: pnpm@9.14.2

Additional context

rrd108 commented 3 days ago

Do you want to add a faling test or a fix?