vue/no-child-content
disallow element's child contents which would be overwritten by a directive like
v-htmlorv-text
- ⚙️ This rule is included in all of
"plugin:vue/essential",*.configs["flat/essential"],"plugin:vue/vue2-essential",*.configs["flat/vue2-essential"],"plugin:vue/strongly-recommended",*.configs["flat/strongly-recommended"],"plugin:vue/vue2-strongly-recommended",*.configs["flat/vue2-strongly-recommended"],"plugin:vue/recommended",*.configs["flat/recommended"],"plugin:vue/vue2-recommended"and*.configs["flat/vue2-recommended"]. - 💡 Some problems reported by this rule are manually fixable by editor suggestions.
📖 Rule Details
This rule reports child content of elements that have a directive which overwrites that child content. By default, those are v-html and v-text, additional ones (e.g. Vue I18n's v-t directive) can be configured manually.
🔧 Options
json
{
"vue/no-child-content": ["error", {
"additionalDirectives": ["foo"] // checks v-foo directive
}]
}additionalDirectives... An array of additional directives to check, without thev-prefix. Empty by default;v-htmlandv-textare always checked.
📚 Further Reading
🚀 Version
This rule was introduced in eslint-plugin-vue v8.1.0