Update to use named exports via / /async /promise /sync, simplify references via self-referencing, refine examples.

This commit is contained in:
David Anson 2024-12-03 19:58:28 -08:00
parent e41f034bef
commit 8da43dd246
96 changed files with 635 additions and 548 deletions

View file

@ -3,9 +3,8 @@
import fs from "node:fs/promises";
import path from "node:path";
import test from "ava";
import libMarkdownlint from "../lib/markdownlint.mjs";
const { applyFixes, promises } = libMarkdownlint;
const { markdownlint } = promises;
import { lint } from "markdownlint/promise";
import { applyFixes } from "markdownlint";
import helpers from "../helpers/helpers.cjs";
import { fixableRuleNames } from "../lib/constants.mjs";
@ -22,7 +21,7 @@ function createTestForFile(file) {
// Read and lint Markdown test file
Promise.all([
fs.readFile(file, "utf8"),
markdownlint({
lint({
"files": [ file ]
})
])
@ -89,7 +88,7 @@ function createTestForFile(file) {
fixed
});
// Identify missing fixes
return markdownlint({
return lint({
"strings": {
"input": fixed
}