Skip to content

Commit 549282c

Browse files
committed
husky & lint-staged
1 parent 29ae107 commit 549282c

3 files changed

Lines changed: 279 additions & 7 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.DEFAULT_GOAL := build
22

33
JS_FILES = $(shell find ./src -name "*.js" -o -name "*.jsx")
4-
PRETTIER_OPTIONS = --single-quote --trailing-comma es5 --print-width 120
4+
PRETTIER_OPTIONS = --single-quote --trailing-comma es5 --print-width 120 # also prettier opts exists in package.json
55

66
setup: clean
77
yarn --pure-lockfile

package.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,14 @@
99
"build": "npm run build-css && npm run build-js",
1010
"prepublish": "npm run build",
1111
"styleguidist": "NODE_PATH=./src styleguidist server --config styleguide.config.js",
12-
"flow": "flow check"
12+
"flow": "flow check",
13+
"precommit": "lint-staged"
14+
},
15+
"lint-staged": {
16+
"*.{js,jsx}": [
17+
"prettier --single-quote --trailing-comma es5 --print-width 120 --write",
18+
"git add"
19+
]
1320
},
1421
"publishConfig": {
1522
"registry": "https://npm.foxcommerce.com:4873"
@@ -57,6 +64,8 @@
5764
"gulp-concat": "^2.6.1",
5865
"gulp-postcss": "^7.0.0",
5966
"gulp-sourcemaps": "^2.6.0",
67+
"husky": "^0.13.4",
68+
"lint-staged": "^4.0.0",
6069
"postcss": "5.x.x",
6170
"postcss-cssnext": "^2.10.0",
6271
"postcss-loader": "^2.0.5",

0 commit comments

Comments
 (0)