TheDocumentation 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.
recommended config enables most unicorn rules at 'error' severity. It covers the rules the maintainers consider good practice for the majority of JavaScript projects.
The preset also sets
languageOptions.globals to globals.builtin, so built-in globals like Promise, Map, and Set are recognized correctly. You do not need to configure this separately when using the preset.What it enables
Rules are included inrecommended when their meta.docs.recommended property is true or 'unopinionated'. Rules that are off by default (no recommended value) are not enabled. Two ESLint core rules that overlap with unicorn rules are explicitly disabled:
| Disabled core rule | Replaced by |
|---|---|
no-negated-condition | unicorn/no-negated-condition |
no-nested-ternary | unicorn/no-nested-ternary |
Usage
Add the preset as an entry in youreslint.config.js array:
Overriding individual rules
Place an additional config object after the preset to override specific rules:Legacy aliases
The plugin also exportsflat/recommended and flat/all as aliases for recommended and all respectively. These exist only for backward compatibility with older configurations and will be removed in a future version. Use configs.recommended and configs.all in new code.