Skip to content

noDuplicateAtImportRules (CSS)

Language CSS
biome.json
{
"linter": {
"rules": {
"suspicious": {
"noDuplicateAtImportRules": "error"
}
}
}
}

Disallow duplicate @import rules.

Different quote styles and the url() form are treated as the same URL. Imports of that URL are duplicates when either import is unconditional or when their media lists share a condition. Two imports of the same URL remain valid only when both are conditional and their media conditions do not overlap. SCSS load imports are ignored because they don’t emit CSS @import rules.

@import 'a.css';
@import 'a.css';
code-block.css:2:2 lint/suspicious/noDuplicateAtImportRules ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

✖ Each @import should be unique unless differing by media queries.

1 │ @import 'a.css';
> 2 │ @import 'a.css';
│ ^^^^^^^^^^^^^^^
3 │

ℹ Importing the same stylesheet more than once is redundant and can cause an extra request.

ℹ Consider removing one of the duplicated imports.

@import "a.css";
@import 'a.css';
code-block.css:2:2 lint/suspicious/noDuplicateAtImportRules ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

✖ Each @import should be unique unless differing by media queries.

1 │ @import "a.css";
> 2 │ @import 'a.css';
│ ^^^^^^^^^^^^^^^
3 │

ℹ Importing the same stylesheet more than once is redundant and can cause an extra request.

ℹ Consider removing one of the duplicated imports.

@import url('a.css');
@import url('a.css');
code-block.css:2:2 lint/suspicious/noDuplicateAtImportRules ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

✖ Each @import should be unique unless differing by media queries.

1 │ @import url('a.css');
> 2 │ @import url('a.css');
│ ^^^^^^^^^^^^^^^^^^^^
3 │

ℹ Importing the same stylesheet more than once is redundant and can cause an extra request.

ℹ Consider removing one of the duplicated imports.

@import 'a.css';
@import 'b.css';
@import url('a.css') tv;
@import url('a.css') projection;