Skip to content

Commit

Permalink
ci: add pre-commit hook to lint and prettify (kelektiv#911)
Browse files Browse the repository at this point in the history
<!--- Provide a general summary of your changes in the Title above
(following the Conventional Commits standard) -->
<!-- More infos: https://www.conventionalcommits.org -->
<!-- Commit types:
https://github.com/insurgent-lab/conventional-changelog-preset#commit-types-->

## Description

<!--- Describe your changes in detail -->
add a pre-commit hook to run eslint on .ts files and prettify on JSON,
MD, and YML files

## Related Issue

<!--- This project only accepts pull requests related to open issues -->
<!--- If suggesting a new feature or change, please discuss it in an
issue first -->
<!--- If fixing a bug, there should be an issue describing it with steps
to reproduce -->
<!--- Please link to the issue here: -->
 fixes kelektiv#907

## Motivation and Context

<!--- Why is this change required? What problem does it solve? -->
a lot of times contributors make a PR just for it to fail because of
linting/prettification requirements and have to manually run the linters
locally and push a new commit with the fix. this change will
lint/prettify on commit automatically, removing friction to contribution

## How Has This Been Tested?

<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->

## Screenshots (if appropriate):

## Types of changes

<!--- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)

## Checklist:

<!--- Go over all the following points, and put an `x` in all the boxes
that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->

- [x] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [ ] I have added tests to cover my changes.
- [ ] All new and existing tests passed.
- [ ] If my change introduces a breaking change, I have added a `!`
after the type/scope in the title (see the Conventional Commits
standard).
  • Loading branch information
intcreator authored Nov 12, 2024
1 parent 441b4a2 commit e1140d1
Show file tree
Hide file tree
Showing 4 changed files with 681 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,4 @@ dist
.pnp.*

# husky local debugging helper scripts
.husky/_
.husky/_
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx lint-staged
Loading

0 comments on commit e1140d1

Please sign in to comment.