Skip to content

Commit 955cd7c

Browse files
Install and configure husky
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
1 parent 2696968 commit 955cd7c

File tree

3 files changed

+193
-0
lines changed

3 files changed

+193
-0
lines changed

.huskyrc.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
* Copyright (C) 2017-present Arctic Ice Studio <[email protected]>
3+
* Copyright (C) 2017-present Sven Greb <[email protected]>
4+
*
5+
* Project: snowsaw
6+
* Repository: https://github.com/arcticicestudio/snowsaw
7+
* License: MIT
8+
*/
9+
10+
/**
11+
* @file The husky configuration.
12+
* @author Arctic Ice Studio <[email protected]>
13+
* @author Sven Greb <[email protected]>
14+
* @see https://github.com/typicode/husky
15+
*/
16+
17+
module.exports = {
18+
hooks: {
19+
"pre-commit": "lint-staged"
20+
}
21+
};

package-lock.json

Lines changed: 171 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"lint": "npm-run-all lint:*"
3333
},
3434
"devDependencies": {
35+
"husky": "2.4.1",
3536
"lint-staged": "8.2.1",
3637
"npm-run-all": "4.1.5",
3738
"prettier": "1.18.2",

0 commit comments

Comments
 (0)