Skip to content

All Rules ​

Base Rules (Enabling Correct ESLint Parsing) ​

Enable this plugin using with:

json
{
  "extends": "plugin:lodash-template/base"
}
Rule IDDescription
lodash-template/no-script-parsing-errordisallow parsing errors in template

Best Practices (Improve Development Experience) ​

Enforce all the rules in this category with:

json
{
  "extends": "plugin:lodash-template/best-practices"
}
Rule IDDescription
lodash-template/no-empty-template-tagdisallow empty micro-template tag. (ex. πŸ†– <% %>)
lodash-template/no-invalid-template-interpolationdisallow other than expression in micro-template interpolation. (ex. πŸ†– <%= if (test) { %>)
lodash-template/no-semi-in-template-interpolationdisallow the semicolon at the end of expression in micro template interpolation.(ex. πŸ†— <%= text %> πŸ†– <%= text; %>)πŸ”§

Enforce all the rules in this category and all the rules in Best Practices categories with:

json
{
  "extends": "plugin:lodash-template/recommended"
}
Rule IDDescription
lodash-template/no-irregular-whitespacedisallow irregular whitespace outside the template tags.πŸ”§
lodash-template/no-multi-spaces-in-scriptletdisallow multiple spaces in scriptlet. (ex. πŸ†– <% ifΒ·Β·Β·(test)Β·Β·Β·{ %>)πŸ”§
lodash-template/scriptlet-indentenforce consistent indentation to scriptlet in micro-template tag.πŸ”§
lodash-template/template-tag-spacingenforce unified spacing in micro-template tag. (ex. πŸ†— <%= prop %>, πŸ†– <%=prop%>)πŸ”§

Enforce all the rules in this category and all the rules in Best Practices/Recommended categories with:

json
{
  "extends": "plugin:lodash-template/recommended-with-html"
}
Rule IDDescription
lodash-template/attribute-name-casingenforce HTML attribute name casing. (ex. πŸ†— <div foo-bar> πŸ†– <div fooBar> <div FOO-BAR>)πŸ”§
lodash-template/attribute-value-quoteenforce quotes style of HTML attributes. (ex. πŸ†— <div class="abc"> πŸ†– <div class='abc'> <div class=abc>)πŸ”§
lodash-template/element-name-casingenforce HTML element name casing. (ex. πŸ†— <xxx-element> πŸ†– <xxxElement> <DIV>)πŸ”§
lodash-template/html-closing-bracket-newlinerequire or disallow a line break before tag's closing bracketsπŸ”§
lodash-template/html-closing-bracket-spacingrequire or disallow a space before tag's closing brackets. (ex. πŸ†— <input> <inputΒ·/> πŸ†– <inputΒ·> <input/>)πŸ”§
lodash-template/html-comment-content-newlinerequire or disallow a line break before and after HTML comment contentsπŸ”§
lodash-template/html-comment-spacingenforce unified spacing in HTML comment. (ex. πŸ†— <!-- comment -->, πŸ†– <!--comment-->)πŸ”§
lodash-template/html-content-newlinerequire or disallow a line break before and after HTML contentsπŸ”§
lodash-template/html-indentenforce consistent HTML indentation.πŸ”§
lodash-template/max-attributes-per-lineenforce the maximum number of HTML attributes per lineπŸ”§
lodash-template/no-duplicate-attributesdisallow duplication of HTML attributes. (ex. πŸ†– <div foo foo>)
lodash-template/no-html-commentsdisallow HTML comments. (ex. πŸ†– <!-- comment -->)
lodash-template/no-multi-spaces-in-html-tagdisallow multiple spaces in HTML tags. (ex. πŸ†– <inputΒ·Β·Β·type="text">)πŸ”§
lodash-template/no-space-attribute-equal-signdisallow spacing around equal signs in attribute. (ex. πŸ†— <div class="item"> πŸ†– <div class = "item">)πŸ”§
lodash-template/no-warning-html-commentsdisallow specified warning terms in HTML comments. (ex. πŸ†– <!-- TODO:task -->)

Uncategorized ​

No preset enables the rules in this category. Please enable each rule if you want.

For example:

json
{
  "rules": {
    "lodash-template/no-template-tag-in-start-tag": "error"
  }
}
Rule IDDescription
lodash-template/no-template-tag-in-start-tagdisallow template tag in start tag outside attribute values. (ex. πŸ†– <input <%= 'disabled' %> >)
lodash-template/prefer-escape-template-interpolationsprefer escape micro-template interpolations. (ex. πŸ†— <%- ... %>, πŸ†– <%= ... %>)