mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 06:20:12 +01:00
Replace strip-json-comments dev dependency with jsonc-parser to handle trailing comments in JSONC test input (for mdn/content), update test repo snapshots.
This commit is contained in:
parent
555079da6d
commit
1769f70845
7 changed files with 20 additions and 32 deletions
|
|
@ -3,6 +3,7 @@
|
|||
"use strict";
|
||||
|
||||
const { join } = require("node:path").posix;
|
||||
const jsoncParser = require("jsonc-parser");
|
||||
const jsYaml = require("js-yaml");
|
||||
const markdownlint = require("../lib/markdownlint");
|
||||
|
||||
|
|
@ -17,9 +18,8 @@ const markdownlint = require("../lib/markdownlint");
|
|||
async function lintTestRepo(t, globPatterns, configPath) {
|
||||
t.plan(1);
|
||||
const { globby } = await import("globby");
|
||||
const { "default": stripJsonComments } = await import("strip-json-comments");
|
||||
const jsoncParse = (json) => {
|
||||
const config = JSON.parse(stripJsonComments(json));
|
||||
const config = jsoncParser.parse(json, [], { "allowTrailingComma": true });
|
||||
return config.config || config;
|
||||
};
|
||||
const yamlParse = (yaml) => jsYaml.load(yaml);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue