Skip to content

no-textarea-mustache

Reports {{ }} inside a <textarea>. Only in .vue files.

The text of a <textarea> is its default value, and Vue does not interpolate it, so the user sees {{ text }} written out.

To fix, bind the value with v-model.

Reported
...
<template v-if="a"><p>ok</p></template>
<template #head><p>ok</p></template>
<textarea>{{ text }}</textarea>
...
<component :is="view" />
...
angular:
lint:
rules:
no-textarea-mustache: warn # off, warn (default), error
html:
lint:
rules:
no-textarea-mustache: warn # off, warn (default), error
svelte:
lint:
rules:
no-textarea-mustache: warn # off, warn (default), error
vue:
lint:
rules:
no-textarea-mustache: warn # off, warn (default), error

Enabled by the presets: html/eslint-plugin-vue-recommended.

Suppress one line with sudsy-disable-next-line no-textarea-mustache in a comment of the file’s language.

The same check in other tools; Sudsy reports what each upstream rule reports.

Tool Rule Match
eslint-plugin-vue no-textarea-mustache full