¥This rule will enforce consistency of spacing after the <!-- and before the --> of comment. It also provides several exceptions for various documentation styles.
<!-- 之后和 --> 之前的空格使阅读注释中的文本更容易。
¥Whitespace after the <!-- and before the --> makes it easier to read text in comments.
¥The "exceptions" value is an array of string patterns which are considered exceptions to the rule. Please note that exceptions are ignored if the first argument is "never".
vue/html-comment-content-spacing
--fix
选项可以自动修复此规则报告的一些问题。📖 规则详情
此规则将强制注释的
<!--
之后和-->
之前的间距一致。它还为各种文档样式提供了几个例外。¥This rule will enforce consistency of spacing after the
<!--
and before the-->
of comment. It also provides several exceptions for various documentation styles.<!--
之后和-->
之前的空格使阅读注释中的文本更容易。¥Whitespace after the
<!--
and before the-->
makes it easier to read text in comments.🔧选项
¥🔧 Options
第一个是字符串,可以是
"always"
或"never"
。默认为"always"
。¥The first is a string which be either
"always"
or"never"
. The default is"always"
."always"
(默认)...<!--
之后和-->
之前必须至少有一个空格。¥
"always"
(default) ... there must be at least one whitespace at after the<!--
and before the-->
."never"
...<!--
之后和-->
之前不应有空格。¥
"never"
... there should be no whitespace at after the<!--
and before the-->
.此规则还可以采用第二个选项,即具有以下键的对象:
"exceptions"
。¥This rule can also take a 2nd option, an object with the following key:
"exceptions"
."exceptions"
值是一个字符串模式数组,这些模式被视为规则的例外。请注意,如果第一个参数是"never"
,则会忽略异常。¥The
"exceptions"
value is an array of string patterns which are considered exceptions to the rule. Please note that exceptions are ignored if the first argument is"never"
."always"
"never"
"always", { "exceptions": ["*"] }
👫相关规则
¥👫 Related Rules
spaced-comment
vue/html-comment-content-newline
🚀版本
¥🚀 Version
此规则在 eslint-plugin-vue v7.0.0 中引入
¥This rule was introduced in eslint-plugin-vue v7.0.0
🔍代码实现
¥🔍 Implementation
规则源
¥Rule source
测试源
¥Test source