Code Linting & Formatting - mzogheib/quoll GitHub Wiki

Summary

  • Prettier
  • client-web is built with Create React App, which should have all the ESLint packages out of the box. But ESLint throws an error until eslint-config-react-app is installed as a dev dependency.

Bulk formatting

  • Run this command and commit the changes. Change . to the directory you wish to format.
yarn format .
  • Bulk formatting commits in git blame are not helpful
  • We wish to see and drill into the commits that made the functional code changes - not the formatting changes.
  • To avoid this, add the commit hash to .git-blame-ignore-revs
  • Make sure the file is added to your local git config
git config blame.ignoreRevsFile .git-blame-ignore-revs
  • Then, during a git blame, the formatting commit will be ignored
  • On the left is a recent diff for adding semicolons. But on the right the git blame shows the historical commit that introduced this code. image