Skip to content

Run Prettier JS #6795

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

Merged
merged 1 commit into from
Jul 13, 2020
Merged

Run Prettier JS #6795

merged 1 commit into from
Jul 13, 2020

Conversation

dplewis
Copy link
Member

@dplewis dplewis commented Jul 13, 2020

A lot of PR are being formatted via Husky which makes review difficult.

  • Pin Packages
  • Use prettier on the entire project

@dplewis dplewis requested a review from mtrezza July 13, 2020 17:44
@codecov
Copy link

codecov bot commented Jul 13, 2020

Codecov Report

Merging #6795 into master will not change coverage.
The diff coverage is 99.35%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #6795   +/-   ##
=======================================
  Coverage   93.89%   93.89%           
=======================================
  Files         169      169           
  Lines       12054    12054           
=======================================
  Hits        11318    11318           
  Misses        736      736           
Impacted Files Coverage Δ
src/Controllers/AnalyticsController.js 83.33% <ø> (ø)
src/Controllers/PushController.js 97.84% <ø> (ø)
src/Routers/FeaturesRouter.js 100.00% <ø> (ø)
src/Routers/GraphQLRouter.js 46.66% <ø> (ø)
src/Routers/IAPValidationRouter.js 85.00% <ø> (ø)
src/Routers/PurgeRouter.js 83.33% <ø> (ø)
src/vendor/mongodbUrl.js 100.00% <ø> (ø)
src/Controllers/LoggerController.js 91.57% <50.00%> (ø)
src/Controllers/HooksController.js 94.69% <100.00%> (ø)
src/Controllers/ParseGraphQLController.js 95.89% <100.00%> (ø)
... and 32 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ebb0727...d3860a0. Read the comment docs.

Copy link
Member

@davimacedo davimacedo left a comment

Choose a reason for hiding this comment

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

Good idea!

@dplewis dplewis merged commit e6a6354 into master Jul 13, 2020
@dplewis dplewis deleted the prettier-format branch July 13, 2020 18:06
@mtrezza
Copy link
Member

mtrezza commented Jul 13, 2020

@dplewis thanks for picking up that issue so quickly. I find some of these new formatting rules rather verbose 🧐 Would it make sense to disable a single rule like these additional parenthesis? Would that pre-commit hook then be deployed with the repo or how does this work?

@dplewis
Copy link
Member Author

dplewis commented Jul 13, 2020

You would have to update .prettierrc with arrowParens: avoid or something like that

@mtrezza
Copy link
Member

mtrezza commented Jul 13, 2020

Do we want the code to be that verbose, or is that verbosity only my subjective impression? I haven't seen these mandatory parentheses in other lints and find them quite unintuitive, but maybe that's just me?

@davimacedo
Copy link
Member

I also don't like these additional parentheses. I'm in for removing them.

@mtrezza
Copy link
Member

mtrezza commented Jul 13, 2020

According to the docs this should work:

prettier --write --arrow-parens avoid

Let's see if there is something else we want to change...

@dplewis
Copy link
Member Author

dplewis commented Jul 13, 2020

The space after function?

function ()

@davimacedo
Copy link
Member

I think it would be better to change https://github.com/parse-community/parse-server/blob/master/.prettierrc so we don't need to send this option every time we run the command.

@davimacedo
Copy link
Member

I like the space after functions, but we can also change if you prefer.

@mtrezza
Copy link
Member

mtrezza commented Jul 13, 2020

The space after function?

I'm just reading up on this. I would also write it without space, but there seem to be good arguments for having a space.

@dplewis
Copy link
Member Author

dplewis commented Jul 13, 2020

Let’s keep the space

@mtrezza
Copy link
Member

mtrezza commented Jul 13, 2020

It seems that there isn't even an option for space-after-function in prettier. I just scanned through the (endless) threads and the last result was a somewhat 50-50 opinion and prettier decided to make it mandatory and not optional.

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

Successfully merging this pull request may close these issues.

3 participants