summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2021-04-24 08:47:29 -0700
committerMichaƫl Zasso <targos@protonmail.com>2021-09-04 15:14:52 +0200
commitdfdf6c731717a71bc8372f3cb912be48df556b8b (patch)
treebead241c3ce0ca728fb6ae418bfb7d2c774c4c0c
parent95b9cc78d25cff11ecc79551dc9ef832f132ed59 (diff)
downloadnode-new-dfdf6c731717a71bc8372f3cb912be48df556b8b.tar.gz
tools: update markdown linter rules
Update remark-preset-lint-node to 2.2.0 which includes improved YAML comment linting for our markdown files. PR-URL: https://github.com/nodejs/node/pull/38384 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Shingo Inoue <leko.noor@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
-rwxr-xr-xtools/lint-md.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/lint-md.js b/tools/lint-md.js
index 3089d1deb9..23a3e76a86 100755
--- a/tools/lint-md.js
+++ b/tools/lint-md.js
@@ -49714,6 +49714,11 @@ function validateMeta(node, file, meta) {
function validateYAMLComments(tree, file) {
unistUtilVisit(tree, "html", function visitor(node) {
+ if (node.value.startsWith("<!--YAML\n"))
+ file.message(
+ "Expected `<!-- YAML`, found `<!--YAML`. Please add a space",
+ node
+ );
if (!node.value.startsWith("<!-- YAML\n")) return;
try {
const meta = jsYaml$2.load("#" + node.value.slice(0, -"-->".length));