erlanglab / erlangpl

Tool for developers working with systems running on the Erlang VM (BEAM). It helps with performance analysis.
http://www.erlang.pl/
Apache License 2.0
549 stars 40 forks source link

Add JS code formatting #47

Closed baransu closed 7 years ago

baransu commented 7 years ago

Prettier is an awesome tool for JS code formatting. We were requiring it in our README section in old UI repo.

Recently version 1.0 of prettier come out so I thought it's a good moment to add it as pre-commit hook.

I want to add similar thing for Elm later: https://github.com/avh4/elm-format

arkgil commented 7 years ago

Consistent code formatting is a sign of good quality 👍 Do I understand correctly that it doesn't configure actual git pre-commit hook? From what I've read some time ago, it's only possible to set them in local repositories.

baransu commented 7 years ago

Prettier only runs only on .js files formatting them. We're using another dependency for git pre-commit hook. In other project I had flow to typecheck JS before every commit.

baransu commented 7 years ago

I've updated prettier to newest version. I've also added elm-format for formatting Elm code.