From 564b681b40035cc647f92b87edd6a23498d4a4af Mon Sep 17 00:00:00 2001 From: Christopher Hiller Date: Thu, 21 Dec 2017 11:38:13 -0800 Subject: [PATCH] add @mocha/markdownlint-cli; closes #3172 - forked [markdownlint-cli](https://npm.im/markdownlint-cli) to fix a glob-related bug; will abandon our version if/when it's merged - add `.markdownlint.json` config - remove "allow trailing spaces" for Markdown in `.editorconfig` - add to `lint` target & create `markdownlint` script in `package.json`, which is dumb, but we're stuck with it for now --- .editorconfig | 3 - .markdownlint.json | 9 +++ Makefile | 1 + docs/index.md | 6 +- package-lock.json | 139 +++++++++++++++++++++++++++++++++++++++++++++ package.json | 2 + 6 files changed, 154 insertions(+), 6 deletions(-) create mode 100644 .markdownlint.json diff --git a/.editorconfig b/.editorconfig index e3a4859eeb..47ce1a5519 100644 --- a/.editorconfig +++ b/.editorconfig @@ -13,6 +13,3 @@ indent_size = 2 [Makefile] indent_style = tab - -[*.md] -trim_trailing_whitespace = false diff --git a/.markdownlint.json b/.markdownlint.json new file mode 100644 index 0000000000..47743fd9b0 --- /dev/null +++ b/.markdownlint.json @@ -0,0 +1,9 @@ +{ + "no-inline-html": false, + "line-length": false, + "no-trailing-punctuation": false, + "no-duplicate-header": false, + "first-header-h1": false, + "first-line-h1": false, + "commands-show-output": false +} diff --git a/Makefile b/Makefile index 7567fc16a0..7d7958ea8d 100644 --- a/Makefile +++ b/Makefile @@ -35,6 +35,7 @@ clean: lint: @printf "==> [Test :: Lint]\n" npm run lint + npm run markdownlint test-node: test-bdd test-tdd test-qunit test-exports test-unit test-integration test-jsapi test-compilers test-requires test-reporters test-only test-global-only diff --git a/docs/index.md b/docs/index.md index 896f76cf74..10118e3834 100644 --- a/docs/index.md +++ b/docs/index.md @@ -5,9 +5,9 @@ title: 'Mocha - the fun, simple, flexible JavaScript test framework' Mocha is a feature-rich JavaScript test framework running on [Node.js](https://nodejs.org) and in the browser, making asynchronous testing *simple* and *fun*. Mocha tests run serially, allowing for flexible and accurate reporting, while mapping uncaught exceptions to the correct test cases. Hosted on [GitHub](https://github.com/mochajs/mocha). {% include backers.md %} diff --git a/package-lock.json b/package-lock.json index 70161b267e..c632a3b489 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,6 +4,46 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@mocha/markdownlint-cli": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@mocha/markdownlint-cli/-/markdownlint-cli-1.0.0.tgz", + "integrity": "sha512-ziYMBeFh3KlAAZUOrunYTtjgb6J4K8u5dDVUIjG9JTe+pHhQUd1UQaBo+WKY6XCoUJhSi5QhlPEDzLL63qWYPg==", + "dev": true, + "requires": { + "commander": "2.9.0", + "deep-extend": "0.4.2", + "glob": "7.0.6", + "lodash.flatten": "4.3.0", + "lodash.values": "4.2.0", + "markdownlint": "0.6.4", + "rc": "1.1.7" + }, + "dependencies": { + "commander": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", + "integrity": "sha1-nJkJQXbhIkDLItbFFGCYQA/g99Q=", + "dev": true, + "requires": { + "graceful-readlink": "1.0.1" + } + }, + "glob": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.0.6.tgz", + "integrity": "sha1-IRuvr0nlJbjNkyYNFKsTYVKz9Xo=", + "dev": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + } + } + }, "JSONStream": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.1.tgz", @@ -1204,6 +1244,12 @@ "ms": "2.0.0" } }, + "deep-extend": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.4.2.tgz", + "integrity": "sha1-SLaZwn4zS/ifEIkr5DL25MfTSn8=", + "dev": true + }, "deep-is": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", @@ -1480,6 +1526,12 @@ "integrity": "sha1-6WQhkyWiHQX0RGai9obtbOX13R0=", "dev": true }, + "entities": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz", + "integrity": "sha1-blwtClYhtdra7O+AuQ7ftc13cvA=", + "dev": true + }, "error-ex": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz", @@ -3205,6 +3257,12 @@ "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", "dev": true }, + "graceful-readlink": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", + "integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=", + "dev": true + }, "gray-matter": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/gray-matter/-/gray-matter-2.1.1.tgz", @@ -3471,6 +3529,12 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" }, + "ini": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", + "dev": true + }, "inline-source-map": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.6.2.tgz", @@ -4066,6 +4130,15 @@ "astw": "2.2.0" } }, + "linkify-it": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-2.0.3.tgz", + "integrity": "sha1-2UpGSPmxwXnWT6lykSaL22zpQ08=", + "dev": true, + "requires": { + "uc.micro": "1.0.3" + } + }, "list-item": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/list-item/-/list-item-1.1.1.tgz", @@ -4120,12 +4193,24 @@ "integrity": "sha1-9HGh2khr5g9quVXRcRVSPdHSVdU=", "dev": true }, + "lodash.flatten": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.3.0.tgz", + "integrity": "sha1-5exO/ofvxZzlL5F8uovxYGNkac8=", + "dev": true + }, "lodash.memoize": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-3.0.4.tgz", "integrity": "sha1-LcvSwofLwKVcxCMovQxzYVDVPj8=", "dev": true }, + "lodash.values": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.values/-/lodash.values-4.2.0.tgz", + "integrity": "sha1-kyYl99LJVLY9uJUlVUjztJ8SDpo=", + "dev": true + }, "log-driver": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/log-driver/-/log-driver-1.2.5.tgz", @@ -4193,6 +4278,19 @@ "yallist": "2.1.2" } }, + "markdown-it": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-8.3.2.tgz", + "integrity": "sha512-4J92IhJq1kGoyXddwzzfjr9cEKGexBfFsZooKYMhMLLlWa4+dlSPDUUP7y+xQOCebIj61aLmKlowg//YcdPP1w==", + "dev": true, + "requires": { + "argparse": "1.0.9", + "entities": "1.1.1", + "linkify-it": "2.0.3", + "mdurl": "1.0.1", + "uc.micro": "1.0.3" + } + }, "markdown-link": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/markdown-link/-/markdown-link-0.1.1.tgz", @@ -4227,6 +4325,15 @@ } } }, + "markdownlint": { + "version": "0.6.4", + "resolved": "https://registry.npmjs.org/markdownlint/-/markdownlint-0.6.4.tgz", + "integrity": "sha512-gcojwPjnWIE6qJh16veEN2k62rkJdXEznAaupbNiBpwHlMqFqh5SMA5/YPJO6/uEpwn2NJjSYkYk2OcIWvgkeQ==", + "dev": true, + "requires": { + "markdown-it": "8.3.2" + } + }, "md5.js": { "version": "1.3.4", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.4.tgz", @@ -4249,6 +4356,12 @@ } } }, + "mdurl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", + "integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=", + "dev": true + }, "media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -6985,6 +7098,26 @@ "unpipe": "1.0.0" } }, + "rc": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.1.7.tgz", + "integrity": "sha1-xepWS7B6/5/TpbMukGwdOmWUD+o=", + "dev": true, + "requires": { + "deep-extend": "0.4.2", + "ini": "1.3.5", + "minimist": "1.2.0", + "strip-json-comments": "2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + } + } + }, "read-only-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/read-only-stream/-/read-only-stream-2.0.0.tgz", @@ -7852,6 +7985,12 @@ "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", "dev": true }, + "uc.micro": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.3.tgz", + "integrity": "sha1-ftUNXg+an7ClczeSWfKndFjVAZI=", + "dev": true + }, "ultron": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.0.2.tgz", diff --git a/package.json b/package.json index 48eb480f60..85e5c14a75 100644 --- a/package.json +++ b/package.json @@ -300,6 +300,7 @@ }, "scripts": { "lint": "eslint . bin/*", + "markdownlint": "markdownlint \"*.md\" \"docs/**/*.md\" \".github/*.md\"", "test": "make clean && make test", "prepublishOnly": "npm test && make clean && make mocha.js", "coveralls": "nyc report --reporter=text-lcov | coveralls", @@ -322,6 +323,7 @@ "supports-color": "4.4.0" }, "devDependencies": { + "@mocha/markdownlint-cli": "^1.0.0", "assert": "^1.4.1", "assetgraph-builder": "^5.6.4", "browserify": "^14.4.0",