# lodash-template/html-closing-bracket-spacing

require or disallow a space before tag's closing brackets. (ex. 🆗 <input> <input·/> 🆖 <input·> <input/>)

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

# Rule Details

This rule enforces consistent spacing style before closing brackets > of tags.

<div class="foo"> or <div class="foo" >
<input class="foo"/> or <input class="foo" />
Now loading...

# Options

{
  "lodash-template/html-closing-bracket-spacing": ["error", {
    "startTag": "always" | "never",
    "endTag": "always" | "never",
    "selfClosingTag": "always" | "never"
  }]
}
  • startTag ("always" | "never") ... Setting for the > of start tags (e.g. <div>). Default is "never".
    • "always" ... requires one or more spaces.
    • "never" ... disallows spaces.
  • endTag ("always" | "never") ... Setting for the > of end tags (e.g. </div>). Default is "never".
    • "always" ... requires one or more spaces.
    • "never" ... disallows spaces.
  • selfClosingTag ("always" | "never") ... Setting for the /> of self-closing tags (e.g. <br/>). Default is "always".
    • "always" ... requires one or more spaces.
    • "never" ... disallows spaces.
Now loading...

# Implementation