Update dependency: markdownlint-micromark to 0.1.9.

This commit is contained in:
David Anson 2024-03-04 21:38:18 -08:00
parent 3f31d6f7a2
commit a5371e29c5
5 changed files with 31 additions and 45 deletions

View file

@ -1182,23 +1182,17 @@ module.exports = {
// @ts-ignore // @ts-ignore
const { const {
directive, gfmAutolinkLiteral, gfmFootnote, gfmTable, math, parse, directive, gfmAutolinkLiteral, gfmFootnote, gfmTable, math,
postprocess, preprocess parse, postprocess, preprocess
// @ts-ignore // @ts-ignore
} = __webpack_require__(/*! markdownlint-micromark */ "markdownlint-micromark"); } = __webpack_require__(/*! markdownlint-micromark */ "markdownlint-micromark");
const { newLineRe } = __webpack_require__(/*! ./shared.js */ "../helpers/shared.js"); const { newLineRe } = __webpack_require__(/*! ./shared.js */ "../helpers/shared.js");
const flatTokensSymbol = Symbol("flat-tokens"); const flatTokensSymbol = Symbol("flat-tokens");
// Reference all micromark extensions from markdownlint-micromark so types like TokenType get merged /** @typedef {import("markdownlint-micromark").Event} Event */
/** @type {import("micromark-extension-directive")} */ /** @typedef {import("markdownlint-micromark").ParseOptions} ParseOptions */
/** @type {import("micromark-extension-gfm-autolink-literal")} */ /** @typedef {import("markdownlint-micromark").TokenType} TokenType */
/** @type {import("micromark-extension-gfm-footnote")} */
/** @type {import("micromark-extension-gfm-table")} */
/** @type {import("micromark-extension-math")} */
/**
* @typedef {import("micromark-util-types").TokenType} TokenType
*/
/** /**
* Markdown token. * Markdown token.
@ -1247,9 +1241,9 @@ function isHtmlFlowComment(token) {
* Parses a Markdown document and returns Micromark events. * Parses a Markdown document and returns Micromark events.
* *
* @param {string} markdown Markdown document. * @param {string} markdown Markdown document.
* @param {Object} [micromarkOptions] Options for micromark. * @param {ParseOptions} [micromarkOptions] Options for micromark.
* @param {boolean} [referencesDefined] Treat references as defined. * @param {boolean} [referencesDefined] Treat references as defined.
* @returns {Object[]} Micromark events. * @returns {Event[]} Micromark events.
*/ */
function getMicromarkEvents( function getMicromarkEvents(
markdown, markdown,
@ -1284,7 +1278,7 @@ function getMicromarkEvents(
* Parses a Markdown document and returns (frozen) tokens. * Parses a Markdown document and returns (frozen) tokens.
* *
* @param {string} markdown Markdown document. * @param {string} markdown Markdown document.
* @param {Object} micromarkOptions Options for micromark. * @param {ParseOptions} micromarkOptions Options for micromark.
* @param {boolean} referencesDefined Treat references as defined. * @param {boolean} referencesDefined Treat references as defined.
* @param {number} lineDelta Offset to apply to start/end line. * @param {number} lineDelta Offset to apply to start/end line.
* @param {Token} [ancestor] Parent of top-most tokens. * @param {Token} [ancestor] Parent of top-most tokens.
@ -1318,6 +1312,8 @@ function micromarkParseWithOffset(
}; };
const history = [ root ]; const history = [ root ];
let current = root; let current = root;
// eslint-disable-next-line jsdoc/valid-types
/** @type ParseOptions | null */
let reparseOptions = null; let reparseOptions = null;
let lines = null; let lines = null;
let skipHtmlFlowChildren = false; let skipHtmlFlowChildren = false;
@ -1395,7 +1391,7 @@ function micromarkParseWithOffset(
* Parses a Markdown document and returns (frozen) tokens. * Parses a Markdown document and returns (frozen) tokens.
* *
* @param {string} markdown Markdown document. * @param {string} markdown Markdown document.
* @param {Object} [micromarkOptions] Options for micromark. * @param {ParseOptions} [micromarkOptions] Options for micromark.
* @param {boolean} [referencesDefined] Treat references as defined. * @param {boolean} [referencesDefined] Treat references as defined.
* @returns {Token[]} Micromark tokens (frozen). * @returns {Token[]} Micromark tokens (frozen).
*/ */
@ -3461,11 +3457,11 @@ const { filterByTypes, getTokenParentOfType, inHtmlFlow } =
__webpack_require__(/*! ../helpers/micromark.cjs */ "../helpers/micromark.cjs"); __webpack_require__(/*! ../helpers/micromark.cjs */ "../helpers/micromark.cjs");
// eslint-disable-next-line jsdoc/valid-types // eslint-disable-next-line jsdoc/valid-types
/** @type import("micromark-util-types").TokenType[] */ /** @type import("markdownlint-micromark").TokenType[] */
const unorderedListTypes = const unorderedListTypes =
[ "blockQuotePrefix", "listItemPrefix", "listUnordered" ]; [ "blockQuotePrefix", "listItemPrefix", "listUnordered" ];
// eslint-disable-next-line jsdoc/valid-types // eslint-disable-next-line jsdoc/valid-types
/** @type import("micromark-util-types").TokenType[] */ /** @type import("markdownlint-micromark").TokenType[] */
const unorderedParentTypes = const unorderedParentTypes =
[ "blockQuote", "listOrdered", "listUnordered" ]; [ "blockQuote", "listOrdered", "listUnordered" ];
@ -6203,8 +6199,8 @@ const intrawordRe = /^\w$/;
/** /**
* @param {import("./markdownlint").RuleParams} params Rule parameters. * @param {import("./markdownlint").RuleParams} params Rule parameters.
* @param {import("./markdownlint").RuleOnError} onError Error-reporting callback. * @param {import("./markdownlint").RuleOnError} onError Error-reporting callback.
* @param {import("micromark-util-types").TokenType} type Token type. * @param {import("markdownlint-micromark").TokenType} type Token type.
* @param {import("micromark-util-types").TokenType} typeSequence Token sequence type. * @param {import("markdownlint-micromark").TokenType} typeSequence Token sequence type.
* @param {"*" | "**"} asterisk Asterisk kind. * @param {"*" | "**"} asterisk Asterisk kind.
* @param {"_" | "__"} underline Underline kind. * @param {"_" | "__"} underline Underline kind.
* @param {"asterisk" | "consistent" | "underscore"} style Style string. * @param {"asterisk" | "consistent" | "underscore"} style Style string.

View file

@ -4,23 +4,17 @@
// @ts-ignore // @ts-ignore
const { const {
directive, gfmAutolinkLiteral, gfmFootnote, gfmTable, math, parse, directive, gfmAutolinkLiteral, gfmFootnote, gfmTable, math,
postprocess, preprocess parse, postprocess, preprocess
// @ts-ignore // @ts-ignore
} = require("markdownlint-micromark"); } = require("markdownlint-micromark");
const { newLineRe } = require("./shared.js"); const { newLineRe } = require("./shared.js");
const flatTokensSymbol = Symbol("flat-tokens"); const flatTokensSymbol = Symbol("flat-tokens");
// Reference all micromark extensions from markdownlint-micromark so types like TokenType get merged /** @typedef {import("markdownlint-micromark").Event} Event */
/** @type {import("micromark-extension-directive")} */ /** @typedef {import("markdownlint-micromark").ParseOptions} ParseOptions */
/** @type {import("micromark-extension-gfm-autolink-literal")} */ /** @typedef {import("markdownlint-micromark").TokenType} TokenType */
/** @type {import("micromark-extension-gfm-footnote")} */
/** @type {import("micromark-extension-gfm-table")} */
/** @type {import("micromark-extension-math")} */
/**
* @typedef {import("micromark-util-types").TokenType} TokenType
*/
/** /**
* Markdown token. * Markdown token.
@ -69,9 +63,9 @@ function isHtmlFlowComment(token) {
* Parses a Markdown document and returns Micromark events. * Parses a Markdown document and returns Micromark events.
* *
* @param {string} markdown Markdown document. * @param {string} markdown Markdown document.
* @param {Object} [micromarkOptions] Options for micromark. * @param {ParseOptions} [micromarkOptions] Options for micromark.
* @param {boolean} [referencesDefined] Treat references as defined. * @param {boolean} [referencesDefined] Treat references as defined.
* @returns {Object[]} Micromark events. * @returns {Event[]} Micromark events.
*/ */
function getMicromarkEvents( function getMicromarkEvents(
markdown, markdown,
@ -106,7 +100,7 @@ function getMicromarkEvents(
* Parses a Markdown document and returns (frozen) tokens. * Parses a Markdown document and returns (frozen) tokens.
* *
* @param {string} markdown Markdown document. * @param {string} markdown Markdown document.
* @param {Object} micromarkOptions Options for micromark. * @param {ParseOptions} micromarkOptions Options for micromark.
* @param {boolean} referencesDefined Treat references as defined. * @param {boolean} referencesDefined Treat references as defined.
* @param {number} lineDelta Offset to apply to start/end line. * @param {number} lineDelta Offset to apply to start/end line.
* @param {Token} [ancestor] Parent of top-most tokens. * @param {Token} [ancestor] Parent of top-most tokens.
@ -140,6 +134,8 @@ function micromarkParseWithOffset(
}; };
const history = [ root ]; const history = [ root ];
let current = root; let current = root;
// eslint-disable-next-line jsdoc/valid-types
/** @type ParseOptions | null */
let reparseOptions = null; let reparseOptions = null;
let lines = null; let lines = null;
let skipHtmlFlowChildren = false; let skipHtmlFlowChildren = false;
@ -217,7 +213,7 @@ function micromarkParseWithOffset(
* Parses a Markdown document and returns (frozen) tokens. * Parses a Markdown document and returns (frozen) tokens.
* *
* @param {string} markdown Markdown document. * @param {string} markdown Markdown document.
* @param {Object} [micromarkOptions] Options for micromark. * @param {ParseOptions} [micromarkOptions] Options for micromark.
* @param {boolean} [referencesDefined] Treat references as defined. * @param {boolean} [referencesDefined] Treat references as defined.
* @returns {Token[]} Micromark tokens (frozen). * @returns {Token[]} Micromark tokens (frozen).
*/ */

View file

@ -7,11 +7,11 @@ const { filterByTypes, getTokenParentOfType, inHtmlFlow } =
require("../helpers/micromark.cjs"); require("../helpers/micromark.cjs");
// eslint-disable-next-line jsdoc/valid-types // eslint-disable-next-line jsdoc/valid-types
/** @type import("micromark-util-types").TokenType[] */ /** @type import("markdownlint-micromark").TokenType[] */
const unorderedListTypes = const unorderedListTypes =
[ "blockQuotePrefix", "listItemPrefix", "listUnordered" ]; [ "blockQuotePrefix", "listItemPrefix", "listUnordered" ];
// eslint-disable-next-line jsdoc/valid-types // eslint-disable-next-line jsdoc/valid-types
/** @type import("micromark-util-types").TokenType[] */ /** @type import("markdownlint-micromark").TokenType[] */
const unorderedParentTypes = const unorderedParentTypes =
[ "blockQuote", "listOrdered", "listUnordered" ]; [ "blockQuote", "listOrdered", "listUnordered" ];

View file

@ -10,8 +10,8 @@ const intrawordRe = /^\w$/;
/** /**
* @param {import("./markdownlint").RuleParams} params Rule parameters. * @param {import("./markdownlint").RuleParams} params Rule parameters.
* @param {import("./markdownlint").RuleOnError} onError Error-reporting callback. * @param {import("./markdownlint").RuleOnError} onError Error-reporting callback.
* @param {import("micromark-util-types").TokenType} type Token type. * @param {import("markdownlint-micromark").TokenType} type Token type.
* @param {import("micromark-util-types").TokenType} typeSequence Token sequence type. * @param {import("markdownlint-micromark").TokenType} typeSequence Token sequence type.
* @param {"*" | "**"} asterisk Asterisk kind. * @param {"*" | "**"} asterisk Asterisk kind.
* @param {"_" | "__"} underline Underline kind. * @param {"_" | "__"} underline Underline kind.
* @param {"asterisk" | "consistent" | "underscore"} style Style string. * @param {"asterisk" | "consistent" | "underscore"} style Style string.

View file

@ -66,7 +66,7 @@
}, },
"dependencies": { "dependencies": {
"markdown-it": "14.0.0", "markdown-it": "14.0.0",
"markdownlint-micromark": "0.1.8" "markdownlint-micromark": "0.1.9"
}, },
"devDependencies": { "devDependencies": {
"ajv": "8.12.0", "ajv": "8.12.0",
@ -87,12 +87,6 @@
"markdown-it-sub": "2.0.0", "markdown-it-sub": "2.0.0",
"markdown-it-sup": "2.0.0", "markdown-it-sup": "2.0.0",
"markdownlint-rule-helpers": "0.24.0", "markdownlint-rule-helpers": "0.24.0",
"micromark-extension-directive": "3.0.0",
"micromark-extension-gfm-autolink-literal": "2.0.0",
"micromark-extension-gfm-footnote": "2.0.0",
"micromark-extension-gfm-table": "2.0.0",
"micromark-extension-math": "3.0.0",
"micromark-util-types": "2.0.0",
"npm-run-all": "4.1.5", "npm-run-all": "4.1.5",
"terser-webpack-plugin": "5.3.10", "terser-webpack-plugin": "5.3.10",
"toml": "3.0.0", "toml": "3.0.0",