mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 22:40:13 +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
|
|
@ -31,6 +31,11 @@ module.exports = {
|
|||
const htmlElements = params.config.html_elements;
|
||||
const includeHtmlElements =
|
||||
(htmlElements === undefined) ? true : !!htmlElements;
|
||||
// eslint-disable-next-line jsdoc/valid-types
|
||||
/** @type import("../helpers/micromark.cjs").Token[] */
|
||||
const micromarkTokens =
|
||||
// @ts-ignore
|
||||
params.parsers.micromark.tokens;
|
||||
const scannedTypes = new Set([ "data" ]);
|
||||
if (includeCodeBlocks) {
|
||||
scannedTypes.add("codeFlowValue");
|
||||
|
|
@ -42,8 +47,7 @@ module.exports = {
|
|||
}
|
||||
const contentTokens =
|
||||
filterByPredicate(
|
||||
// eslint-disable-next-line dot-notation
|
||||
params.parsers["micromark"].tokens,
|
||||
micromarkTokens,
|
||||
(token) => scannedTypes.has(token.type),
|
||||
(token) => (
|
||||
token.children.filter((t) => !ignoredChildTypes.has(t.type))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue