From d070ac32703c2c3337a84e554508966a40b5527b Mon Sep 17 00:00:00 2001 From: Gajus Kuizinas Date: Fri, 26 Oct 2018 16:57:49 +0100 Subject: [PATCH] fix: automate README generation --- package.json | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 390b50a5..26cf7e31 100644 --- a/package.json +++ b/package.json @@ -17,11 +17,11 @@ "babel-preset-env": "^1.7.0", "babel-register": "^6.26.0", "chai": "^4.1.2", - "eslint": "^5.6.0", + "eslint": "^5.7.0", "eslint-config-canonical": "^12.0.0", "gitdown": "^2.5.2", "glob": "^7.1.2", - "husky": "^0.14.3", + "husky": "^1.1.2", "jsonlint": "^1.6.3", "mocha": "^5.2.0", "semantic-release": "^15.5.0" @@ -40,17 +40,22 @@ "peerDependencies": { "eslint": ">=2.0.0" }, + "husky": { + "hooks": { + "post-commit": "npm run create-readme && git add README.md && git commit -m 'docs: generate docs' --no-verify", + "pre-commit": "npm run lint && npm run test && npm run build && npm run format-json" + } + }, "repository": { "type": "git", "url": "https://github.com/gajus/eslint-plugin-flowtype" }, "scripts": { "build": "rm -fr ./dist && babel ./src --out-dir ./dist --copy-files", - "documentation": "gitdown ./.README/README.md --output-file ./README.md && npm run documentation-add-assertions", + "create-readme": "gitdown ./.README/README.md --output-file ./README.md && npm run documentation-add-assertions", "documentation-add-assertions": "babel-node ./bin/readmeAssertions", "format-json": "jsonlint --sort-keys --in-place --indent ' ' ./src/configs/recommended.json && echo '' >> ./src/configs/recommended.json", "lint": "eslint ./src ./tests", - "precommit": "npm run lint && npm run test && npm run format-json", "test": "mocha --compilers js:babel-register ./tests/rules/index.js" }, "version": "2.30.1"