Skip to content

Commit

Permalink
Move micromark-parse.mjs from helpers to library, remove all dependen…
Browse files Browse the repository at this point in the history
…cies from helpers.
  • Loading branch information
DavidAnson committed Dec 1, 2024
1 parent 1e71f6f commit 3599f69
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 14 deletions.
8 changes: 0 additions & 8 deletions helpers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,6 @@
"engines": {
"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": [
"markdownlint",
"markdownlint-rule"
Expand Down
2 changes: 1 addition & 1 deletion lib/markdownlint.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { promisify } from "node:util";
import { initialize as cacheInitialize } from "./cache.mjs";
import { version } from "./constants.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";

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/md044.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { addErrorDetailIf, escapeForRegExp, hasOverlap } from "../helpers/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(
[ "codeFencedFence", "definition", "reference", "resource" ]
Expand Down
4 changes: 2 additions & 2 deletions helpers/micromark-parse.mjs → lib/micromark-parse.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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
// eslint-disable-next-line n/no-extraneous-import
import { labelEnd } from "micromark-core-commonmark";
import { isHtmlFlowComment } from "./micromark-helpers.cjs";
import { flatTokensSymbol, htmlFlowSymbol, newLineRe } from "./shared.cjs";
import { isHtmlFlowComment } from "../helpers/micromark-helpers.cjs";
import { flatTokensSymbol, htmlFlowSymbol, newLineRe } from "../helpers/shared.cjs";

/** @typedef {import("micromark-util-types").Event} Event */
/** @typedef {import("micromark-util-types").ParseOptions} MicromarkParseOptions */
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion test/harness.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
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";
const markdownlint = library.promises.markdownlint;

Expand Down
2 changes: 1 addition & 1 deletion test/markdownlint-test-micromark.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import fs from "node:fs/promises";
import test from "ava";
import { newLineRe } from "../helpers/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) => {
fs
Expand Down

0 comments on commit 3599f69

Please sign in to comment.