UNPKG

1.59 kBMarkdownView Raw
1# comment-whitespace-inside
2
3Require or disallow whitespace on the inside of comment markers.
4
5<!-- prettier-ignore -->
6```css
7 /* comment */
8/** ↑ ↑
9 * The space inside these two markers */
10```
11
12Any 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
16The [`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
24There _must always_ be whitespace inside the markers.
25
26The following patterns are considered violations:
27
28<!-- prettier-ignore -->
29```css
30/*comment*/
31```
32
33<!-- prettier-ignore -->
34```css
35/*comment */
36```
37
38<!-- prettier-ignore -->
39```css
40/** comment**/
41```
42
43The following patterns are _not_ considered violations:
44
45<!-- prettier-ignore -->
46```css
47/* comment */
48```
49
50<!-- prettier-ignore -->
51```css
52/** comment **/
53```
54
55<!-- prettier-ignore -->
56```css
57/**
58 * comment
59 */
60```
61
62<!-- prettier-ignore -->
63```css
64/* comment
65*/
66```
67
68### `"never"`
69
70There _must never_ be whitespace on the inside the markers.
71
72The following patterns are considered violations:
73
74<!-- prettier-ignore -->
75```css
76/* comment */
77```
78
79<!-- prettier-ignore -->
80```css
81/*comment */
82```
83
84<!-- prettier-ignore -->
85```css
86/** comment**/
87```
88
89The following patterns are _not_ considered violations:
90
91<!-- prettier-ignore -->
92```css
93/*comment*/
94```
95
96<!-- prettier-ignore -->
97```css
98/****comment****/
99```