Adding to precommit hooks
Open question about precommit hooks. We can create individual PR's if we agree.
- Unit Tests? Obviously need to improve testing as a whole but it can be good to ensure tests are ran.
- Linting with Eslint - We have a lint script but it does not get activated yet. Need another ticket to address linting issues. Mainly a11y and TS errors/warnings.
- Markdown spellcheck
- JSHint
- CSS Linting: A CSS linter that helps you avoid errors and enforce conventions.
- Commitlint helps your team adhere to a commit convention.
Feel free to comment below.
Some amazing ideas here!
This is a preference because I like people to commit early and often (even if it's not 100%). However, pull requests should not be merged without these checks passing.
My preference for these things would be individual GitHub actions that confirm these things when a pull request is opened.
Things we could start with immediately:
- ESLint
- TypeScript
- Prettier
- Tests
Which should block PRs from being merged.
And for the rest:
- The Markdown spellcheck seems like a great idea.
- JSHint seems to no longer be supported and has no recent activity, so I don't think I'd be in favor (unless there is something amazing we will miss)
- On CSS linting, is there something here that Prettier can't do, or should we just enforce prettier rules on PRs?
- Commitlint seems great, I would probably break that into a separate issue/discussion to argue on semantics. 😂
We could start with a warning (like a nice to have) until we have some firm docs and decisions.
I would love to explore this issue, starting with the items suggested as I want to learn more about GitHub actions (I also prefer the light commit approach)
we should update when possible so builds can pass when deploying in vercel,
@xiaoniuniu89 what updates are needed? 🤔 I'll get it added to the top of my pile.
will be nice to prevent commit if lint fails, that was problem with my last pr.
I caught it from running npm run build