lodash-template/no-irregular-whitespace
disallow irregular whitespace outside the template tags.
- ⚙️ This rule is included in all of
"plugin:lodash-template/recommended","plugin:lodash-template/recommended-with-html","plugin:lodash-template/recommended-with-script"and"plugin:lodash-template/all". - 🔧 The
--fixoption on the command line can automatically fix some of the problems reported by this rule.
Rule Details
This rule disallows the irregular whitespaces.
html
<% /* eslint "lodash-template/no-irregular-whitespace": "error" */ %>
<!-- ✓ GOOD -->
<div id="item-id" class="item-content">
</div >
<!-- ✗ BAD -->
<div id="item-id" class="item-content">
</div >Options
json
{
"lodash-template/no-irregular-whitespace": ["error", {
"skipComments": false,
"skipAttrValues": false,
"skipText": false
}]
}This rule has an object option for exceptions:
"skipComments": trueallows any whitespace characters in HTML comments"skipAttrValues": trueallows any whitespace characters in HTML attribute values"skipText": trueallows any whitespace characters in HTML texts