blob: 3b0932e55e67933142b22f63a3a43d104c38050e (
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
# at-rule-no-unknown
Disallow unknown at-rules. Should be used **instead of** stylelint's [at-rule-no-unknown](https://stylelint.io/user-guide/rules/at-rule-no-unknown).
```css
@unknown (max-width: 960px) {}
/** ↑
* At-rules like this */
```
This rule is basically a wrapper around the mentioned core rule, but with added SCSS-specific `@`-directives. So if you use the core rule, `@if`, `@extend` and other Sass-y things will get warnings. You must disable stylelint's core rule to make this rule work:
```json
{
"rules": {
"at-rule-no-unknown": null,
"scss/at-rule-no-unknown": true
}
}
```
## Options
### `true`
The following patterns are considered warnings:
```css
@unknown {}
```
The following patterns are *not* considered warnings:
```css
@function foo () {}
```
```css
@while ($i == 1) {}
```
```css
@media (max-width: 960px) {}
```
```css
@if ($i) {} @else {}
```
## Optional secondary options
### `ignoreAtRules: ["/regex/", "string"]`
Given:
```js
["/^my-/i", "custom"]
```
The following patterns are *not* considered warnings:
```css
@my-at-rule "x.css";
```
```css
@my-other-at-rule {}
```
```css
@MY-OTHER-AT-RULE {}
```
```css
@custom {}
```
|