eslint-plugin-unicorn is an ESLint plugin with over 100 opinionated rules designed to improve your JavaScript codebase. It enforces modern JavaScript patterns, prevents common mistakes, and encourages cleaner, more consistent code — all with auto-fix support for most rules.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.
Installation
Install the plugin and get up and running in minutes
Configuration
Configure individual rules or use a preset config
Preset Configs
Use recommended, unopinionated, or all rule presets
Rules Overview
Browse all 100+ available rules with descriptions
Why eslint-plugin-unicorn?
Most ESLint plugins target specific domains. eslint-plugin-unicorn covers a broad range of JavaScript best practices — from enforcing modern array methods and ES modules, to preventing subtle bugs, to ensuring consistent naming conventions.100+ Rules
Comprehensive coverage of JavaScript best practices
Auto-fixable
Most rules support
--fix for automatic correctionESM-first
Built for modern JavaScript with flat config support
Quick start
Requires ESLint
>=9.20.0, flat config, and Node.js ^20.10.0 || >=21.0.0.Explore the rules
eslint-plugin-unicorn rules are organized by theme. Start with the categories most relevant to your project:Best Practices
Rules that prevent bugs and enforce sound coding patterns
Prefer Modern APIs
Rules that encourage modern JavaScript APIs over legacy equivalents
Code Style & Consistency
Rules that enforce consistent formatting and naming conventions
Deprecated Rules
Rules that have been removed or renamed