eslint-plugin-clsx weekly downloads statistics
By temoncher · npm · ESLint plugins
An ESLint plugin for clsx/classnames
eslint-plugin-clsx has 80,622 recorded weekly downloads on npm, an increase of 207% over the past 30 days, ranking #675 of 3,247 tracked listings.
About eslint-plugin-clsx
eslint-plugin-clsx
An ESLint plugin for clsx/classnames
<!-- vscode-markdown-toc --> <!-- vscode-markdown-toc-config numbering=false autoSave=true /vscode-markdown-toc-config --> <!-- /vscode-markdown-toc --><a name='Installation'></a>Installation
You'll first need to install ESLint:
npm i eslint --save-dev
Next, install eslint-plugin-clsx:
npm install eslint-plugin-clsx --save-dev
<a name='Usage'></a>Usage
Here's an example ESLint configuration that:
- Enables the
recommendedconfiguration - Enables an optional/non-recommended rule
{
"extends": ["plugin:clsx/recommended"],
"rules": {
"clsx/no-redundant-clsx": "error"
}
}
<a name='Rules'></a>Rules
<!-- begin auto-generated rules list -->⚠️ Configurations set to warn in.
✅ Set in the recommended configuration.
🔧 Automatically fixable by the --fix CLI option.
| Name | Description | ⚠️ | 🔧 |
|---|---|---|---|
| forbid-array-expressions | forbid usage of array expressions inside clsx | ✅ | 🔧 |
| forbid-false-inside-object-expressions | forbid usage of false literal inside object expressions of clsx | ✅ | 🔧 |
| forbid-true-inside-object-expressions | forbid usage of true literal inside object expressions of clsx | ✅ | 🔧 |
| no-redundant-clsx | disallow redundant clsx usage | ✅ | 🔧 |
| no-spreading | forbid usage of object expression inside clsx | ✅ | 🔧 |
| prefer-logical-over-objects | forbid usage of object expression inside clsx | 🔧 | |
| prefer-merged-neighboring-elements | enforce merging of neighboring elements | ✅ | 🔧 |
| prefer-objects-over-logical | forbid usage of logical expressions inside clsx | 🔧 |
<a name='Presets'></a>Presets
| Name | Description | |
|---|---|---|
| ✅ | recommended | enables all recommended rules in this plugin |
all | enables all rules in this plugin |
<a name='Presetusage'></a>Preset usage
Presets are enabled by adding a line to the extends list in your config file. For example, to enable the recommended preset, use:
import { defineConfig } from "eslint/config";
import clsx from "eslint-plugin-clsx";
export default defineConfig(
/* Main config */
clsx.configs.flat.recommended,
);
or in legacy config (.eslintrc.json)
{
"extends": ["plugin:clsx/recommended"]
}
<a name='Settings'></a>Settings
This rule can optionally be configured with an object that represents imports that should be considered an clsx usage
import { defineConfig } from "eslint/config";
import clsx from "eslint-plugin-clsx";
export default defineConfig(
{
plugins: { clsx },
settings: {
clsxOptions: {
myclsx: ["default", "clsx"],
},
},
rules: {
'clsx/no-redundant-clsx': 'error',
}
}
);
or in legacy config (.eslintrc.json)
{
"settings": {
"clsxOptions": {
"myclsx": "default"
}
}
}
Examples of incorrect code for the { myclsx: 'default' } setting (with no-redundant-clsx rule enabled):
import mc from 'myclsx';
const singleClasses = mc('single-class');
Examples of incorrect code for the { myclsx: 'cn' } setting (with no-redundant-clsx rule enabled):
import { cn } from 'myclsx';
const singleClasses = cn('single-class');
Examples of incorrect code for the { myclsx: ['default', 'cn'] } setting (with no-redundant-clsx rule enabled):
import mc, { cn } from 'myclsx';
// both report errors
const singleClasses = cn('single-class');
const singleClasses = mc('single-class');
Default setting value is { clsx: ['default', 'clsx'], classnames: 'default' }
Description from the npm listing.
- eslint
- eslintplugin
- eslint-plugin
- clsx
- classnames
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (135)Similar npm ESLint plugins plugins
All 20 eslint-plugin-clsx alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/eslint-plugin-clsx. First seen Nov 15, 2026; last successful collection Dec 6, 2026. See the methodology.