Navigation Menu

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 for JS formatting #3934

Merged
merged 3 commits into from Jun 4, 2019
Merged

Conversation

ThiefMaster
Copy link
Member

@ThiefMaster ThiefMaster commented May 17, 2019

TODO:

  • Actually reformat all the files
  • Ensure that CI checks are still fine (should be since prettier is integrated in eslint)
# Reformat all our JS
npx prettier --write indico/**/*.{js,jsx}
# or if we don't bother about old code:
npx prettier --write indico/modules/events/logs/**/*.{jsx,js}
npx prettier --write indico/modules/rb/client/js/**/*.{jsx,js}
npx prettier --write indico/web/client/js/react/**/*.{jsx,js}
npx prettier --write indico/web/client/js/utils/**/*.js

I will apply the prettier changes once I'm back from vacation (by then I think most ongoing work that involves bigger JS changes should be done and likely ready to merge); if it need to be done earlier please use git commit --author 'Indico Team <indico-team@cern.ch> as the commit will be MASSIVE!


Opinions welcome:

@mvidalgarcia
Copy link
Member

My opinion:

  • jsxBracketSameLine: true
  • printWidth - No strong opinion, either 100 or 120 look reasonable.

@pferreir
Copy link
Member

* `jsxBracketSameLine: true`

I would probably prefer false because of the visual confusion that true causes with nested content (see e.g. here)

* `printWidth` - No strong opinion, either 100 or 120 look reasonable.

Same here.

@ThiefMaster
Copy link
Member Author

ThiefMaster commented May 22, 2019

Good point; and it makes adding a new prop at the end of the list easier because you don't have to put the cursor between the end of the previous prop's value and the >

@ThiefMaster ThiefMaster force-pushed the prettier branch 2 times, most recently from 153aaae to 329a816 Compare June 4, 2019 13:09
@ThiefMaster ThiefMaster marked this pull request as ready for review June 4, 2019 13:39
@ThiefMaster ThiefMaster merged commit 053095a into indico:master Jun 4, 2019
@ThiefMaster ThiefMaster deleted the prettier branch June 4, 2019 14:01
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.

None yet

3 participants