Playground: Remove parser from Copy config JSON (#6155)

This commit is contained in:
Simon Lydell authored and Lucas Duailibe committed 2019-05-25 09:31:10 -03:00
1 parent 3654108ebe
commit 9cb23fbf24
1 file changed
+12 -1
+12 -1
View File
@@ -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>