noDuplicateAtImportRules (CSS)
Language CSS
Summary
Section titled “Summary”- Rule available since:
v1.8.0 - Diagnostic Category:
lint/suspicious/noDuplicateAtImportRules - This rule is recommended, meaning it is enabled by default.
- This rule doesn’t have a fix.
- The default severity of this rule is error.
- Sources:
- Same as
no-duplicate-at-import-rules - Inspired from
css/no-duplicate-imports
- Same as
How to configure
Section titled “How to configure”{ "linter": { "rules": { "suspicious": { "noDuplicateAtImportRules": "error" } } }}Description
Section titled “Description”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.
Examples
Section titled “Examples”Invalid
Section titled “Invalid”@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 │
ℹ 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 │
ℹ 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 │
ℹ Consider removing one of the duplicated imports.
@import 'a.css';@import 'b.css';@import url('a.css') tv;@import url('a.css') projection;Related links
Section titled “Related links”Copyright (c) 2023-present Biome Developers and Contributors.