-
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.
Add -staged commands and git pre-commit hook
Running all of the linters on all of the files is resource-intensive and not very fun. In a perfect world, software engineers should only have to worry about checking their staged files and they should be able to trust that the rest of the files are already linted. Using the -staged suffix runs all fixers and testers (with the exception of depcheck) on only the staged files, and any mutations (e.g. Prettier formatting) are also added to the staged file so that it can be committed.
- Loading branch information
1 parent
ed5bc7c
commit 9b6008c
Showing
6 changed files
with
611 additions
and
21 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
ignores: ["depcheck", "eslint", "prettier", "stylelint", "typescript", "stylelint-config-recommended", "lint-staged"] |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"*": "prettier --write", | ||
"*.css": "stylelint --fix --allow-empty-input", | ||
"*.{js,jsx,md,ts,tsx}": "eslint -c .eslintrc.js --fix" | ||
} |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"*.{js,jsx,md,ts,tsx}": "eslint -c .eslintrc.js ", | ||
"*.css": "stylelint --config ${stylelintConfig} --allow-empty-input", | ||
"*": "prettier --check" | ||
} |
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
Oops, something went wrong.