1 | # comment-whitespace-inside
|
2 |
|
3 | Require or disallow whitespace on the inside of comment markers.
|
4 |
|
5 |
|
6 | ```css
|
7 | /* comment */
|
8 | /** ↑ ↑
|
9 | * The space inside these two markers */
|
10 | ```
|
11 |
|
12 | Any number of asterisks are allowed at the beginning or end of the comment. So `/** comment **/` is treated the same way as `/* comment */`.
|
13 |
|
14 | **Caveat:** Comments within _selector and value lists_ are currently ignored.
|
15 |
|
16 | The [`fix` option](../../../docs/user-guide/usage/options.md#fix) can automatically fix all of the problems reported by this rule.
|
17 |
|
18 | ## Options
|
19 |
|
20 | `string`: `"always"|"never"`
|
21 |
|
22 | ### `"always"`
|
23 |
|
24 | There _must always_ be whitespace inside the markers.
|
25 |
|
26 | The following patterns are considered violations:
|
27 |
|
28 |
|
29 | ```css
|
30 | /*comment*/
|
31 | ```
|
32 |
|
33 |
|
34 | ```css
|
35 | /*comment */
|
36 | ```
|
37 |
|
38 |
|
39 | ```css
|
40 | /** comment**/
|
41 | ```
|
42 |
|
43 | The following patterns are _not_ considered violations:
|
44 |
|
45 |
|
46 | ```css
|
47 | /* comment */
|
48 | ```
|
49 |
|
50 |
|
51 | ```css
|
52 | /** comment **/
|
53 | ```
|
54 |
|
55 |
|
56 | ```css
|
57 | /**
|
58 | * comment
|
59 | */
|
60 | ```
|
61 |
|
62 |
|
63 | ```css
|
64 | /* comment
|
65 | */
|
66 | ```
|
67 |
|
68 | ### `"never"`
|
69 |
|
70 | There _must never_ be whitespace on the inside the markers.
|
71 |
|
72 | The following patterns are considered violations:
|
73 |
|
74 |
|
75 | ```css
|
76 | /* comment */
|
77 | ```
|
78 |
|
79 |
|
80 | ```css
|
81 | /*comment */
|
82 | ```
|
83 |
|
84 |
|
85 | ```css
|
86 | /** comment**/
|
87 | ```
|
88 |
|
89 | The following patterns are _not_ considered violations:
|
90 |
|
91 |
|
92 | ```css
|
93 | /*comment*/
|
94 | ```
|
95 |
|
96 |
|
97 | ```css
|
98 | /****comment****/
|
99 | ```
|