Move micromark-parse.mjs from helpers to library, remove all dependencies from helpers.

This commit is contained in:
David Anson 2024-11-30 20:42:14 -08:00
parent 1e71f6f44e
commit 3599f694ba
7 changed files with 6 additions and 14 deletions

View file

@ -19,14 +19,6 @@
"engines": { "engines": {
"node": ">=18" "node": ">=18"
}, },
"dependencies": {
"micromark": "4.0.0",
"micromark-extension-directive": "3.0.2",
"micromark-extension-gfm-autolink-literal": "2.1.0",
"micromark-extension-gfm-footnote": "2.1.0",
"micromark-extension-gfm-table": "2.1.0",
"micromark-extension-math": "3.1.0"
},
"keywords": [ "keywords": [
"markdownlint", "markdownlint",
"markdownlint-rule" "markdownlint-rule"

View file

@ -9,7 +9,7 @@ import { promisify } from "node:util";
import { initialize as cacheInitialize } from "./cache.mjs"; import { initialize as cacheInitialize } from "./cache.mjs";
import { version } from "./constants.mjs"; import { version } from "./constants.mjs";
import rules from "./rules.mjs"; import rules from "./rules.mjs";
import { parse as micromarkParse } from "../helpers/micromark-parse.mjs"; import { parse as micromarkParse } from "./micromark-parse.mjs";
import * as helpers from "../helpers/helpers.cjs"; import * as helpers from "../helpers/helpers.cjs";
/** /**

View file

@ -2,7 +2,7 @@
import { addErrorDetailIf, escapeForRegExp, hasOverlap } from "../helpers/helpers.cjs"; import { addErrorDetailIf, escapeForRegExp, hasOverlap } from "../helpers/helpers.cjs";
import { filterByPredicate, filterByTypes } from "../helpers/micromark-helpers.cjs"; import { filterByPredicate, filterByTypes } from "../helpers/micromark-helpers.cjs";
import { parse } from "../helpers/micromark-parse.mjs"; import { parse } from "./micromark-parse.mjs";
const ignoredChildTypes = new Set( const ignoredChildTypes = new Set(
[ "codeFencedFence", "definition", "reference", "resource" ] [ "codeFencedFence", "definition", "reference", "resource" ]

View file

@ -9,8 +9,8 @@ import { parse as micromarkParse, postprocess as micromarkPostprocess, preproces
// micromark-core-commonmark is not a dependency because this instance must match what's used by micromark // micromark-core-commonmark is not a dependency because this instance must match what's used by micromark
// eslint-disable-next-line n/no-extraneous-import // eslint-disable-next-line n/no-extraneous-import
import { labelEnd } from "micromark-core-commonmark"; import { labelEnd } from "micromark-core-commonmark";
import { isHtmlFlowComment } from "./micromark-helpers.cjs"; import { isHtmlFlowComment } from "../helpers/micromark-helpers.cjs";
import { flatTokensSymbol, htmlFlowSymbol, newLineRe } from "./shared.cjs"; import { flatTokensSymbol, htmlFlowSymbol, newLineRe } from "../helpers/shared.cjs";
/** @typedef {import("micromark-util-types").Event} Event */ /** @typedef {import("micromark-util-types").Event} Event */
/** @typedef {import("micromark-util-types").ParseOptions} MicromarkParseOptions */ /** @typedef {import("micromark-util-types").ParseOptions} MicromarkParseOptions */

View file

@ -1,5 +1,5 @@
import { readFile } from "node:fs/promises"; import { readFile } from "node:fs/promises";
import { parse } from "../helpers/micromark-parse.mjs"; import { parse } from "../lib/micromark-parse.mjs";
import library from "../lib/markdownlint.mjs"; import library from "../lib/markdownlint.mjs";
const markdownlint = library.promises.markdownlint; const markdownlint = library.promises.markdownlint;

View file

@ -4,7 +4,7 @@ import fs from "node:fs/promises";
import test from "ava"; import test from "ava";
import { newLineRe } from "../helpers/helpers.cjs"; import { newLineRe } from "../helpers/helpers.cjs";
import { filterByPredicate, filterByTypes } from "../helpers/micromark-helpers.cjs"; import { filterByPredicate, filterByTypes } from "../helpers/micromark-helpers.cjs";
import { getEvents, parse } from "../helpers/micromark-parse.mjs"; import { getEvents, parse } from "../lib/micromark-parse.mjs";
const testContent = new Promise((resolve, reject) => { const testContent = new Promise((resolve, reject) => {
fs fs