Skip to content

Commit 1a3915c

Browse files
committed
chore(package): add prettier and precommit hooks
1 parent 7c71e74 commit 1a3915c

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

package.json

+14-3
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,23 @@
1212
"catalog-start": "catalog start",
1313
"catalog-build": "catalog build",
1414
"lint": "eslint \"{src,catalog}/**/*.{js,jsx}\"",
15+
"precommit": "lint-staged",
1516
"test": "jest",
1617
"test:watch": "jest --watch --no-cache --notify",
1718
"test:cover": "jest --coverage"
1819
},
20+
"lint-staged": {
21+
"*.{js,jsx}": [
22+
"prettier --write",
23+
"git add",
24+
"eslint",
25+
"jest --bail --findRelatedTests --no-cache"
26+
],
27+
"*.{json,md,html}": ["prettier --write", "git add"]
28+
},
1929
"jest": {
2030
"setupTestFrameworkScriptFile": "./config/jest.config.js",
21-
"collectCoverageFrom": [
22-
"src/**/*.js"
23-
]
31+
"collectCoverageFrom": ["src/**/*.js"]
2432
},
2533
"devDependencies": {
2634
"babel-core": "^6.26.0",
@@ -34,8 +42,11 @@
3442
"eslint-plugin-import": "^2.11.0",
3543
"eslint-plugin-jsx-a11y": "^6.0.3",
3644
"eslint-plugin-react": "^7.7.0",
45+
"husky": "^0.14.3",
3746
"jest": "^22.4.3",
3847
"jest-styled-components": "^5.0.1",
48+
"lint-staged": "^7.0.4",
49+
"prettier": "^1.12.1",
3950
"react-test-renderer": "^16.3.2"
4051
}
4152
}

0 commit comments

Comments
 (0)