pageClass | sidebarDepth | title | description | since |
---|---|---|---|---|
rule-details |
0 |
vue/valid-v-is |
enforce valid `v-is` directives |
v7.0.0 |
enforce valid
v-is
directives
- ⚙️ This rule is included in all of
"plugin:vue/vue3-essential"
,*.configs["flat/essential"]
,"plugin:vue/vue3-strongly-recommended"
,*.configs["flat/strongly-recommended"]
,"plugin:vue/vue3-recommended"
and*.configs["flat/recommended"]
.
This rule checks whether every v-is
directive is valid.
This rule reports v-is
directives in the following cases:
- The directive has that argument. E.g.
<div v-is:aaa="foo"></div>
- The directive has that modifier. E.g.
<div v-is.bbb="foo"></div>
- The directive does not have that attribute value. E.g.
<div v-is></div>
- The directive is on Vue-components. E.g.
<MyComponent v-is="foo"></MyComponent>
<template>
<!-- ✓ GOOD -->
<tr v-is="'blog-post-row'"></tr>
<tr v-is="foo"></tr>
<!-- ✗ BAD -->
<tr v-is:a="foo"></tr>
<tr v-is.m="foo"></tr>
<tr v-is></tr>
<tr v-is=""></tr>
<MyComponent v-is="foo" />
</template>
::: warning Note This rule does not check syntax errors in directives because it's checked by vue/no-parsing-error rule. :::
Nothing.
This rule was introduced in eslint-plugin-vue v7.0.0