Skip to main content

no-invalid-position-at-import-rule

Disallow invalid position @import rules within a stylesheet.

a {}
@import 'foo.css';
/** โ†‘
* This @import */

Any @import rules must precede all other valid at-rules and style rules in a stylesheet (ignoring @charset), or else the @import rule is invalid.

Options#

true#

The following patterns are considered violations:

a {}
@import 'foo.css';
@media print {}
@import 'foo.css';

The following patterns are not considered violations:

@import 'foo.css';
a {}
/* some comment */
@import 'foo.css';
@charset 'utf-8';
@import 'foo.css';