pageClass | sidebarDepth | title | description |
---|---|---|---|
rule-details |
0 |
lodash-template/no-template-tag-in-start-tag |
disallow template tag in start tag outside attribute values. (ex. 🆖 `<input <%= 'disabled' %> >`) |
disallow template tag in start tag outside attribute values. (ex. 🆖
<input <%= 'disabled' %> >
)
- ⚙️ This rule is included in
"plugin:lodash-template/all"
.
This rule reports the template tag that is in the start tag, outside attribute values.
<% /* eslint "lodash-template/no-template-tag-in-start-tag": "error" */ %>
<!-- ✓ GOOD -->
<input disabled >
<input class="<%= hidden ? 'hidden' : '' %>" >
<!-- ✗ BAD -->
<input <%= 'disabled' %> >
<input <%= disabled ? 'disabled' : '' %> >
<input
<% if (disabled) { %>
disabled
<% } %>
>
{
"lodash-template/no-template-tag-in-start-tag": ["error", {
"arrowEvaluateTag": false,
}]
}
<% /* eslint "lodash-template/no-template-tag-in-start-tag": ["error", {"arrowEvaluateTag": true}] */ %>
<!-- ✓ GOOD -->
<input disabled >
<input
<% if (disabled) { %>
disabled
<% } %>
>