Skip to content

Commit

Permalink
Install and configure husky
Browse files Browse the repository at this point in the history
Installed Husky (1), the tool that make Git hooks easy and can prevent
bad Git commits, pushes and more!

The `.huskyrc.js` configuration file is placed in the project root and
includes the commands to run for any supported Git hook (1). This
commit initially adds configs for the following hook(s):

- `pre-commit` - Run lint-staged (GH-44) before each commit (via
  `lint-staged` command) to ensure all staged files are compliant to
  all style guides.

References:
  (1) https://github.com/typicode/husky
  (2) https://github.com/typicode/husky/blob/master/DOCS.md#supported-hooks

Epic: GH-33
Depends on GH-4 GH-47 GH-49
Resolves GH-45
  • Loading branch information
arcticicestudio committed Jun 22, 2019
1 parent 2696968 commit 955cd7c
Show file tree
Hide file tree
Showing 3 changed files with 193 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .huskyrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright (C) 2017-present Arctic Ice Studio <[email protected]>
* Copyright (C) 2017-present Sven Greb <[email protected]>
*
* Project: snowsaw
* Repository: https://github.com/arcticicestudio/snowsaw
* License: MIT
*/

/**
* @file The husky configuration.
* @author Arctic Ice Studio <[email protected]>
* @author Sven Greb <[email protected]>
* @see https://github.com/typicode/husky
*/

module.exports = {
hooks: {
"pre-commit": "lint-staged"
}
};
171 changes: 171 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"lint": "npm-run-all lint:*"
},
"devDependencies": {
"husky": "2.4.1",
"lint-staged": "8.2.1",
"npm-run-all": "4.1.5",
"prettier": "1.18.2",
Expand Down

0 comments on commit 955cd7c

Please sign in to comment.