vue/no-textarea-mustache
Disallow mustache interpolation in <textarea>.
| Default severity | Presets | Automatic fix | Options |
|---|---|---|---|
error |
essential, happy-path, nuxt, ecosystem, opinionated |
No | None |
Applies to: Vue SFC templates and blocks, with script context where the rule requires it.
Bad
The textarea places message in child interpolation instead of binding its value.
<template>
<textarea>{{ message }}</textarea>
</template>
Good
v-model binds the editable textarea value to message.
<template>
<textarea v-model="message"></textarea>
</template>
Configuration (Vite+)
import { defineConfig } from "@vizejs/vite-plugin/vite-plus";
export default defineConfig({}).withVue({
linter: {
"preset": "incremental",
"rules": {
"vue/no-textarea-mustache": "error"
}
},
});
Then run vp run lint.