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

chore: add commit hooks #56

Merged
merged 2 commits into from
Feb 16, 2023
Merged

Conversation

privatenumber
Copy link
Collaborator

Problem

  • It was easy to miss minor linting errors and have the CI fail

Changes

  • Added lint-staged & simple-git-hooks to automatically lint the changes on commit

@@ -16,10 +16,17 @@
],
"bin": "dist/cli.mjs",
"scripts": {
"prepare": "simple-git-hooks",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This installs the commit hooks to git whenever the dev runs npm i or pnpm i.

"pre-commit": "pnpm lint-staged"
},
"lint-staged": {
"*.ts": "eslint --cache"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only trigger eslint when it matches *.ts (TypeScript) files.

Copy link
Owner

@Nutlope Nutlope left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, feel free to merge after resolving conflicts!

@privatenumber privatenumber merged commit 9ec7aee into Nutlope:main Feb 16, 2023
@privatenumber privatenumber deleted the git-hooks branch February 16, 2023 23:39
@kcoderhtml kcoderhtml mentioned this pull request Feb 17, 2023
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

Successfully merging this pull request may close these issues.

2 participants