-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: configure lint-staged and pre-commit hook
Adds a Husky pre-commit hook that runs lint-staged, which has been configured to run 'lint' and 'format' on the file types specified in .lintstagedrc. This helps the developer by only running the lint and format scripts on files they have changed and staged, and keeps unlinted and unformatted commits out of the code base. Resolves: #26
- Loading branch information
1 parent
c96bb37
commit 00b362a
Showing
4 changed files
with
6 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npx lint-staged | ||
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
{ | ||
"*.(js|ts)": "eslint --fix" | ||
"*.{js,ts}": ["npm run lint"], | ||
"**/*.{js,jsx,ts,tsx,json,html,css,scss,md}": ["npm run format"] | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters