Skip to content

lodash-template/no-empty-template-tag

disallow empty micro-template tag. (ex. 🆖 <% %>)

  • ⚙️ 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 reports empty micro-template interpolate/evaluate.

html
<% /* eslint "lodash-template/no-empty-template-tag": "error" */ %>
<!-- ✓ GOOD -->
<div><%= text %></div>

<!-- ✗ BAD -->
<div>
<% %>
</div>
<div>
<%
%></div>

Implementation