# vue/multiline-html-element-content-newline
require a line break before and after the contents of a multiline element
- ⚙️ This rule is included in all of
"plugin:vue/vue3-strongly-recommended"
,"plugin:vue/strongly-recommended"
,"plugin:vue/vue3-recommended"
and"plugin:vue/recommended"
. - 🔧 The
--fix
option on the command line (opens new window) can automatically fix some of the problems reported by this rule.
# 📖 Rule Details
This rule enforces a line break before and after the contents of a multiline element.
# 🔧 Options
{
"vue/multiline-html-element-content-newline": ["error", {
"ignoreWhenEmpty": true,
"ignores": ["pre", "textarea", ...INLINE_ELEMENTS],
"allowEmptyLines": false
}]
}
ignoreWhenEmpty
... disables reporting when element has no content. defaulttrue
ignores
... the configuration for element names to ignore line breaks style. default["pre", "textarea", ...INLINE_ELEMENTS]
.allowEmptyLines
... iftrue
, it allows empty lines around content. If you want to disallow multiple empty lines, use no-multiple-empty-lines (opens new window) in combination.
defaultfalse
::: info All inline non void elements can be found here (opens new window). :::
# "ignores": ["VueComponent", "pre", "textarea"]
# "allowEmptyLines": true
# 📚 Further Reading
# 🚀 Version
This rule was introduced in eslint-plugin-vue v5.0.0