Skip to content
This repository has been archived by the owner on Jan 20, 2020. It is now read-only.

integrate prettier for *.js code standardization #58

Closed
wants to merge 4 commits into from
Closed

integrate prettier for *.js code standardization #58

wants to merge 4 commits into from

Conversation

awitherow
Copy link
Contributor

@awitherow awitherow commented Jun 6, 2017

I saw there was desire in another thread to add prettier, figured I'd go ahead and do so since it is not too difficult 👍

We need to decide on rules though still.

They can be chosen here: https://github.com/prettier/prettier#options

Merge blocked by PR #40

@awitherow awitherow mentioned this pull request Jun 6, 2017
package.json Outdated
@@ -57,6 +60,14 @@
"url": "git://github.com/coinbase/gdax-node.git"
},
"scripts": {
"test": "mocha --ui qunit --bail --reporter list tests/*.js"
"test": "mocha --ui qunit --bail --reporter list tests/*.js",
"fmt": "node_modules/.bin/prettier --write 'index.js' 'lib/**/*.js' 'tests/**/*.js'",
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's call it format. Also, node_modules/.bin/ is unnecessary.

Copy link
Contributor

@fb55 fb55 Jun 6, 2017

Choose a reason for hiding this comment

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

Also, we're currently using four spaces in most places, so let's use that. Plus, we want es5 dangling commas and single quotes would be nice to have.


--single-quote --tab-width 4 --print-width 86 --trailing-comma es5 should do it (increasing the print width to account for three indentations).

Copy link
Contributor

@fb55 fb55 Jun 6, 2017

Choose a reason for hiding this comment

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

There also isn't a need for quotes around 'index.js'.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍 thanks for the comments, hadn't officially set up prettier in a project before, only was using the vscode plugin on pre-existing setups.

package.json Outdated
},
"lint-staged": {
"*.js": [
"node_modules/.bin/prettier --write",
Copy link
Contributor

Choose a reason for hiding this comment

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

node_modules/.bin/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was not 100% that one could use prettier if not installed globally.

@fb55
Copy link
Contributor

fb55 commented Jun 6, 2017

Thanks a lot for this PR! Not sure whether we shouldn't wait for #40 with this, as it will introduce a lot of merge conflicts.

@awitherow
Copy link
Contributor Author

@fb55 yeah sure thing! I can remove the refactor commit and then we can try to get #40 cleaned up and then we can run it again after merging.

@awitherow awitherow changed the title Prettier integrate prettier for *.js code standardization Jun 7, 2017
@fb55
Copy link
Contributor

fb55 commented Jul 26, 2017

Fixed with #60. Thanks a lot @awitherow for getting this started!

@fb55 fb55 closed this Jul 26, 2017
@awitherow
Copy link
Contributor Author

🙇 my pleasure!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants