-
-
Notifications
You must be signed in to change notification settings - Fork 451
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add prettier #409
Add prettier #409
Conversation
Codecov Report
@@ Coverage Diff @@
## master #409 +/- ##
==========================================
- Coverage 84.18% 80.97% -3.21%
==========================================
Files 6 6
Lines 177 184 +7
Branches 41 49 +8
==========================================
Hits 149 149
- Misses 12 19 +7
Partials 16 16
Continue to review full report at Codecov.
|
package.json
Outdated
"prettier --trailing-comma all --write ", | ||
"git add" | ||
], | ||
"test/**/*.test.js": [ |
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.
Should we also include test/helpers/createTestDirectory.js
?
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.
Do we need to do all of these or can we just run it on all .js files?
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.
@hzoo I think the only reason why we can't do this is that running on all .js files will affect fixtures
eslint-config-prettier is a good idea. I'm going to add it for babel/babel-preset-env#183. But seems like adding "arrow-parens": "off",
"indent": "off" is enough to make babel-config prettier-friendly. |
@@ -57,13 +56,12 @@ const write = function(filename, result, callback) { | |||
const content = JSON.stringify(result); | |||
|
|||
return zlib.gzip(content, function(err, data) { | |||
if (err) { return callback(err); } | |||
if (err) return callback(err); |
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.
I like the braces but ok
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.
Note that this is not prettier doing. Prettier will keep the {} as they were inputted. But, if there are braces, the expression will be on its own line, if there are no braces, the expression is inline like it is here.
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.
Ok I didn't think so
It might be fine to just remove the few style rules we have in eslint-config-babel? |
Enables prettier
//cc @vjeux Not many drastic changes here, but in case you want to have a look
//cc @hzoo @yavorsky How should we handle eslint? I disabled one rule
arrow-parens
as it was interfering, should we extendeslint-config-prettier
in our config?