Skip to content

no-child-content

Reports an element that has v-html or v-text and also content between its tags.

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.

Reported
...
<template v-for="x in xs" :key="x"><li /></template>
<p v-html="h">child</p>
...
</div>
...
angular:
lint:
rules:
no-child-content: warn # off, warn (default), error
html:
lint:
rules:
no-child-content: warn # off, warn (default), error
svelte:
lint:
rules:
no-child-content: warn # off, warn (default), error
vue:
lint:
rules:
no-child-content: warn # off, warn (default), error

Enabled 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.

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

Tool Rule Match
eslint-plugin-vue no-child-content full