mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-27 19:18:48 +01:00
Use @type to provide typing for all instances of params.parsers.micromark.tokens.
This commit is contained in:
parent
aee8c2d1d3
commit
828ae3541a
23 changed files with 284 additions and 160 deletions
|
|
@ -16,8 +16,12 @@ module.exports = {
|
|||
let allowed = params.config.allowed_languages;
|
||||
allowed = Array.isArray(allowed) ? allowed : [];
|
||||
const languageOnly = !!params.config.language_only;
|
||||
// eslint-disable-next-line dot-notation
|
||||
const fencedCodes = filterByTypes(params.parsers["micromark"].tokens, [ "codeFenced" ]);
|
||||
// eslint-disable-next-line jsdoc/valid-types
|
||||
/** @type import("../helpers/micromark.cjs").Token[] */
|
||||
const micromarkTokens =
|
||||
// @ts-ignore
|
||||
params.parsers.micromark.tokens;
|
||||
const fencedCodes = filterByTypes(micromarkTokens, [ "codeFenced" ]);
|
||||
for (const fencedCode of fencedCodes) {
|
||||
const openingFence = tokenIfType(fencedCode.children[0], "codeFencedFence");
|
||||
if (openingFence) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue