-
Notifications
You must be signed in to change notification settings - Fork 34
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
adds lint-staged + husky, integrates prettier + eslint #36
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really nice DX feature. Just a couple of questions, but since I've got nothing to add, lgtm.
- Vercel's check did not pass
- Would you mind writing down to this PR's description how to use this husky thing? Like npm install then what? if there's anything extra to setup
- I see that every time lint-stage is executed, it runs prettier with change permission and also eslint. How is that being executed? Locally to this project's dependencies? I for instance don't have prettier globally (if that's the case) and don't pretend to install it globally as well. How will that work?
My point with this last question is: I think we should not have a DX feature that depends on global installs (If and only if this PR is doing that)
|
@LukeberryPi |
thank you for your patience. looks great, merging. |
What this PR does
It installs and makes the setup of
husky
andlint-staged
, to runeslint
andprettier
in staged files (files that will be commited). Because running any of them directly would run for all the files and that doesn't scale well.lint-staged
shows an interface before finishing your commit, running through the files and checking if any of them is a valid file for linting, and if it is, it will check it and try to fix its problems, if possible. If the problems can't be fixed automatically, you'll receive an error and will not be able to commit until you fix it.As some say, "fail fast", and what is faster than the developer commiting the changes?
It also integrates eslint and prettier using the
eslint-prettier-plugin
, this way they don't get overlapping rules and prevent "breaking" your file due to warnings or errors.Media Sample
2023-03-21.21-18-21.mp4