Skip to content
Permalink
Browse files

Configure pre-commit hooks to run ESLint and Jest

* Install Husky as dev dependency
* Install and configure lint-staged in packages
* Setup pre-commit hook with Husky
* Run tests from precommit scripts
  • Loading branch information...
bhubr committed Aug 31, 2019
1 parent 334e50a commit 7dd494875e5caf672dab293111f4b6ec0e31b229
Showing with 1,178 additions and 15 deletions.
  1. +6 −0 package.json
  2. +8 −0 packages/back/package.json
  3. +549 −7 packages/back/yarn.lock
  4. +10 −1 packages/front/package.json
  5. +458 −4 packages/front/yarn.lock
  6. +147 −3 yarn.lock
@@ -5,6 +5,12 @@
"author": "Benoit Hubert <benoithubert@gmail.com>",
"license": "MIT",
"devDependencies": {
"husky": "^3.0.4",
"lerna": "^3.16.4"
},
"husky": {
"hooks": {
"pre-commit": "npx lerna run --concurrency 1 --stream precommit"
}
}
}
@@ -6,6 +6,7 @@
"scripts": {
"build": "npx babel src -d build",
"lint": "npx eslint --fix *.js src test",
"precommit": "lint-staged && yarn test",
"start": "nodemon --exec ./node_modules/@babel/node/bin/babel-node.js src/index",
"test": "jest"
},
@@ -25,8 +26,15 @@
"eslint-config-airbnb-base": "^14.0.0",
"eslint-plugin-import": "^2.18.2",
"jest": "^24.9.0",
"lint-staged": "^9.2.5",
"nodemon": "^1.19.1",
"prettier": "^1.18.2",
"supertest": "^4.0.2"
},
"lint-staged": {
"**/*.js": [
"yarn lint",
"git add"
]
}
}

0 comments on commit 7dd4948

Please sign in to comment.
You can’t perform that action at this time.