Skip to main content

at-rule-no-deprecated

Disallow deprecated at-rules.

    @viewport {}
/** ↑
* At-rules like this */

This rule flags at-rules that were removed or deprecated after being in the CSS specifications, including editor drafts, and were subsequently either:

  • shipped in a stable version of a browser
  • shipped by a developer channel/edition browser
  • shipped but behind experimental flags
  • polyfilled with some adoption before any browser actually shipped
  • had an MDN page at one point in time

The fix option can automatically fix some of the problems reported by this rule.

Prior art:

Options

true

{
"at-rule-no-deprecated": true
}

The following patterns are considered problems:

@viewport {}
a { @apply foo; }

The following patterns are not considered problems:

@starting-style {}
a { @layer {} }

Optional secondary options

ignoreAtRules

{ "ignoreAtRules": ["array", "of", "at-rules", "/regex/"] }

Given:

{
"at-rule-no-deprecated": [true, { "ignoreAtRules": ["/^view/", "apply"] }]
}

The following patterns are not considered problems:

@viewport {}
a { @apply foo; }