UNPKG

1.54 kBMarkdownView Raw
1# block-closing-brace-newline-before
2
3Require a newline or disallow whitespace before the closing brace of blocks.
4
5<!-- prettier-ignore -->
6```css
7 a { color: pink;
8 }
9/** ↑
10 * The newline before this brace */
11```
12
13The [`fix` option](../../../docs/user-guide/usage/options.md#fix) can automatically fix all of the problems reported by this rule.
14
15## Options
16
17`string`: `"always"|"always-multi-line"|"never-multi-line"`
18
19### `"always"`
20
21There _must always_ be a newline before the closing brace.
22
23The following patterns are considered violations:
24
25<!-- prettier-ignore -->
26```css
27a { color: pink;}
28```
29
30The following patterns are _not_ considered violations:
31
32<!-- prettier-ignore -->
33```css
34a { color: pink;
35}
36```
37
38<!-- prettier-ignore -->
39```css
40a {
41color: pink;
42}
43```
44
45### `"always-multi-line"`
46
47There _must always_ be a newline before the closing brace in multi-line blocks.
48
49The following patterns are considered violations:
50
51<!-- prettier-ignore -->
52```css
53a {
54color: pink;}
55```
56
57The following patterns are _not_ considered violations:
58
59<!-- prettier-ignore -->
60```css
61a { color: pink; }
62```
63
64<!-- prettier-ignore -->
65```css
66a { color: pink;
67}
68```
69
70### `"never-multi-line"`
71
72There _must never_ be whitespace before the closing brace in multi-line blocks.
73
74The following patterns are considered violations:
75
76<!-- prettier-ignore -->
77```css
78a {
79color: pink; }
80```
81
82The following patterns are _not_ considered violations:
83
84<!-- prettier-ignore -->
85```css
86a { color: pink; }
87```
88
89<!-- prettier-ignore -->
90```css
91a {
92color: pink;}
93```