Skip to content

Commit

Permalink
Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
fisker committed May 7, 2024
1 parent bfde04f commit 88433e5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/rules/prefer-structured-clone.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<!-- end auto-generated rule header -->
<!-- Do not manually modify this header. Run: `npm run fix:eslint-docs` -->

<!-- Remove this comment, add more detailed description. -->
[`structuredClone`](https://developer.mozilla.org/en-US/docs/Web/API/structuredClone) is a modern way to create deep clone.

## Fail

Expand Down
1 change: 1 addition & 0 deletions test/prefer-structured-clone.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const {test} = getTester(import.meta);
// `JSON.parse(JSON.stringify(…))`
test.snapshot({
valid: [
'structuredClone(foo)',
'JSON.parse(new JSON.stringify(foo))',
'new JSON.parse(JSON.stringify(foo))',
'JSON.parse(JSON.stringify())',
Expand Down

0 comments on commit 88433e5

Please sign in to comment.