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.
  • Loading branch information
Trott committed Apr 24, 2021
1 parent 04ec693 commit 2f8f9aa
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 2f8f9aa

Please sign in to comment.