useVueValidVIf
Ce contenu n’est pas encore disponible dans votre langue.
Summary
Section titled “Summary”- Rule available since:
v2.3.6 - Diagnostic Category:
lint/nursery/useVueValidVIf - This rule doesn’t have a fix.
- The default severity of this rule is information.
- This rule belongs to the following domains:
- Sources:
- Same as
vue/valid-v-if
- Same as
How to configure
Section titled “How to configure”{ "linter": { "rules": { "nursery": { "useVueValidVIf": "error" } } }}Description
Section titled “Description”Enforces valid v-if usage for Vue templates.
This rule reports v-if directives in following cases:
- The directive has an argument. E.g.
<div v-if:aaa="foo"></div> - The directive has a modifier. E.g.
<div v-if.bbb="foo"></div> - The directive does not have an attribute value. E.g.
<div v-if></div> - The same element also has
v-elseorv-else-if. E.g.<div v-if="foo" v-else></div>
Examples
Section titled “Examples”Invalid
Section titled “Invalid”<div v-if:aaa="foo"></div><div v-if.bbb="foo"></div><div v-if></div><div v-if="foo" v-else></div><div v-if="foo" v-else-if="bar"></div><div v-if="ok"></div><div v-if="a < b"></div><div v-if="a"></div><div v-else-if="b"></div><div v-else></div>Related links
Section titled “Related links”Copyright (c) 2023-present Biome Developers and Contributors.