Skip to content

Commit

Permalink
tools: update markdown linter rules
Browse files Browse the repository at this point in the history
Update remark-preset-lint-node to 2.2.0 which includes improved YAML
comment linting for our markdown files.

PR-URL: #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>
  • Loading branch information
Trott authored and targos committed Apr 29, 2021
1 parent f2c0258 commit f1ea2c8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions tools/lint-md.js
Original file line number Diff line number Diff line change
Expand Up @@ -49667,6 +49667,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));
Expand Down
12 changes: 6 additions & 6 deletions tools/node-lint-md-cli-rollup/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f1ea2c8

Please sign in to comment.