Use @type to provide typing for all instances of params.parsers.micromark.tokens.

This commit is contained in:
David Anson 2024-02-28 21:01:23 -08:00
parent aee8c2d1d3
commit 828ae3541a
23 changed files with 284 additions and 160 deletions

View file

@ -18,9 +18,12 @@ module.exports = {
"tags": [ "code" ],
"function": function MD046(params, onError) {
let expectedStyle = String(params.config.style || "consistent");
const codeBlocksAndFences =
// eslint-disable-next-line dot-notation
filterByTypes(params.parsers["micromark"].tokens, [ "codeFenced", "codeIndented" ]);
// eslint-disable-next-line jsdoc/valid-types
/** @type import("../helpers/micromark.cjs").Token[] */
const micromarkTokens =
// @ts-ignore
params.parsers.micromark.tokens;
const codeBlocksAndFences = filterByTypes(micromarkTokens, [ "codeFenced", "codeIndented" ]);
for (const token of codeBlocksAndFences) {
const { startLine, type } = token;
if (expectedStyle === "consistent") {