-
Notifications
You must be signed in to change notification settings - Fork 46.8k
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
Use prettier api #11458
Conversation
scripts/prettier/index.js
Outdated
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); |
There was a problem hiding this comment.
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.
scripts/prettier/index.js
Outdated
e.stdout | ||
); | ||
process.exit(1); | ||
const args = Object.keys(defaultOptions).reduce((acc, _key) => { |
There was a problem hiding this comment.
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?
Thanks! |
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? |
* use prettier-api * fix string to boolean * fix eslint * fix typo * cleanup * use object assign
Fix #9500