Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use prettier api #11458

Merged
merged 6 commits into from
Nov 5, 2017
Merged

Use prettier api #11458

merged 6 commits into from
Nov 5, 2017

Conversation

xjlim
Copy link
Contributor

@xjlim xjlim commented Nov 5, 2017

Fix #9500

const args = Object.keys(defaultOptions).reduce((acc, _key) => {
const camelize = /[\-\:]([a-z])/g;
const capitalize = token => token[1].toUpperCase();
const prettierKey = _key.replace(camelize, capitalize);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unnecessary. Just convert the options to use camel case form instead where they are defined.

e.stdout
);
process.exit(1);
const args = Object.keys(defaultOptions).reduce((acc, _key) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just use Object.assign({}, options, defaultOptions) here?

@gaearon gaearon merged commit 40fbed5 into facebook:master Nov 5, 2017
@gaearon
Copy link
Collaborator

gaearon commented Nov 5, 2017

Thanks!

@gaearon
Copy link
Collaborator

gaearon commented Nov 5, 2017

When there is a syntax error, I now see a useless Babylon stack trace. Could you please change the output to only keep the message and the code frame but omit the stack trace?

@xjlim xjlim mentioned this pull request Nov 6, 2017
Ethan-Arrowood pushed a commit to Ethan-Arrowood/react that referenced this pull request Dec 8, 2017
* use prettier-api

* fix string to boolean

* fix eslint

* fix typo

* cleanup

* use object assign
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants