Welcome to mirror list, hosted at ThFree Co, Russian Federation.

README.md « no-invalid-double-slash-comments « rules « lib « stylelint « node_modules « assets - github.com/fourtyone11/origin-hugo-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4543b4fd6bedbf524f8edcec2b4d64c9187f3595 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# no-invalid-double-slash-comments

Disallow double-slash comments (`//...`) which are not supported by CSS and [could lead to unexpected results](https://stackoverflow.com/a/20192639/130652).

```css
a {
  //color: pink;
}
/** ↑
 *  This comment */
```

If you are using a preprocessor that allows `//` single-line comments (e.g. Sass, Less, Stylus), this rule will not complain about those. They are compiled into standard CSS comments by your preprocessor, so stylelint will consider them valid. This rule only complains about the lesser-known method of using `//` to "comment out" a single-line of code in regular CSS. (If you didn't know this was possible, have a look at ["Single Line Comments (//) in CSS"](http://www.xanthir.com/b4U10)).

## Options

### `true`

The following patterns are considered violations:

```css
a {
  //color: pink;
}
```

```css
//a { color: pink; }
```

```css
// Comment {}
a {
  color: pink;
}
```

The following patterns are *not* considered violations:

```css
a {
  /* color: pink; */
}
```

```css
/* a { color: pink;  } */
```