diff --git a/README.md b/README.md index 5a54b5d3..7c29f498 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,7 @@ version numbers for the `nodejs-yaml-comments` rule. For better compatibility with the nodejs/node changelogs, there are a few exceptions: -- Version numbers `^0.0.0 || ^0.1.0` are not validated using the provided list, - they are validating using the `vx.x.x` pattern. -- `REPLACEME` placeholder is always valid, regardless it's in the list or not. +* Version numbers `^0.0.0 || ^0.1.0` are not validated using the provided list. + They are validated using the `vx.x.x` pattern. +* `REPLACEME` placeholder is always valid, regardless if it's in the list or + not. diff --git a/index.js b/index.js index fde32efb..93085a9f 100644 --- a/index.js +++ b/index.js @@ -1,4 +1,4 @@ -// @see https://github.com/nodejs/node/blob/master/doc/guides/doc-style-guide.md +// @see https://github.com/nodejs/node/blob/HEAD/doc/guides/doc-style-guide.md import remarkPresetLintRecommended from "remark-preset-lint-recommended"; import remarkLintBlockquoteIndentation from "remark-lint-blockquote-indentation"; @@ -34,7 +34,7 @@ import remarkLintTablePipes from "remark-lint-table-pipes"; import remarkLintUnorderedListMarkerStyle from "remark-lint-unordered-list-marker-style"; // Add in rules alphabetically -const remarkPresetLintNode = [ +const plugins = [ // Leave preset at the top so it can be overridden remarkPresetLintRecommended, [remarkLintBlockquoteIndentation, 2], @@ -109,4 +109,6 @@ const remarkPresetLintNode = [ [remarkLintUnorderedListMarkerStyle, "*"], ]; +const remarkPresetLintNode = { plugins }; + export default remarkPresetLintNode; diff --git a/package.json b/package.json index de5981a3..7306cc23 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,10 @@ "fix": "eslint . --fix && prettier . -w", "lint": "eslint . && prettier . -c", "lockfile-lint": "lockfile-lint --allowed-hosts npm --allowed-schemes https: --empty-hostname false --type npm --path package-lock.json", - "remark": "remark \"tmp/*.md\" \"tmp/doc/**/*.md\" \"tmp/lib/**/*.md\" \"tmp/benchmark/**/*.md\" \"tmp/src/**/*.md\" \"tmp/test/README.md\" \"tmp/test/[a-eg-z]*/**/*.md\" \"tmp/tools/doc/*.md\" \"tmp/tools/icu/**/*.md\" --use ./index.js --use gfm -fq", + "remark": "npm run remark-local && npm run remark-expected-failure && npm run remark-node-core", + "remark-node-core": "remark \"tmp/*.md\" \"tmp/doc/**/*.md\" \"tmp/lib/**/*.md\" \"tmp/benchmark/**/*.md\" \"tmp/src/**/*.md\" \"tmp/test/README.md\" \"tmp/test/[a-eg-z]*/**/*.md\" \"tmp/tools/doc/*.md\" \"tmp/tools/icu/**/*.md\" --use ./index.js --use gfm -fq", + "remark-local": "remark *.md --use ./index.js --use gfm -fq", + "remark-expected-failure": "! remark test/fail.md --use ./index.js --use gfm -fq || (echo \"Error: failed to detect lint problems\" && exit 1)", "test": "npm run lint && npm run lockfile-lint && npm run remark" }, "repository": { diff --git a/test/fail.md b/test/fail.md new file mode 100644 index 00000000..80536ef7 --- /dev/null +++ b/test/fail.md @@ -0,0 +1,3 @@ +# File that should fail + +Welcome to Node!