Skip to content

Latest commit

 

History

History
36 lines (27 loc) · 1.24 KB

no-invalid-template-interpolation.md

File metadata and controls

36 lines (27 loc) · 1.24 KB
pageClass sidebarDepth title description
rule-details
0
lodash-template/no-invalid-template-interpolation
disallow other than expression in micro-template interpolation. (ex. 🆖 `<%= if (test) { %>`)

lodash-template/no-invalid-template-interpolation

disallow other than expression in micro-template interpolation. (ex. 🆖 <%= if (test) { %>)

  • ⚙️ This rule is included in all of "plugin:lodash-template/best-practices", "plugin:lodash-template/recommended", "plugin:lodash-template/recommended-with-html", "plugin:lodash-template/recommended-with-script" and "plugin:lodash-template/all".

Rule Details

This rule disallow other than expression in micro-template interpolation.

<% /* eslint "lodash-template/no-invalid-template-interpolation": "error" */ %>
<!-- ✓ GOOD -->
<% if (a) { %>
  <div></div>
<% } %>

<div><%= text %></div>

<!-- ✗ BAD -->
<%= if (a) { %>
  <div></div>
<% } %>

<div><%= /**/ %></div>

Implementation