Some unicorn rules have been superseded by broader replacements, and others have been removed entirely. This page lists both categories so you can update your config accordingly.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.
- Deprecated rules still exist in the plugin but emit a deprecation warning when used. You should migrate to the replacement rule.
- Deleted rules have been removed from the plugin. Referencing them in your config will cause ESLint to error.
Deprecated rules
The following rules are deprecated. Each one has a direct replacement that covers all the same cases and more.| Old rule | Replacement | Notes |
|---|---|---|
unicorn/no-instanceof-array | unicorn/no-instanceof-builtins | Covers more built-in types beyond Array |
unicorn/no-length-as-slice-end | unicorn/no-unnecessary-slice-end | Covers more unnecessary slice-end patterns |
unicorn/no-array-push-push | unicorn/prefer-single-call | Covers more methods beyond Array.prototype.push |
When you see a deprecation warning for one of these rules, replace the old rule name with the replacement in your
eslint.config.js. The replacement rule is a drop-in that covers everything the old rule did, so you can switch without disabling any behavior.eslint.config.js
Deleted rules
The following rules no longer exist in the plugin. Remove any references to them from your config.| Deleted rule | Reason |
|---|---|
unicorn/import-index | Outdated — ES modules do not support importing a directory |
unicorn/no-array-instanceof | Replaced by unicorn/no-instanceof-builtins |
unicorn/no-fn-reference-in-iterator | Renamed to unicorn/no-array-callback-reference |
unicorn/no-reduce | Renamed to unicorn/no-array-reduce |
unicorn/no-unsafe-regex | Removed due to bugs |
unicorn/prefer-dataset | Renamed to unicorn/prefer-dom-node-dataset |
unicorn/prefer-event-key | Renamed to unicorn/prefer-keyboard-event-key |
unicorn/prefer-exponentiation-operator | Superseded by the built-in ESLint prefer-exponentiation-operator rule |
unicorn/prefer-flat-map | Renamed to unicorn/prefer-array-flat-map |
unicorn/prefer-node-append | Renamed to unicorn/prefer-dom-node-append |
unicorn/prefer-node-remove | Renamed to unicorn/prefer-dom-node-remove |
unicorn/prefer-object-has-own | Superseded by the built-in ESLint prefer-object-has-own rule |
unicorn/prefer-replace-all | Renamed to unicorn/prefer-string-replace-all |
unicorn/prefer-starts-ends-with | Renamed to unicorn/prefer-string-starts-ends-with |
unicorn/prefer-text-content | Renamed to unicorn/prefer-dom-node-text-content |
unicorn/prefer-trim-start-end | Renamed to unicorn/prefer-string-trim-start-end |
unicorn/regex-shorthand | Renamed to unicorn/better-regex |