ESLint plugin providing more than 100 powerful rules for enforcing consistent, error-free code style and catching common mistakes. Current stable version is 55.0.0, with frequent releases (often multiple per month). Key differentiators include a broad focus beyond stylistic concerns (e.g., security, performance, best practices), automatic fixing for many rules, and strong integration with XO. It requires ESLint >=8.56.0 and Node >=18.18, and ships TypeScript definitions.
npm install eslint-unicornVerified import paths — ran on the pinned version, not inferred.
Shows how to set up eslint-plugin-unicorn with flat config (ESLint >=8.56.0) using the recommended preset and additional rules.
Update Node.js to >=18.18 or pin eslint-plugin-unicorn to <60.0.0.
Replace 'unicorn/no-array-push-push' with 'unicorn/prefer-single-call'.
Replace 'unicorn/no-length-as-slice-end' with 'unicorn/no-unnecessary-slice-end'.
Upgrade ESLint to >=8.56.0 and migrate to flat config (eslint.config.js).
Import the plugin in eslint.config.js as shown in the quickstart.
Update ESLint to >=8.56.0 and use eslint.config.js.
Run 'npm install --save-dev eslint eslint-plugin-unicorn'.
Use 'const eslintPluginUnicorn = require('eslint-plugin-unicorn');' (no .default).