From 5dd81ec32c7de965f1b42a5c214a5ba1df037291 Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Sun, 10 Dec 2017 12:02:38 +0530 Subject: [PATCH] pre-commit hook for lint and TOC. --- contributing.md | 3 +-- package.json | 10 ++++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/contributing.md b/contributing.md index 138a49a..b7bdd87 100644 --- a/contributing.md +++ b/contributing.md @@ -3,8 +3,7 @@ This project is a work in progress. Contributions are very welcome. ## Hard rules -* Run `npm test` to lint the code examples. Your changes must pass. -* If you add a new definition or reorder them run `npm run toc` to regenerate the table of contents. +There is a pre-commit hook that runs: `npm run test && npm run roadmarks` for linting the readme and creating the TOC. That said, we'd like to maintain some consistency across the document. diff --git a/package.json b/package.json index e7cfe68..9086e8c 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,13 @@ "devDependencies": { "eslint": "^3.4.0", "eslint-config-standard": "^6.0.0", - "eslint-plugin-markdown": "^1.0.0-beta.2", + "eslint-plugin-markdown": "^1.0.0-beta.6", + "eslint-plugin-standard": "^3.0.1", + "pre-commit": "^1.2.2", "roadmarks": "^1.6.3" - } + }, + "pre-commit": [ + "test", + "toc" + ] }