UseDocumentation 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.
structuredClone() instead of workarounds like JSON.parse(JSON.stringify(…)) or lodash’s cloneDeep. structuredClone is the modern, built-in way to create deep clones and correctly handles types that JSON cannot round-trip (such as Date, Map, Set, ArrayBuffer, and circular references).
| Recommended | ✅ recommended · ☑️ unopinionated |
| Suggestions | 💡 Has suggestions |
This rule only provides suggestions (not auto-fixes), because the semantics of
structuredClone differ subtly from JSON.parse(JSON.stringify(…)) — for example, structuredClone preserves undefined and throws on non-cloneable values.Examples
Options
Type:object
functions
Type: string[]Default:
[]
Additional function names or paths to flag as deep-clone helpers. _.cloneDeep() and lodash.cloneDeep() are always checked.