rule-empty-line-before
要求或禁止规则前有空行。
¥Require or disallow an empty line before rules.
a {}
/* ← */
b {} /* ↑ */
/** ↑
* This line */
此规则忽略源中第一个节点的规则。
¥This rule ignores rules that are the very first node in a source.
fix
选项 可以自动修复此规则报告的所有问题。
¥The fix
option can automatically fix all of the problems reported by this rule.
选项
¥Options
string
:"always"|"never"|"always-multi-line"|"never-multi-line"
"always"
规则之前必须始终有一个空行。
¥There must always be an empty line before rules.
以下模式被视为问题:
¥The following patterns are considered problems:
a {} b {}
a {}
b {}
以下模式不被视为问题:
¥The following patterns are not considered problems:
a {}
b {}
"never"
规则之前绝不能有空行。
¥There must never be an empty line before rules.
以下模式被视为问题:
¥The following patterns are considered problems:
a {}
b {}
以下模式不被视为问题:
¥The following patterns are not considered problems:
a {} b {}
a {}
b {}
"always-multi-line"
多行规则之前必须始终有一个空行。
¥There must always be an empty line before multi-line rules.
以下模式被视为问题:
¥The following patterns are considered problems:
a {
color: red;
}
b {
color: blue;
}
以下模式不被视为问题:
¥The following patterns are not considered problems:
a {
color: red;
}
b {
color: blue;
}
"never-multi-line"
多行规则之前绝不能有空行。
¥There must never be an empty line before multi-line rules.
以下模式被视为问题:
¥The following patterns are considered problems:
a {
color: red;
}
b {
color: blue;
}
以下模式不被视为问题:
¥The following patterns are not considered problems:
a {
color: red;
}
b {
color: blue;
}
可选的辅助选项
¥Optional secondary options
except: ["after-rule", "after-single-line-comment", "inside-block-and-after-rule", "inside-block", "first-nested"]
"after-rule"
反转遵循另一个规则的规则的主要选项。
¥Reverse the primary option for rules that follow another rule.
例如,对于 "always"
:
¥For example, with "always"
:
以下模式被视为问题:
¥The following patterns are considered problems:
a {}
b {}
以下模式不被视为问题:
¥The following patterns are not considered problems:
a {}
b {}
"after-single-line-comment"
反转单行注释后面的规则的主要选项。
¥Reverse the primary option for rules that follow a single-line comment.
例如,对于 "always"
:
¥For example, with "always"
:
以下模式被视为问题:
¥The following patterns are considered problems:
/* comment */
a {}
以下模式不被视为问题:
¥The following patterns are not considered problems:
/* comment */
a {}
"inside-block-and-after-rule"
反转块内规则的主要选项并遵循另一个规则。
¥Reverse the primary option for rules that are inside a block and follow another rule.
例如,对于 "always"
:
¥For example, with "always"
:
以下模式被视为问题:
¥The following patterns are considered problems:
@media {
a {}
b {}
}
以下模式不被视为问题:
¥The following patterns are not considered problems:
@media {
a {}
b {}
}
"inside-block"
反转块内规则的主要选项。
¥Reverse the primary option for rules that are inside a block.
例如,对于 "always"
:
¥For example, with "always"
:
以下模式被视为问题:
¥The following patterns are considered problems:
a {
color: red;
& b {
color: blue;
}
}
以下模式不被视为问题:
¥The following patterns are not considered problems:
a {
color: red;
& b {
color: blue;
}
}
"first-nested"
反转嵌套规则及其父节点的第一个子节点的主要选项。
¥Reverse the primary option for rules that are nested and the first child of their parent node.
例如,对于 "always"
:
¥For example, with "always"
:
以下模式被视为问题:
¥The following patterns are considered problems:
@media {
a {}
b {}
}
以下模式不被视为问题:
¥The following patterns are not considered problems:
@media {
a {}
b {}
}
ignore: ["after-comment", "first-nested", "inside-block"]
"after-comment"
忽略注释后面的规则。
¥Ignore rules that follow a comment.
例如,对于 "always"
:
¥For example, with "always"
:
以下模式不被视为问题:
¥The following patterns are not considered problems:
/* comment */
a {}
"first-nested"
忽略嵌套规则及其父节点的第一个子节点。
¥Ignore rules that are nested and the first child of their parent node.
例如,对于 "always"
:
¥For example, with "always"
:
以下模式不被视为问题:
¥The following patterns are not considered problems:
@media {
a {}
b {}
}
"inside-block"
忽略块内的规则。
¥Ignore rules that are inside a block.
例如,对于 "always"
:
¥For example, with "always"
:
以下模式不被视为问题:
¥The following patterns are not considered problems:
@media {
a {}
}
@media {
a {}
b {}
}