no-child-content
Angular templatesHTMLVue / SvelteVue / Sveltecorrectnessno fixdefault: warnhtml/eslint-plugin-vue-recommended
What it does
Section titled “What it does”Reports an element that has v-html or v-text and also content between its tags.
Why it matters
Section titled “Why it matters”The directive replaces the content of the element, so the text between the tags is never shown. It is a leftover or a mistake.
To fix, remove the content, or the directive.
Example
Section titled “Example”... <template v-for="x in xs" :key="x"><li /></template> <p v-html="h">child</p>... </div>...Configuration
Section titled “Configuration”angular: lint: rules: no-child-content: warn # off, warn (default), errorhtml: lint: rules: no-child-content: warn # off, warn (default), errorsvelte: lint: rules: no-child-content: warn # off, warn (default), errorvue: lint: rules: no-child-content: warn # off, warn (default), errorEnabled by the presets: html/eslint-plugin-vue-recommended.
Suppress one line with sudsy-disable-next-line no-child-content in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| eslint-plugin-vue | no-child-content |
full |