Skip to content

at-rule-prelude-no-invalid

Disallow invalid preludes for at-rules.

@property --foo {}
/** ↑
* Preludes like this */

Use this rule to avoid at-rules that browsers ignore. An invalid prelude invalidates the whole block.

This rule considers preludes for at-rules defined within the CSS specifications, up to and including Editor’s Drafts, to be valid.

You can filter the CSSTree Syntax Reference to find out what preludes are valid for an at-rule, and use the languageOptions configuration property to extend it.

This rule supports 2 message arguments: the at-rule and the invalid prelude.

Prior art:

{
"at-rule-prelude-no-invalid": true
}

The following patterns are considered problems:

@property foo {}
@font-palette-values foo {}

The following patterns are not considered problems:

@property --foo {}
@font-palette-values --foo {}
{ "ignoreAtRules": ["array", "of", "at-rules", "/regex/"] }

Given:

{
"at-rule-prelude-no-invalid": [
true,
{ "ignoreAtRules": ["property", "/^font-/"] }
]
}

The following patterns are not considered problems:

@property foo;
@font-palette-values foo {}