useVueValidVElse
Ce contenu n’est pas encore disponible dans votre langue.
Summary
Section titled “Summary”- Rule available since:
v2.3.6 - Diagnostic Category:
lint/nursery/useVueValidVElse - 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-else
- Same as
How to configure
Section titled “How to configure”{ "linter": { "rules": { "nursery": { "useVueValidVElse": "error" } } }}Description
Section titled “Description”Enforce valid usage of v-else.
This rule reports v-else directives in the following cases:
- The directive has an argument. E.g.
<div v-if="foo"></div><div v-else:aaa></div> - The directive has a modifier. E.g.
<div v-if="foo"></div><div v-else.bbb></div> - The directive has an attribute value. E.g.
<div v-if="foo"></div><div v-else="bar"></div> - The directive is on elements where the previous element doesn’t have
v-if/v-else-ifdirectives. E.g.<div v-else></div> - The directive is on elements which have
v-if/v-else-ifdirectives. E.g.<div v-if="foo" v-else></div>
Examples
Section titled “Examples”Invalid
Section titled “Invalid”<div v-else:arg></div><div v-else.mod></div><div v-else="value"></div><div v-else></div><div v-if="foo" v-else></div><div v-if="foo"></div><div v-else></div><div v-if="foo"></div><div v-else-if="bar"></div><div v-else></div>Related links
Section titled “Related links”Copyright (c) 2023-present Biome Developers and Contributors.