Appearance
vue/html-closing-bracket-spacing
要求或不允许在标签的右括号前有空格括号
- ⚙️ 此规则包含在
"plugin:vue/strongly-recommended"
、*.configs["flat/strongly-recommended"]
、"plugin:vue/vue2-strongly-recommended"
、*.configs["flat/vue2-strongly-recommended"]
、"plugin:vue/recommended"
、*.configs["flat/recommended"]
、"plugin:vue/vue2-recommended"
和*.configs["flat/vue2-recommended"]
中。
🔧命令行 上的
--fix
选项可以自动修复此规则报告的一些问题。¥🔧 The
--fix
option on the command line can automatically fix some of the problems reported by this rule.
📖 规则详情
此规则旨在强制在标签的右括号 >
之前使用一致的间距样式。
¥This rule aims to enforce consistent spacing style before closing brackets >
of tags.
🔧选项
¥🔧 Options
json
{
"vue/html-closing-bracket-spacing": ["error", {
"startTag": "always" | "never",
"endTag": "always" | "never",
"selfClosingTag": "always" | "never"
}]
}
startTag
("always" | "never"
) ...设置开始标签的>
(例如<div>
)。默认值为"never"
。¥
startTag
("always" | "never"
) ... Setting for the>
of start tags (e.g.<div>
). Default is"never"
."always"
...要求一个或多个空格。¥
"always"
... requires one or more spaces."never"
...禁止空格。¥
"never"
... disallows spaces.
endTag
("always" | "never"
) ...设置结束标签的>
(例如</div>
)。默认值为"never"
。¥
endTag
("always" | "never"
) ... Setting for the>
of end tags (e.g.</div>
). Default is"never"
."always"
...要求一个或多个空格。¥
"always"
... requires one or more spaces."never"
...禁止空格。¥
"never"
... disallows spaces.
selfClosingTag
("always" | "never"
) ...设置自闭合标签的/>
(例如<div/>
)。默认值为"always"
。¥
selfClosingTag
("always" | "never"
) ... Setting for the/>
of self-closing tags (e.g.<div/>
). Default is"always"
."always"
...要求一个或多个空格。¥
"always"
... requires one or more spaces."never"
...禁止空格。¥
"never"
... disallows spaces.
"startTag": "always", "endTag": "always", "selfClosingTag": "always"
👫相关规则
¥👫 Related Rules
🚀版本
¥🚀 Version
此规则在 eslint-plugin-vue v4.1.0 中引入
¥This rule was introduced in eslint-plugin-vue v4.1.0
🔍代码实现
¥🔍 Implementation