digitalbazaar / eslint-config-digitalbazaar

BSD 3-Clause "New" or "Revised" License
2 stars 1 forks source link

How can we integrate linting into commit/PR process #32

Closed mattcollier closed 4 years ago

mattcollier commented 4 years ago

We recently accepted a PR from a helpful non-DB contributor which introduced a handful of linting errors. We have no way to know if devs are linting their own code.

Is github actions a good route to go for failing commits that introduce linting errors? Are there better solutions?

https://www.reactjunkie.com/github-actions-eslint-typescript

davidlehn commented 4 years ago

I've tried to add a package.json "lint" script when missing. Having that script everywhere is a start. There are npm and git hooks that could run that, but sometimes that's heavyweight and perhaps tricky to override when appropriate (WIP commits, aggressive wildcards linting non-tracked files, etc). There are some tools that help. Like just linting changed files in precommit hooks. For things that use travis we can add "npm run lint" as a test. github actions is another route which would also cover the many non-travis repos we have. Splitting between travis and gh actions is probably a pain.

mattcollier commented 4 years ago

We've got this covered now!