CodeHubOrg / codehub-mentorships

CodeHub Mentorship platform - built with Laravel and React
3 stars 0 forks source link

Add prettier and a GitHub action to run the linter #44

Closed NeverFearTheasHere closed 4 years ago

NeverFearTheasHere commented 4 years ago

This pull request adds the Prettier code formatting tool. I've integrated it with eslint, so that when we run npm run lint, it runs prettier as well.

Prettier works with most popular code editors, it might be worth setting this up in your editor so that it will just run Prettier automatically when you save a file. There are some more details about how to set this up here.

I've also added a basic GitHub action which will run the linter, once using node 10 and once using node 12. The results of these checks show up on all Pull Requests as green (if they pass) or red (if they fail), like this:

If the checks are successful: image

If some of the checks fail: image