All Rules β
Base Rules (Enabling Correct ESLint Parsing) β
Enable this plugin using with:
json
{
"extends": "plugin:lodash-template/base"
}
Rule ID | Description | |
---|---|---|
lodash-template/no-script-parsing-error | disallow 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 ID | Description | |
---|---|---|
lodash-template/no-empty-template-tag | disallow empty micro-template tag. (ex. π <% %> ) | |
lodash-template/no-invalid-template-interpolation | disallow other than expression in micro-template interpolation. (ex. π <%= if (test) { %> ) | |
lodash-template/no-semi-in-template-interpolation | disallow the semicolon at the end of expression in micro template interpolation.(ex. π <%= text %> π <%= text; %> ) | π§ |
Recommended (Improve Readability) β
Enforce all the rules in this category and all the rules in Best Practices
categories with:
json
{
"extends": "plugin:lodash-template/recommended"
}
Rule ID | Description | |
---|---|---|
lodash-template/no-irregular-whitespace | disallow irregular whitespace outside the template tags. | π§ |
lodash-template/no-multi-spaces-in-scriptlet | disallow multiple spaces in scriptlet. (ex. π <% ifΒ·Β·Β·(test)Β·Β·Β·{ %> ) | π§ |
lodash-template/scriptlet-indent | enforce consistent indentation to scriptlet in micro-template tag. | π§ |
lodash-template/template-tag-spacing | enforce unified spacing in micro-template tag. (ex. π <%= prop %> , π <%=prop%> ) | π§ |
Recommended with HTML template (Improve Readability with HTML template) β
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 ID | Description | |
---|---|---|
lodash-template/attribute-name-casing | enforce HTML attribute name casing. (ex. π <div foo-bar> π <div fooBar> <div FOO-BAR> ) | π§ |
lodash-template/attribute-value-quote | enforce quotes style of HTML attributes. (ex. π <div class="abc"> π <div class='abc'> <div class=abc> ) | π§ |
lodash-template/element-name-casing | enforce HTML element name casing. (ex. π <xxx-element> π <xxxElement> <DIV> ) | π§ |
lodash-template/html-closing-bracket-newline | require or disallow a line break before tag's closing brackets | π§ |
lodash-template/html-closing-bracket-spacing | require or disallow a space before tag's closing brackets. (ex. π <input> <inputΒ·/> π <inputΒ·> <input/> ) | π§ |
lodash-template/html-comment-content-newline | require or disallow a line break before and after HTML comment contents | π§ |
lodash-template/html-comment-spacing | enforce unified spacing in HTML comment. (ex. π <!-- comment --> , π <!--comment--> ) | π§ |
lodash-template/html-content-newline | require or disallow a line break before and after HTML contents | π§ |
lodash-template/html-indent | enforce consistent HTML indentation. | π§ |
lodash-template/max-attributes-per-line | enforce the maximum number of HTML attributes per line | π§ |
lodash-template/no-duplicate-attributes | disallow duplication of HTML attributes. (ex. π <div foo foo> ) | |
lodash-template/no-html-comments | disallow HTML comments. (ex. π <!-- comment --> ) | |
lodash-template/no-multi-spaces-in-html-tag | disallow multiple spaces in HTML tags. (ex. π <inputΒ·Β·Β·type="text"> ) | π§ |
lodash-template/no-space-attribute-equal-sign | disallow spacing around equal signs in attribute. (ex. π <div class="item"> π <div class = "item"> ) | π§ |
lodash-template/no-warning-html-comments | disallow 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 ID | Description | |
---|---|---|
lodash-template/no-template-tag-in-start-tag | disallow template tag in start tag outside attribute values. (ex. π <input <%= 'disabled' %> > ) | |
lodash-template/prefer-escape-template-interpolations | prefer escape micro-template interpolations. (ex. π <%- ... %> , π <%= ... %> ) |