no-duplicate-at-import-rules
CSS / SCSS / LessCSS / SCSS / LessCSS / SCSS / Lesssuspiciousno fixdefault: offcss/stylelint-recommended
What it does
Section titled “What it does”Reports an @import that repeats an earlier one in the same file (same url, same media list; 'a.css' and url(a.css) are the same url).
Why it matters
Section titled “Why it matters”The second import is wasted: the browser fetches the file once, and the stylesheet is still parsed twice in some engines. It also hides which of the two position in the cascade is meant.
To fix, delete the repeat.
Example
Section titled “Example”@charset "utf-8";@import "a.css";@import url(a.css);@import "a.css" screen;@layer base;@import "b.css";...Configuration
Section titled “Configuration”css: lint: rules: no-duplicate-at-import-rules: warn # off (default), warn, errorless: lint: rules: no-duplicate-at-import-rules: warn # off (default), warn, errorscss: lint: rules: no-duplicate-at-import-rules: warn # off (default), warn, errorEnabled by the presets: css/stylelint-recommended.
Suppress one line with sudsy-disable-next-line no-duplicate-at-import-rules in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| stylelint | no-duplicate-at-import-rules |
full |