Documentation Index
Fetch the complete documentation index at: https://mintlify.com/sindresorhus/eslint-plugin-unicorn/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Before you install, confirm your environment meets these requirements:- Node.js
^20.10.0 || >=21.0.0 - ESLint
>=9.38.0 - Flat config — your project must use
eslint.config.js, not.eslintrc - ESM — your config file must use
import, notrequire()
eslint-plugin-unicorn is published as an ES module. You must use
import eslintPluginUnicorn from 'eslint-plugin-unicorn' — require() is not supported.Install
Install the package
Add
eslint-plugin-unicorn to your dev dependencies. If you don’t have ESLint yet, install it at the same time.Verify the installation
Confirm
eslint-plugin-unicorn appears in your package.json under devDependencies:package.json
Configure ESLint
Add the plugin to your See the configuration guide for preset options and manual rule setup.
eslint.config.js. The fastest way is to use a preset config:eslint.config.js