Skip to content

Latest commit

 

History

History
76 lines (54 loc) · 1.17 KB

File metadata and controls

76 lines (54 loc) · 1.17 KB

at-rule-no-unknown

Disallow unknown at-rules. Should be used instead of Stylelint's at-rule-no-unknown.

    @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:

{
  "rules": {
    "at-rule-no-unknown": null,
    "scss/at-rule-no-unknown": true
  }
}

Options

true

The following patterns are considered warnings:

@unknown {}

The following patterns are not considered warnings:

@function foo () {}
@while ($i == 1) {}
@media (max-width: 960px) {}
@if ($i) {} @else {}

Optional secondary options

ignoreAtRules: ["/regex/", "string"]

Given:

["/^my-/i", "custom"]

The following patterns are not considered warnings:

@my-at-rule "x.css";
@my-other-at-rule {}
@MY-OTHER-AT-RULE {}
@custom {}