1 # comment-empty-line-before
3 Require or disallow an empty line before comments.
13 If the comment is the very first node in a stylesheet then it is ignored. Shared-line comments are also ignored.
15 If you're using a custom syntax which support single-line comments with `//`, those are ignored as well.
17 **Caveat:** Comments within *selector and value lists* are currently ignored.
19 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.
23 `string`: `"always"|"never"`
27 There *must always* be an empty line before comments.
29 The following patterns are considered violations:
36 The following patterns are *not* considered violations:
50 There *must never* be an empty line before comments.
52 The following patterns are considered violations:
60 The following patterns are *not* considered violations:
71 ## Optional secondary options
73 ### `except: ["first-nested"]`
75 Reverse the primary option for comments that are nested and the first child of their parent node.
77 For example, with `"always"`:
79 The following patterns are considered violations:
89 The following patterns are *not* considered violations:
98 ### `ignore: ["after-comment", "stylelint-commands"]`
100 #### `"after-comment"`
102 Don't require an empty line after a comment.
104 For example, with `"always"`:
106 The following patterns are *not* considered violations:
129 #### `"stylelint-commands"`
131 Ignore comments that deliver commands to stylelint, e.g. `/* stylelint-disable color-no-hex */`.
133 For example, with `"always"`:
135 The following patterns are considered violations:
140 /* not a stylelint command */
145 The following patterns are *not* considered violations:
150 /* stylelint-disable color-no-hex */