aragon / aragon.js

(Aragon 1) A monorepo of JavaScript libraries for interacting with Aragon
https://aragon.org
GNU Affero General Public License v3.0
82 stars 58 forks source link

Pre-commit hook for linting #218

Open kernelwhisperer opened 5 years ago

kernelwhisperer commented 5 years ago

We can use husky and lint staged to lint before committing: https://github.com/okonet/lint-staged

Extract bits out of https://github.com/aragon/aragon.js/pull/221.

sohkai commented 5 years ago

I'd recommend to instead use something like pretty-quick and run the tests (which should also lint) on push.

kernelwhisperer commented 5 years ago

Hmm, the problem with pretty-quick is that you want to run the staged files through eslint (with the standard config) as well, not just prettier, like in here. That would have been even cleaner if documentation lint had an eslint-plugin to use instead, but...

Updated: "pre-push": "npm run test" to "pre-push": "npm run lint && npm run test"

sohkai commented 5 years ago

Good point, using all of ESLint is nicer! I'll also change aragon/aragon to use lint-staged instead of pretty-quick.