.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / stylelint / lib / rules / block-closing-brace-newline-after / README.md
1 # block-closing-brace-newline-after
2
3 Require a newline or disallow whitespace after the closing brace of blocks.
4
5 ```css
6 a { color: pink; }
7 a { color: red; }↑
8 /**              ↑
9  * The newline after this brace */
10 ```
11
12 This rule allows an end-of-line comment separated from the closing brace by spaces, as long as the comment contains no newlines. For example,
13
14 ```css
15 a {
16   color: pink;
17 } /* end-of-line comment */
18 ```
19
20 This rule allows a trailing semicolon after the closing brace of a block. For example,
21
22 ```css
23 :root {
24   --toolbar-theme: {
25     background-color: hsl(120, 70%, 95%);
26   };
27 /* ↑
28  * This semicolon */  
29 }
30 ```
31
32 ## Options
33
34 `string`: `"always"|"always-single-line"|"never-single-line"|"always-multi-line"|"never-multi-line"`
35
36 ### `"always"`
37
38 There *must always* be a newline after the closing brace.
39
40 The following patterns are considered violations:
41
42 ```css
43 a { color: pink; }b { color: red; }
44 ```
45
46 ```css
47 a { color: pink;
48 } b { color: red; }
49 ```
50
51 The following patterns are *not* considered violations:
52
53 ```css
54 a { color: pink; }
55 b { color: red; }
56 ```
57
58 ### `"always-single-line"`
59
60 There *must always* be a newline after the closing brace in single-line blocks.
61
62 The following patterns are considered violations:
63
64 ```css
65 a { color: pink; } b { color: red; }
66 ```
67
68 The following patterns are *not* considered violations:
69
70 ```css
71 a { color: pink;
72 } b { color: red; }
73 ```
74
75 ```css
76 a { color: pink; }
77 b { color: red; }
78 ```
79
80 ### `"never-single-line"`
81
82 There *must never* be whitespace after the closing brace in single-line blocks.
83
84 The following patterns are considered violations:
85
86 ```css
87 a { color: pink; } b { color: red; }
88 ```
89
90 The following patterns are *not* considered violations:
91
92 ```css
93 a { color: pink; }b { color: red; }
94 ```
95
96 ```css
97 a { color: pink;
98 } b { color: red; }
99 ```
100
101 ### `"always-multi-line"`
102
103 There *must always* be a newline after the closing brace in multi-line blocks.
104
105 The following patterns are considered violations:
106
107 ```css
108 a { color: pink;
109 }b { color: red; }
110 ```
111
112 The following patterns are *not* considered violations:
113
114 ```css
115 a { color: pink; }b { color: red; }
116 ```
117
118 ```css
119 a { color: pink;
120 }
121 b { color: red; }
122 ```
123
124 ### `"never-multi-line"`
125
126 There *must never* be whitespace after the closing brace in multi-line blocks.
127
128 The following patterns are considered violations:
129
130 ```css
131 a { color: pink;
132 } b { color: red; }
133 ```
134
135 The following patterns are *not* considered violations:
136
137 ```css
138 a { color: pink; } b { color: red; }
139 ```
140
141 ```css
142 a { color: pink;
143 }b { color: red; }
144 ```
145
146 ## Optional secondary options
147
148 ### `ignoreAtRules: ["/regex/", "non-regex"]`
149
150 Ignore specified at-rules.
151
152 For example, with `"always"` or `"always-multi-line"`.
153
154 Given:
155
156 ```js
157 ["if", "else"]
158 ```
159
160 The following patterns are *not* considered violations:
161
162 ```css
163 @if ($var) {
164   color: pink;
165 } @else if ($var2) {
166   color: red;
167 } @else {
168   color: blue;
169 }
170 ```
171
172 ```css
173 @if ($var) { color: pink; } @else { color: blue; }
174 ```