1 # rule-empty-line-before
3 Require or disallow an empty line before rules.
13 If the rule is the very first node in a stylesheet then it is ignored.
15 The `--fix` option on the [command line](../../../docs/user-guide/cli.md#autofixing-errors) can automatically fix all of the problems reported by this rule. We recommend to enable [`indentation`](../indentation/README.md) rule for better autofixing results with this rule.
19 `string`: `"always"|"never"|"always-multi-line"|"never-multi-line"`
23 There *must always* be an empty line before rules.
25 The following patterns are considered violations:
36 The following patterns are *not* considered violations:
46 There *must never* be an empty line before rules.
48 The following patterns are considered violations:
56 The following patterns are *not* considered violations:
67 ### `"always-multi-line"`
69 There *must always* be an empty line before multi-line rules.
71 The following patterns are considered violations:
82 The following patterns are *not* considered violations:
94 ### `"never-multi-line"`
96 There *must never* be an empty line before multi-line rules.
98 The following patterns are considered violations:
110 The following patterns are *not* considered violations:
121 ## Optional secondary options
123 ### `except: ["after-rule", "after-single-line-comment", "inside-block-and-after-rule", "inside-block", "first-nested"]`
127 Reverse the primary option if the rule comes after another rule.
129 For example, with `"always"`:
131 The following patterns are considered violations:
139 The following patterns are *not* considered violations:
146 #### `"after-single-line-comment"`
148 Reverse the primary option if the rule comes after a single-line comment.
150 For example, with `"always"`:
152 The following patterns are considered violations:
160 The following patterns are *not* considered violations:
167 #### `"inside-block-and-after-rule"`
169 Reverse the primary option if the rule is inside a block and comes after another rule.
171 For example, with `"always"`:
173 The following patterns are considered violations:
184 The following patterns are *not* considered violations:
193 #### `"inside-block"`
195 Reverse the primary option if the rule is inside a block.
197 For example, with `"always"`:
199 The following patterns are considered violations:
212 The following patterns are *not* considered violations:
223 #### `"first-nested"`
225 Reverse the primary option if the rule is the first in a block.
227 For example, with `"always"`:
229 The following patterns are considered violations:
240 The following patterns are *not* considered violations:
250 ### `ignore: ["after-comment", "inside-block"]`
252 #### `"after-comment"`
254 Ignore rules that come after a comment.
256 For example, with `"always"`:
258 The following patterns are *not* considered violations:
265 #### `"inside-block"`
267 Ignore rules that are inside a block.
269 For example, with `"always"`:
271 The following patterns are *not* considered violations: