Appearance
require or disallow a line break before and after HTML comment contents
"plugin:lodash-template/recommended-with-html"
"plugin:lodash-template/all"
--fix
This rule enforces a line break (or no line break) before and after HTML comment contents.
<% /* eslint "lodash-template/html-comment-content-newline": "error" */ %> <!-- ✓ GOOD --> <!-- singleline comment --> <!-- multiline comment --> <!-- ✗ BAD --> <!-- singleline comment --> <!-- multiline comment --> <!-- multiline comment -->
{ "lodash-template/html-comment-content-newline": ["error", { "singleline": "never", "multiline": "always", }] }
singleline
"ignore"
"never"
"always"
multiline
<% /* eslint lodash-template/html-comment-content-newline: ["error", { "singleline": "always", "multiline": "never" }] */ %> <!-- ✓ GOOD --> <!-- comment --> <!-- comment comment --> <!-- ✗ BAD --> <!-- comment --> <!-- comment comment -->
lodash-template/html-comment-content-newline
"plugin:lodash-template/recommended-with-html"
and"plugin:lodash-template/all"
.--fix
option on the command line can automatically fix some of the problems reported by this rule.Rule Details
This rule enforces a line break (or no line break) before and after HTML comment contents.
Options
singleline
... the configuration for single-line comments."ignore"
... Don't enforce line breaks style before and after the comments."never"
... disallow line breaks before and after the comments. This is the default."always"
... require one line break before and after the comments.multiline
... the configuration for multiline comments."ignore"
... Don't enforce line breaks style before and after the comments."never"
... disallow line breaks before and after the comments."always"
... require one line break before and after the comments. This is the default.Further Reading
Implementation