Skip to main content

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.

In addition to recommended, the plugin ships two alternative preset configs: all and unopinionated. Both set the same languageOptions and disable the same core rules as recommended.

When to use each config

unopinionatedrecommendedall
Rules includedUniversally agreed-upon subsetMost rulesEvery non-deprecated rule
Good forTeams that want to opt in graduallyMost projectsGreenfield projects, maximum strictness
StrictnessLowMediumHigh

All config

The all config enables every non-deprecated unicorn rule at 'error' severity.
The all config is intentionally very strict and includes rules that may not suit every codebase or coding style. Review each error before committing to this config, and use targeted overrides to disable rules that don’t apply to your project.
import eslintPluginUnicorn from 'eslint-plugin-unicorn';

export default [
  eslintPluginUnicorn.configs.all,
];
You can still override individual rules after the preset:
import eslintPluginUnicorn from 'eslint-plugin-unicorn';

export default [
  eslintPluginUnicorn.configs.all,
  {
    rules: {
      'unicorn/prevent-abbreviations': 'off',
    },
  },
];

Unopinionated config

The unopinionated config enables only the rules with recommended: 'unopinionated' in their metadata — a smaller subset of recommended containing rules that are broadly agreed-upon with little room for debate. Use unopinionated when your team wants the safety of unicorn’s best-practice rules without the more opinionated style choices that recommended includes (for example, unicorn/no-array-reduce or unicorn/prevent-abbreviations).
import eslintPluginUnicorn from 'eslint-plugin-unicorn';

export default [
  eslintPluginUnicorn.configs.unopinionated,
];
recommended includes all unopinionated rules plus additional rules that reflect the maintainers’ stronger stylistic preferences. If a rule appears in recommended but not unopinionated, it means reasonable teams can disagree about it. Starting with unopinionated and selectively adding rules from recommended gives you fine-grained control.

Build docs developers (and LLMs) love