noVueTextareaMustache (HTML)
Language HTML
Summary
Section titled “Summary”- Rule available since:
v2.6.5 - Diagnostic Category:
lint/nursery/noVueTextareaMustache - This rule doesn’t have a fix.
- The default severity of this rule is error.
- This rule belongs to the following domains:
- Sources:
- Same as
vue/no-textarea-mustache
- Same as
How to configure
Section titled “How to configure”{ "linter": { "rules": { "nursery": { "noVueTextareaMustache": "error" } } }}Description
Section titled “Description”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.
Examples
Section titled “Examples”Invalid
Section titled “Invalid”<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>References
Section titled “References”Related links
Section titled “Related links”Copyright (c) 2023-present Biome Developers and Contributors.