Skip to content

Add Husky & lint-staged to automatically format code before commits #78

@DamienSable

Description

@DamienSable

Is your feature request related to a problem?
I was reviewing a few recent Pull Requests from other contributors, and I noticed some minor formatting inconsistencies (mixing tabs/spaces, missing semicolons). Right now, contributors have to remember to run npm run format manually before pushing.

Describe the solution you'd like
We should set up husky and lint-staged. This will automatically hook into Git so that whenever a contributor types git commit, it will silently run Prettier and ESLint only on the files they changed. If the formatting is wrong, it auto-fixes it before the commit completes.

Alternative considered
We have GitHub Actions (CI) checking this, but it's much faster for the developer to get this feedback locally before they push to GitHub.

Metadata

Metadata

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions