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

@ -20,7 +20,7 @@ const tokensInclude = new Set(
* Converts a Markdown heading into an HTML fragment according to the rules
* used by GitHub.
*
* @param {import("../helpers/micromark-helpers.cjs").Token} headingText Heading text token.
* @param {import("markdownlint").MicromarkToken} headingText Heading text token.
* @returns {string} Fragment string for heading.
*/
function convertHeadingToHTMLFragment(headingText) {
@ -49,7 +49,7 @@ function convertHeadingToHTMLFragment(headingText) {
/**
* Unescapes the text of a String-type micromark Token.
*
* @param {import("../helpers/micromark-helpers.cjs").Token} token String-type micromark Token.
* @param {import("markdownlint").MicromarkToken} token String-type micromark Token.
* @returns {string} Unescaped token text.
*/
function unescapeStringTokenText(token) {
@ -58,7 +58,7 @@ function unescapeStringTokenText(token) {
.join("");
}
/** @type {import("./markdownlint.mjs").Rule} */
/** @type {import("markdownlint").Rule} */
export default {
"names": [ "MD051", "link-fragments" ],
"description": "Link fragments should be valid",
@ -101,7 +101,7 @@ export default {
}
// Process link and definition fragments
/** @type {import("../helpers/micromark-helpers.cjs").TokenType[][]} */
/** @type {import("markdownlint").MicromarkTokenType[][]} */
const parentChilds = [
[ "link", "resourceDestinationString" ],
[ "definition", "definitionDestinationString" ]