-
-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Git pre-push hook to lint --fix
the project
#590
Comments
Sounds good, I'm planning to refactor |
Here is the task Tresjs/configs#4 |
Hey @alvarosabu. Wouldn't using ESLint Vue or extending it be more viable for Vue's "good practices"? |
Hi @damienmontastier Antfu's config extends the eslint vue rules with some opinionated overrides (which I agree) https://github.com/antfu/eslint-config/blob/main/src/configs/vue.ts You can check the tres eslint config here https://github.com/Tresjs/eslint-config |
Hey @alvarosabu !
|
Hi, @andretchen0 sounds good, so the pre-commit of husky will lint fix then? |
Yeah. Husky is a plugin that makes git hook configuration a bit more straightforward. The usual git commit, push, etc. commands won't change. They'll trigger a git hook configured by husky. |
Made a PR on Cientos: https://github.com/Tresjs/cientos/compare/chore/git-pre-push-lint?expand=1 |
Closing here on TresJS as there's now a PR on Cientos. Continuing the discussion there. |
Description
As a developer using TresJS ...
Problem
I forget to
lint --fix
before pushing. Others do too. This leads to messier commit histories, noisier diffs, and wasted time.Suggested solution
Add a client-side pre-push git hook to
lint --fix
the project and abort the push if errors exist.By default, the hook would run
lint --fix
during a push, before any objects have been transferred.If there are no linter errors after running
lint --fix
, it would:If there are unfixable-by-the-linter errors, it would:
Advantages
chore(lint): fix linter errors
Disadvantages
main
, everyone'sgit push
based on the branch will initially fail.pnpm lint --fix
takes a while to run.Alternative
Do nothing. Keep the project as-is.
Additional context
The project runs a linter as a CI step and fails unlinted PRs already.
Validations
The text was updated successfully, but these errors were encountered: