Closed andretchen0 closed 5 months ago
Sounds good, I'm planning to refactor @tresjs/eslint-config
to extend https://github.com/antfu/eslint-config flat config and using ESLint Stylistic. I did it with my personal eslint config last week to test it and it works fine.
Here is the task https://github.com/Tresjs/configs/issues/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 !
husky
plugin. Is that ok with you?Hi, @andretchen0 sounds good, so the pre-commit of husky will lint fix then?
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