Thu 19 Apr 2018 5:10PM

Pretty and lint fix on commit

AA Andrea Ascari Public Seen by 205

To prevent committing fiiles with lint errors and not prettified we can add the husky + lint-staged combo that runs lint --fix and prettiier on git commit.


Satya Fri 20 Apr 2018 11:14AM



RJ Fri 20 Apr 2018 12:48PM

oh, husky looks pretty cool. Sounds good


Vojtěch Šimetka Fri 20 Apr 2018 6:06PM

Can it be setup so that commits fail unless linter errors are fixed? What is the impact on the commit speed? Because running linter takes like 5 seconds at least.


Andrea Ascari Sat 21 Apr 2018 11:44AM

That's the aim of this: prevent to commit linting errors. I've been using it for last few months and it's acceptable to have to wait a little bit longer during commit instead of creating the PR, realising there are errors, and fix them. It also prevents accumulating errors in PR commits, so you can focus more on real errors.


Andrea Ascari Tue 24 Apr 2018 9:13AM

Closing, as the PR has been merged: https://github.com/Giveth/giveth-dapp/pull/319