Skip to content

Commit c758376

Browse files
committed
Replace githooks with husky and lint-staged
1 parent 817f280 commit c758376

File tree

6 files changed

+409
-86
lines changed

6 files changed

+409
-86
lines changed

.githooks/deploy

Lines changed: 0 additions & 32 deletions
This file was deleted.

.githooks/pre-commit

Lines changed: 0 additions & 35 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
nvm install
1111
# Then, install all project dependencies.
1212
npm install
13-
# Install the git hooks.
14-
./.githooks/deploy
1513
# Set up a `.env` file with the appropriate secrets.
1614
touch .env
1715
```

demo/js/demo.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -413,10 +413,6 @@ const Example = () => (
413413
<br />
414414
npm install
415415
<br />
416-
# Install the git hooks.
417-
<br />
418-
./.githooks/deploy
419-
<br />
420416
# Set up a `.env` file with the appropriate secrets.
421417
<br />
422418
touch .env

package.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@
8585
"flow-bin": "^0.76.0",
8686
"flow-copy-source": "^2.0.2",
8787
"html-webpack-plugin": "^3.2.0",
88+
"husky": "^1.2.1",
8889
"jest": "^23.5.0",
90+
"lint-staged": "^8.1.0",
8991
"prettier": "^1.12.0",
9092
"raf": "^3.4.0",
9193
"react": "^16.4.0",
@@ -110,5 +112,15 @@
110112
"peerDependencies": {
111113
"react": "^15.4.0 || ^16.0.0",
112114
"react-dom": "^15.4.0 || ^16.0.0"
115+
},
116+
"husky": {
117+
"hooks": {
118+
"pre-commit": "lint-staged && yarn flow"
119+
}
120+
},
121+
"lint-staged": {
122+
"linters": {
123+
"*.{js,jsx}": ["eslint"]
124+
}
113125
}
114126
}

0 commit comments

Comments
 (0)