Skip to content

Commit

Permalink
Playground: Remove parser from Copy config JSON (#6155)
Browse files Browse the repository at this point in the history
  • Loading branch information
lydell authored and duailibe committed May 25, 2019
1 parent 3654108 commit 9cb23fb
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion website/playground/Playground.js
Expand Up @@ -220,7 +220,18 @@ class Playground extends React.Component {
{editorState.showSidebar ? "Hide" : "Show"} options
</Button>
<Button onClick={this.clearContent}>Clear</Button>
<ClipboardButton copy={JSON.stringify(options, null, 2)}>
<ClipboardButton
copy={JSON.stringify(
// Remove `parser` since people usually paste this
// into their .prettierrc and specifying a toplevel
// parser there is an anti-pattern. Note:
// `JSON.stringify` omits keys whose values are
// `undefined`.
Object.assign({}, options, { parser: undefined }),
null,
2
)}
>
Copy config JSON
</ClipboardButton>
</div>
Expand Down

0 comments on commit 9cb23fb

Please sign in to comment.