Skip to content

Commit

Permalink
Update husky
Browse files Browse the repository at this point in the history
  • Loading branch information
frenzzy committed Oct 6, 2018
1 parent 578a7eb commit c8d67bb
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 23 deletions.
5 changes: 5 additions & 0 deletions .huskyrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"hooks": {
"pre-commit": "node tools/pre-commit"
}
}
11 changes: 3 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,24 +41,19 @@
"eslint-config-airbnb": "^17.1.0",
"eslint-config-prettier": "^3.1.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-jsx-a11y": "^6.1.1",
"eslint-plugin-jsx-a11y": "^6.1.2",
"eslint-plugin-react": "^7.11.1",
"fs-extra": "^7.0.0",
"husky": "^1.0.1",
"husky": "^1.1.1",
"jest": "^23.6.0",
"prettier": "^1.14.3",
"rollup": "^0.66.2",
"rollup": "^0.66.4",
"rollup-plugin-babel": "^4.0.3",
"rollup-plugin-commonjs": "^9.1.8",
"rollup-plugin-node-resolve": "^3.4.0",
"rollup-plugin-uglify": "^6.0.0",
"typescript": "^3.1.1"
},
"husky": {
"hooks": {
"pre-commit": "node tools/pre-commit"
}
},
"scripts": {
"lint": "node tools/lint",
"test": "node tools/test",
Expand Down
2 changes: 1 addition & 1 deletion tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ npm run test
Run [pre-commit git hook](https://git-scm.com/docs/githooks#_pre_commit) manually:

```bash
npm run precommit
npm run pre-commit
```
4 changes: 0 additions & 4 deletions tools/build.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
process.on('unhandledRejection', (error) => {
throw error
})

const fs = require('fs-extra')
const rollup = require('rollup')
const babel = require('rollup-plugin-babel')
Expand Down
4 changes: 0 additions & 4 deletions tools/lint.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
process.on('unhandledRejection', (error) => {
throw error
})

const cp = require('child_process')

function spawn(command, args) {
Expand Down
8 changes: 2 additions & 6 deletions tools/pre-commit.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
process.on('unhandledRejection', (error) => {
throw error
})

const lint = require('./lint')
const test = require('./test')

async function precommit() {
async function preCommit() {
await lint()
await test()
}

module.exports = precommit().catch(process.exit)
module.exports = preCommit().catch(process.exit)

0 comments on commit c8d67bb

Please sign in to comment.