Registry / testing / eslint-plugin-unicorn-x

eslint-plugin-unicorn-x

JSON →
library3.2.1jsnpmunverified

A modern, faster fork of eslint-plugin-unicorn with 100+ powerful ESLint rules. Current version 3.2.1, requires ESLint >=9.29.0 and Node.js >=20.10.0. Uses flat config only. Offers performance improvements and reduced install footprint compared to upstream, with the same rule set but prefix 'unicorn-x' instead of 'unicorn'. Ships TypeScript types. Active development with frequent syncing from the upstream source.

npm install eslint-plugin-unicorn-x
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-UNIC
E
eslint-plugin-unicorn-x
testingjavascriptv3.2.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
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.

default
import eslintPluginUnicorn from 'eslint-plugin-unicorn-x';
const eslintPluginUnicorn = require('eslint-plugin-unicorn-x');
ESM-only package since v3.0.0; CommonJS require will fail.
recommended
import { recommended } from 'eslint-plugin-unicorn-x';
const { recommended } = require('eslint-plugin-unicorn-x');
recommended is a named export for preset configs; ESM-only.
rules
import { rules } from 'eslint-plugin-unicorn-x';
Access the rules object if you need to configure dynamically.

Basic flat config setup with two rules enabled from eslint-plugin-unicorn-x.

import eslintPluginUnicorn from 'eslint-plugin-unicorn-x'; import globals from 'globals'; export default [ { languageOptions: { globals: globals.builtin, }, plugins: { unicorn: eslintPluginUnicorn, }, rules: { 'unicorn-x/better-regex': 'error', 'unicorn-x/catch-error-name': 'error', }, }, ];
Debug
Known issues
breakingRequires ESLint >=9.29.0 and flat config only. Legacy eslintrc format is not supported.
fix
Migrate to flat config (eslint.config.js) and ensure ESLint version meets requirement.
affects: >=1.0.0
breakingNode.js >=20.10.0 required since v3.0.0. Older Node versions are not supported.
fix
Upgrade Node.js to version 20.10.0 or later.
affects: >=3.0.0
breakingESM-only since v3.0.0; CommonJS require will throw an error.
fix
Convert to ESM imports (import statement) or use dynamic import().
affects: >=3.0.0
deprecatedRule prefix changed from 'unicorn' (upstream) to 'unicorn-x' for this fork. Using 'unicorn/...' will not work.
fix
Replace 'unicorn/' with 'unicorn-x/' in rule names (e.g., 'unicorn/better-regex' -> 'unicorn-x/better-regex').
affects: >=1.0.0
gotchaThe default export is the plugin object, not a config. You must spread it into plugins or rules manually.
fix
Use `plugins: { unicorn: eslintPluginUnicorn }` in your flat config.
affects: >=1.0.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/node_modules/eslint-plugin-unicorn-x/index.js not supported.
Using CommonJS require() on an ESM-only package.
fix
Change to ESM import: `import eslintPluginUnicorn from 'eslint-plugin-unicorn-x';`
ESLint couldn't find the plugin 'eslint-plugin-unicorn-x'.
Plugin not installed or not properly declared in flat config.
fix
Run `npm install --save-dev eslint-plugin-unicorn-x` and ensure your flat config has `plugins: { unicorn: eslintPluginUnicorn }`.
Configuration for rule 'unicorn/better-regex' is invalid. Rule 'unicorn/better-regex' was not found.
Using upstream rule prefix 'unicorn/' instead of 'unicorn-x/'.
fix
Change rule name from 'unicorn/better-regex' to 'unicorn-x/better-regex'.
Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'globals' imported from /path/to/eslint.config.js
Missing the 'globals' package required for the recommended config.
fix
Install globals: `npm install --save-dev globals` or remove the globals reference.
Upgrade
Version history
3.2.1latest on npm
Audit
Dependencies
eslintrequiredpeer dependency required to run the plugin
globalsoptionalrequired for the recommended configuration to provide builtin globals
Agent activity
4 hits · last 30 days
node
4
Resources
eslint-plugin-unicorn-x — npm install eslint-plugin-unicorn-x · libregistry