Skip to content

lodash-template/no-multi-spaces-in-scriptlet

disallow multiple spaces in scriptlet. (ex. 🆖 <% if···(test)···{ %>)

  • ⚙️ This rule is included in all of "plugin:lodash-template/recommended", "plugin:lodash-template/recommended-with-html", "plugin:lodash-template/recommended-with-script" and "plugin:lodash-template/all".
  • 🔧 The --fix option on the command line can automatically fix some of the problems reported by this rule.

Rule Details

This rule aims to disallow multiple whitespace in script which are not used for indentation.

html
<% /* eslint "lodash-template/no-multi-spaces-in-scriptlet": "error" */ %>
<!-- ✓ GOOD -->
<%
var a = 1;

if(foo === "bar") {}

a << b

var arr = [1, 2];

a ? b: c
%>

<!-- ✗ BAD -->
<%
var a =
1;
if(foo
=== "bar") {}
a <<
b
var arr = [1,
2];
a ?
b: c
%>

Further Reading

Implementation