mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-28 19:48:49 +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
10
lib/md037.js
10
lib/md037.js
|
|
@ -14,14 +14,18 @@ module.exports = {
|
|||
"function": function MD037(params, onError) {
|
||||
|
||||
// Initialize variables
|
||||
const { lines, parsers } = params;
|
||||
// eslint-disable-next-line jsdoc/valid-types
|
||||
/** @type import("../helpers/micromark.cjs").Token[] */
|
||||
const micromarkTokens =
|
||||
// @ts-ignore
|
||||
params.parsers.micromark.tokens;
|
||||
const { lines } = params;
|
||||
const emphasisTokensByMarker = new Map();
|
||||
for (const marker of [ "_", "__", "___", "*", "**", "***" ]) {
|
||||
emphasisTokensByMarker.set(marker, []);
|
||||
}
|
||||
const tokens = filterByPredicate(
|
||||
// eslint-disable-next-line dot-notation
|
||||
parsers["micromark"].tokens,
|
||||
micromarkTokens,
|
||||
(token) => token.children.some((child) => child.type === "data")
|
||||
);
|
||||
for (const token of tokens) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue