src/content/docs/linter/rules/use-vue-hyphenated-attributes.mdx
import { Tabs, TabItem } from '@astrojs/starlight/components';
<Tabs> <TabItem label="HTML" icon="seti:html"> :::caution This rule is part of the [nursery](/linter/#nursery) group. This means that it is experimental and the behavior can change at any time. ::: ## Summary - Rule available since: `v2.3.6` - Diagnostic Category: [`lint/nursery/useVueHyphenatedAttributes`](/reference/diagnostics#diagnostic-category) - This rule has an [**unsafe**](/linter/#unsafe-fixes) fix. - The default severity of this rule is [**information**](/reference/diagnostics#information). - This rule belongs to the following domains: - [`vue`](/linter/domains#vue) - Sources: - Same as [`vue/attribute-hyphenation`](https://eslint.vuejs.org/rules/attribute-hyphenation){
"linter": {
"rules": {
"nursery": {
"useVueHyphenatedAttributes": "error"
}
}
}
}
Enforce hyphenated (kebab-case) attribute names in Vue templates.
Vue style guide recommends using hyphenated attribute (and prop) names in templates to keep them consistent and distinguish them from JavaScript identifiers written in camelCase/PascalCase.
This rule flags attributes that are detected as camelCase, PascalCase, CONSTANT_CASE, snake_case
or that contain any uppercase ASCII letter. It uses Biome's internal Case::identify helper.
Allowed:
data-test-id)class, id)<div fooBar="x"></div>
<MyComp :someProp="x" />
<div data-test-id="x"></div>
<div class="foo"></div>
<MyComp :some-prop="x" />
The rule supports the following options:
ignoreA list of attribute names that should be ignored by the rule (they won't be required to be hyphenated). Use this when you have a fixed set of camelCase / PascalCase prop names you intentionally allow.
{
"linter": {
"rules": {
"nursery": {
"useVueHyphenatedAttributes": {
"options": {
"ignore": [
"someProp",
"fooBar"
]
}
}
}
}
}
}
ignore)<div fooBar="x"></div>
ignoreTagsA list of tag names whose attributes should be skipped entirely. This is useful for third-party or internal components that deliberately expose non‑hyphenated prop names.
{
"linter": {
"rules": {
"nursery": {
"useVueHyphenatedAttributes": {
"options": {
"ignoreTags": [
"MyComp",
"AnotherWidget"
]
}
}
}
}
}
}
ignoreTags)<MyComp :someProp="x" />