GitHub Action for Linting with Vercel
I’m trying to setup GitHub Actions to lint and prettify the code in my turborepo monorepo; it’s great and works really well to get everything set, but it’s throwing an error from Vercel; the
lint-action
user doesn’t have access to my Vercel account to create a preview deployment, and at the same time I don’t want linting to create a separate deployment. Given these things, is there a reason to use actions for this instead of something like lint-staged
as a pre-commit hook?38 Replies
You just need a job that does something like this
Don't deploy anything
Okay so to be very clear - is the action creating a commit with the formatting done?
Want to gauge my roast appropriately
Yes…
Okay, that's very very bad
Actions should flag code that is bad, not fix it
So don’t auto fix is what you’re saying?
Depends on your definition of "auto fix"
The Git host is 10000% the wrong place to autofix
The goal of CI is to validate, not fix
Fwiw I don't even do typechecks on the Vercel build, I let it deploy if it is at all possible for it to build. I HARD BLOCK merging to main on our CI tho (typechecks, lint and prettier)
+1 for a pre commit hook that isn't a bad idea
I personally hate precommit hooks but that is the thing you're looking for here
This is cursed
VERY cursed
The IDE should catch this stuff as you work to be fair
Never been so tempted to open an issue on a repo that's just "this is bad please archive it"
But like,,,
Please don't do this.
This this this this
If your editor is failing you, CI should ALERT you to that
CI test for it if you're vaguely worried about it tbh
CI is really cool
I don't like precommit hooks because they force developers to use git a specific way, I don't like prescribing workflows to my teams
But if you really want the "act of committing" to "imply that the code will auto-fix" for some reason, sure go nuts
don't do that on github
Okay this is really good to know, I’m super new to actions tbh and I’ve been eliminating pre-commit hooks for precisely that reason.
Theo - ping.gg (@t3dotgg)
People have github actions that make code changes??? Oh god oh no this is like precommit hooks but 100x worse
Twitter
You inspired a tweet