Adding precommit hook for prettier and running tests
MODIFY
package-lock.json
package-lock.json
"sshpk": "^1.7.0"
}
},
- "husky": {
- "version": "0.14.3",
- "resolved": "https://registry.npmjs.org/husky/-/husky-0.14.3.tgz",
- "integrity": "sha512-e21wivqHpstpoiWA/Yi8eFti8E+sQDSS53cpJsPptPs295QTOQR0ZwnHo2TXy1XOpZFD9rPOd3NpmqTK6uMLJA==",
- "dev": true,
- "requires": {
- "is-ci": "^1.0.10",
- "normalize-path": "^1.0.0",
- "strip-indent": "^2.0.0"
- }
- },
"iconv-lite": {
"version": "0.4.19",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz",
"validate-npm-package-license": "^3.0.1"
}
},
- "normalize-path": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-1.0.0.tgz",
- "integrity": "sha1-MtDkcvkf80VwHBWoMRAY07CpA3k=",
- "dev": true
- },
"npm-run-path": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz",
"mem": "^1.1.0"
}
},
+ "os-shim": {
+ "version": "0.1.3",
+ "resolved": "https://registry.npmjs.org/os-shim/-/os-shim-0.1.3.tgz",
+ "integrity": "sha1-a2LDeRz3kJ6jXtRuF2WLtBfLORc=",
+ "dev": true
+ },
"os-tmpdir": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
"integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=",
"dev": true
},
+ "pre-commit": {
+ "version": "1.2.2",
+ "resolved": "https://registry.npmjs.org/pre-commit/-/pre-commit-1.2.2.tgz",
+ "integrity": "sha1-287g7p3nI15X95xW186UZBpp7sY=",
+ "dev": true,
+ "requires": {
+ "cross-spawn": "^5.0.1",
+ "spawn-sync": "^1.0.15",
+ "which": "1.2.x"
+ },
+ "dependencies": {
+ "which": {
+ "version": "1.2.14",
+ "resolved": "https://registry.npmjs.org/which/-/which-1.2.14.tgz",
+ "integrity": "sha1-mofEN48D6CfOyvGs31bHNsAcFOU=",
+ "dev": true,
+ "requires": {
+ "isexe": "^2.0.0"
+ }
+ }
+ }
+ },
"prelude-ls": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz",
"integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=",
"dev": true
},
+ "prettier": {
+ "version": "1.12.1",
+ "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.12.1.tgz",
+ "integrity": "sha1-wa0g6APndJ+vkFpAnSNn4Gu+cyU=",
+ "dev": true
+ },
"pretty-format": {
"version": "22.4.3",
"resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-22.4.3.tgz",
"integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=",
"dev": true
},
+ "spawn-sync": {
+ "version": "1.0.15",
+ "resolved": "https://registry.npmjs.org/spawn-sync/-/spawn-sync-1.0.15.tgz",
+ "integrity": "sha1-sAeZVX63+wyDdsKdROih6mfldHY=",
+ "dev": true,
+ "requires": {
+ "concat-stream": "^1.4.7",
+ "os-shim": "^0.1.2"
+ }
+ },
"spdx-correct": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.0.tgz",

MODIFY
package.json
package.json
"test:watch": "jest --expand --onlyChanged --watch",
"prepublish": "npm run test",
"publish": "./scripts/publish.sh",
+ "prettier": "prettier --write",
"prepush": "npm run lint"
},
+ "pre-commit": [
+ "prettier",
+ "lint",
+ "test"
+ ],
"repository": {
"type": "git",
"url": "git+https://github.com/marblejs/marble.git"
"devDependencies": {
"@types/jest": "^22.2.3",
"@types/supertest": "^2.0.4",
- "husky": "^0.14.3",
"jest": "^22.4.3",
"lerna": "^2.11.0",
"mock-req": "^0.2.0",
+ "pre-commit": "^1.2.2",
+ "prettier": "1.12.1",
"rimraf": "^2.6.2",
"supertest": "^3.0.0",
"ts-jest": "~22.4.4",

Adding precommit hook for prettier and running tests