valibot
valibot copied to clipboard
feat: add husky and lint-staged
feat: add Husky and lint-staged for pre-commit checks
- Add Husky pre-commit hook
- Configure lint-staged to run prettier, eslint and tsc on staged files.
- Dev tooling only; no runtime code changes
Instant feedback. Streamlines contributions by enforcing consistent formatting locally, reducing back-and-forth on formatting fixes
The latest updates on your projects. Learn more about Vercel for GitHub.
| Project | Deployment | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| valibot | Preview | Comment | Sep 19, 2025 0:08am |
I never used Husky and lint-staged before. Does this run linting and formatting on every commit? If so, I am not sure if I want that. Mostly because it probably takes more than 30 seconds to run everything. Is it smart enough to only run it on files or folders that have changed?
I never used Husky and lint-staged before. Does this run linting and formatting on every commit? If so, I am not sure if I want that. Mostly because it probably takes more than 30 seconds to run everything. Is it smart enough to only run it on files or folders that have changed?
This only happens automatically for files that will be committed.
The only exception is when we can't check the type validity of a single file. In this case, we run tsc on the project (this is only configured in i18n). For this package and my computer, it's almost instantaneous.
I really like it when open-source projects have these hooks. Because many people use different editors, different environments, or are simply inattentive or constantly switching between projects. This helps.