Skip to content

useVueValidVBind

¥Summary

¥How to configure

biome.json
{
"linter": {
"rules": {
"nursery": {
"useVueValidVBind": "error"
}
}
}
}

¥Description

禁止 v-bind 指令缺少参数或修饰符无效。

¥Forbids v-bind directives with missing arguments or invalid modifiers.

此规则会在以下情况下报告 v-bind 指令:

¥This rule reports v-bind directives in the following cases:

  • 该指令没有参数。例如<div v-bind></div>

    ¥The directive does not have an argument. E.g. <div v-bind></div>

  • 该指令没有值。例如<div v-bind:aaa></div>

    ¥The directive does not have a value. E.g. <div v-bind:aaa></div>

  • 该指令包含无效修饰符。例如<div v-bind:aaa.bbb="ccc"></div>

    ¥The directive has invalid modifiers. E.g. <div v-bind:aaa.bbb="ccc"></div>

¥Examples

¥Invalid

<Foo v-bind />
<div v-bind></div>

¥Valid

<Foo v-bind:foo="foo" />

¥Related links