1 # declaration-empty-line-before
3 Require or disallow an empty line before declarations.
15 This rule only applies to standard property declarations. Use the [`custom-property-empty-line-before`](../custom-property-empty-line-before/README.md) rule for custom property declarations.
17 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.
21 `string`: `"always"|"never"`
25 The following patterns are considered violations:
41 The following patterns are *not* considered violations:
62 The following patterns are considered violations:
81 The following patterns are *not* considered violations:
97 ## Optional secondary options
99 ### `except: ["after-comment", "after-declaration", "first-nested"]`
101 #### `"after-comment"`
103 Reverse the primary option for declarations that come after a comment.
105 Shared-line comments do not trigger this option.
107 For example, with `"always"`:
109 The following patterns are considered violations:
121 bottom: 5px; /* comment */
126 The following patterns are *not* considered violations:
138 bottom: 5px; /* comment */
145 #### `"after-declaration"`
147 Reverse the primary option for declarations that come after another declaration.
149 Shared-line comments do not affect this option.
151 For example, with `"always"`:
153 The following patterns are considered violations:
167 bottom: 15px; /* comment */
173 The following patterns are *not* considered violations:
186 bottom: 15px; /* comment */
191 #### `"first-nested"`
193 Reverse the primary option for declarations that are nested and the first child of their parent node.
195 For example, with `"always"`:
197 The following patterns are considered violations:
208 The following patterns are *not* considered violations:
218 ### `ignore: ["after-comment", "after-declaration", "inside-single-line-block"]`
220 #### `"after-comment"`
222 Ignore declarations that are preceded by comments.
224 For example, with `"always"`:
226 The following patterns are *not* considered violations:
235 #### `"after-declaration"`
237 Ignore declarations that are preceded by declarations, to allow for multiple declaration sets in the same block.
239 For example, with `"always"`:
241 The following patterns are *not* considered violations:
264 text-decoration: none;
271 #### `"inside-single-line-block"`
273 Ignore declarations that are inside single-line blocks.
275 For example, with `"always"`:
277 The following patterns are *not* considered violations:
280 a { bottom: 15px; top: 5px; }