{"id":19965,"library":"eslint-plugin-unicorn-x","title":"eslint-plugin-unicorn-x","description":"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.","status":"active","version":"3.2.1","language":"javascript","source_language":"en","source_url":"https://github.com/es-tooling/eslint-plugin-unicorn-x","tags":["javascript","eslint","eslintplugin","eslint-plugin","unicorn","linter","lint","style","xo","typescript"],"install":[{"cmd":"npm install eslint-plugin-unicorn-x","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-unicorn-x","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-unicorn-x","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency required to run the plugin","package":"eslint","optional":false},{"reason":"required for the recommended configuration to provide builtin globals","package":"globals","optional":true}],"imports":[{"note":"ESM-only package since v3.0.0; CommonJS require will fail.","wrong":"const eslintPluginUnicorn = require('eslint-plugin-unicorn-x');","symbol":"default","correct":"import eslintPluginUnicorn from 'eslint-plugin-unicorn-x';"},{"note":"recommended is a named export for preset configs; ESM-only.","wrong":"const { recommended } = require('eslint-plugin-unicorn-x');","symbol":"recommended","correct":"import { recommended } from 'eslint-plugin-unicorn-x';"},{"note":"Access the rules object if you need to configure dynamically.","wrong":null,"symbol":"rules","correct":"import { rules } from 'eslint-plugin-unicorn-x';"}],"quickstart":{"code":"import eslintPluginUnicorn from 'eslint-plugin-unicorn-x';\nimport globals from 'globals';\n\nexport default [\n  {\n    languageOptions: {\n      globals: globals.builtin,\n    },\n    plugins: {\n      unicorn: eslintPluginUnicorn,\n    },\n    rules: {\n      'unicorn-x/better-regex': 'error',\n      'unicorn-x/catch-error-name': 'error',\n    },\n  },\n];","lang":"typescript","description":"Basic flat config setup with two rules enabled from eslint-plugin-unicorn-x."},"warnings":[{"fix":"Migrate to flat config (eslint.config.js) and ensure ESLint version meets requirement.","message":"Requires ESLint >=9.29.0 and flat config only. Legacy eslintrc format is not supported.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Upgrade Node.js to version 20.10.0 or later.","message":"Node.js >=20.10.0 required since v3.0.0. Older Node versions are not supported.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Convert to ESM imports (import statement) or use dynamic import().","message":"ESM-only since v3.0.0; CommonJS require will throw an error.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Replace 'unicorn/' with 'unicorn-x/' in rule names (e.g., 'unicorn/better-regex' -> 'unicorn-x/better-regex').","message":"Rule prefix changed from 'unicorn' (upstream) to 'unicorn-x' for this fork. Using 'unicorn/...' will not work.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Use `plugins: { unicorn: eslintPluginUnicorn }` in your flat config.","message":"The default export is the plugin object, not a config. You must spread it into plugins or rules manually.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Change to ESM import: `import eslintPluginUnicorn from 'eslint-plugin-unicorn-x';`","cause":"Using CommonJS require() on an ESM-only package.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/node_modules/eslint-plugin-unicorn-x/index.js not supported."},{"fix":"Run `npm install --save-dev eslint-plugin-unicorn-x` and ensure your flat config has `plugins: { unicorn: eslintPluginUnicorn }`.","cause":"Plugin not installed or not properly declared in flat config.","error":"ESLint couldn't find the plugin 'eslint-plugin-unicorn-x'."},{"fix":"Change rule name from 'unicorn/better-regex' to 'unicorn-x/better-regex'.","cause":"Using upstream rule prefix 'unicorn/' instead of 'unicorn-x/'.","error":"Configuration for rule 'unicorn/better-regex' is invalid. Rule 'unicorn/better-regex' was not found."},{"fix":"Install globals: `npm install --save-dev globals` or remove the globals reference.","cause":"Missing the 'globals' package required for the recommended config.","error":"Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'globals' imported from /path/to/eslint.config.js"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}