mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 22:10:13 +01:00
Convert markdownlint library to an ECMAScript module, replace markdownlint-micromark with micromark, stop publishing (large) markdownlint-browser.js, see https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c for guidance.
This commit is contained in:
parent
191226f070
commit
1e71f6f44e
140 changed files with 1087 additions and 10428 deletions
|
|
@ -2,9 +2,9 @@
|
|||
|
||||
import fs from "node:fs/promises";
|
||||
import test from "ava";
|
||||
import { newLineRe } from "../helpers/helpers.js";
|
||||
import { newLineRe } from "../helpers/helpers.cjs";
|
||||
import { filterByPredicate, filterByTypes } from "../helpers/micromark-helpers.cjs";
|
||||
import { getEvents, parse } from "../helpers/micromark-parse.cjs";
|
||||
import { getEvents, parse } from "../helpers/micromark-parse.mjs";
|
||||
|
||||
const testContent = new Promise((resolve, reject) => {
|
||||
fs
|
||||
|
|
@ -49,8 +49,7 @@ test("getEvents/filterByPredicate", async(t) => {
|
|||
test("filterByTypes, htmlFlow false", async(t) => {
|
||||
t.plan(7);
|
||||
const tokens = await testTokens;
|
||||
// eslint-disable-next-line jsdoc/valid-types
|
||||
/** @type import("../micromark/micromark.cjs").TokenType[] */
|
||||
/** @type {import("micromark-util-types").TokenType[]} */
|
||||
const types = [ "atxHeadingText", "codeText", "htmlText", "setextHeadingText" ];
|
||||
const filtered = filterByTypes(tokens, types);
|
||||
// Using flat tokens
|
||||
|
|
@ -67,8 +66,7 @@ test("filterByTypes, htmlFlow false", async(t) => {
|
|||
test("filterByTypes, htmlFlow true", async(t) => {
|
||||
t.plan(9);
|
||||
const tokens = await testTokens;
|
||||
// eslint-disable-next-line jsdoc/valid-types
|
||||
/** @type import("../micromark/micromark.cjs").TokenType[] */
|
||||
/** @type {import("micromark-util-types").TokenType[]} */
|
||||
const types = [ "atxHeadingText", "codeText", "htmlText", "setextHeadingText" ];
|
||||
// Using flat tokens
|
||||
const filtered = filterByTypes(tokens, types, true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue