Skip to content
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

Automatically Prettify and Lint after every commit using Husky and Lint-Staged #100

Open
nirmalhk7 opened this issue Oct 3, 2020 · 0 comments

Comments

@nirmalhk7
Copy link

Currently we're required to run npm run format to prettify the entire code and npm run lint:fix to fix the code. However, we can use Husky and lint-staged to automatically format those files which are staged into Git, making it more convenient.

We add Husky (which is a git hooks implementation for NodeJS projects) to execute our commands after pre-commit. We use lint-staged to filter out files which are in our staging area, and run our Prettify and ESLint commands there. This automation will massively increase code-maintenance in the future.

I'd like to implement this issue myself. Please let me know if its suitable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant