npm.io
1.0.0 • Published 4 months ago

@jchiam/eslint-plugin-css-in-js

Licence
MIT
Version
1.0.0
Deps
0
Size
25 kB
Vulns
0
Weekly
0

npm Codecov GitHub last commit license

eslint-plugin-css-in-js

This plugin provides a collection of ESLint rules that help with linting CSS-in-JS codebases.

Requirements

  • ESLint 9 or 10
  • Node.js >= 22

Installation

npm i -D eslint @jchiam/eslint-plugin-css-in-js

Usage

Add the plugin to your eslint.config.js:

import cssInJs from '@jchiam/eslint-plugin-css-in-js';

export default [
  {
    plugins: {
      '@jchiam/css-in-js': cssInJs
    },
    rules: {
      '@jchiam/css-in-js/css-concentric-order': 'warn'
    }
  }
];

No rules are enabled by default — add only the rules you need.

Supported Rules

Breaking Changes

v0 (legacy) to current

Migrated to ESLint flat config (required for ESLint 9+). The .eslintrc format is no longer supported.

Plugin registration changes from .eslintrc:

{
  "plugins": ["@jchiam/eslint-plugin-css-in-js"],
  "rules": {
    "@jchiam/css-in-js/css-concentric-order": "warn"
  }
}

To eslint.config.js:

import cssInJs from '@jchiam/eslint-plugin-css-in-js';

export default [
  {
    plugins: { '@jchiam/css-in-js': cssInJs },
    rules: { '@jchiam/css-in-js/css-concentric-order': 'warn' }
  }
];

Keywords