Skip to content

noVueTextareaMustache (HTML)

Language HTML
biome.json
{
"linter": {
"rules": {
"nursery": {
"noVueTextareaMustache": "error"
}
}
}
}

Disallow {{ }} text interpolation inside a Vue <textarea>.

In most elements, Vue replaces {{ expression }} with the value of the expression. Vue doesn’t support this inside a <textarea>. To show a value in a textarea and keep it up to date, bind it with v-model instead.

Vue doesn’t process {{ }} inside an element that has v-pre, or inside its children, so the rule ignores those textareas.

<template>
<textarea>{{ message }}</textarea>
</template>
code-block.vue:2:13 lint/nursery/noVueTextareaMustache ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

✖ {{ }} can't be used inside a <textarea>.

1 │ <template>
> 2 │ <textarea>{{ message }}</textarea>
│ ^^^^^^^^^^^^^
3 │ </template>
4 │

ℹ Vue doesn't support text interpolation inside a textarea.

ℹ Bind the value of the textarea with v-model instead.

ℹ This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information.

<template>
<textarea v-model="message"></textarea>
<textarea v-pre>{{ message }}</textarea>
</template>