UNPKG

1.88 kBMarkdownView Raw
1# selector-list-comma-newline-after
2
3Require a newline or disallow whitespace after the commas of selector lists.
4
5<!-- prettier-ignore -->
6```css
7 a,
8 b↑{ color: pink; }
9/** ↑
10 * The newline after this comma */
11```
12
13End-of-line comments are allowed one space after the comma.
14
15<!-- prettier-ignore -->
16```css
17a, /* comment */
18b { color: pink; }
19```
20
21The [`fix` option](../../../docs/user-guide/usage/options.md#fix) can automatically fix all of the problems reported by this rule.
22
23## Options
24
25`string`: `"always"|"always-multi-line"|"never-multi-line"`
26
27### `"always"`
28
29There _must always_ be a newline after the commas.
30
31The following patterns are considered violations:
32
33<!-- prettier-ignore -->
34```css
35a, b { color: pink; }
36```
37
38<!-- prettier-ignore -->
39```css
40a
41, b { color: pink; }
42```
43
44The following patterns are _not_ considered violations:
45
46<!-- prettier-ignore -->
47```css
48a,
49b { color: pink; }
50```
51
52<!-- prettier-ignore -->
53```css
54a
55,
56b { color: pink; }
57```
58
59### `"always-multi-line"`
60
61There _must always_ be a newline after the commas in multi-line selector lists.
62
63The following patterns are considered violations:
64
65<!-- prettier-ignore -->
66```css
67a
68, b { color: pink; }
69```
70
71The following patterns are _not_ considered violations:
72
73<!-- prettier-ignore -->
74```css
75a, b { color: pink; }
76```
77
78<!-- prettier-ignore -->
79```css
80a,
81b { color: pink; }
82```
83
84<!-- prettier-ignore -->
85```css
86a
87,
88b { color: pink; }
89```
90
91### `"never-multi-line"`
92
93There _must never_ be whitespace after the commas in multi-line selector lists.
94
95The following patterns are considered violations:
96
97<!-- prettier-ignore -->
98```css
99a
100, b { color: pink; }
101```
102
103<!-- prettier-ignore -->
104```css
105a,
106b { color: pink; }
107```
108
109The following patterns are _not_ considered violations:
110
111<!-- prettier-ignore -->
112```css
113a,b { color: pink; }
114```
115
116<!-- prettier-ignore -->
117```css
118a
119,b { color: pink; }
120```