Registry / testing / eslint-plugin-css-import-order

eslint-plugin-css-import-order

JSON →
library1.1.0jsnpmunverified

An ESLint plugin that enforces a consistent ordering of CSS imports, separating them from JavaScript/TypeScript imports. Version 1.1.0 is the latest stable release with moderate release cadence. It differs from alternatives by focusing specifically on CSS import ordering without additional rules, and it ships TypeScript type definitions.

testing
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ESM default import; also works with require in CJS projects.

import plugin from 'eslint-plugin-css-import-order'

Named export for rules object.

import { rules } from 'eslint-plugin-css-import-order'

Named export for configuration presets, e.g., configs.recommended.

import { configs } from 'eslint-plugin-css-import-order'

Installs the plugin, adds it to ESLint config, and shows a fix for CSS import ordering.

// Install: npm i -D eslint-plugin-css-import-order // .eslintrc.js module.exports = { plugins: ['css-import-order'], extends: ['plugin:css-import-order/recommended'], rules: { 'css-import-order/order': 'warn' } }; // Example code that triggers the rule: import A from 'module-a'; import './my-css.css'; // CSS import out of order import B from './module-b'; // After fix: import A from 'module-a'; import B from './module-b'; import './my-css.css';
Debug
Known footguns
breakingESLint peer dependency range <9.0.0; plugin incompatible with ESLint v9+
deprecatedThe recommended config uses deprecated 'extends' property; ESLint v9 recommends flat config
gotchaRule only checks CSS imports (ending in .css), not other style imports like .scss or .less
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
9 hits · last 30 days
gptbot
4
ahrefsbot
4
script
1
Resources