mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-26 18:48: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
10
lib/md022.js
10
lib/md022.js
|
|
@ -40,10 +40,14 @@ module.exports = {
|
|||
"function": function MD022(params, onError) {
|
||||
const getLinesAbove = getLinesFunction(params.config.lines_above);
|
||||
const getLinesBelow = getLinesFunction(params.config.lines_below);
|
||||
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 headings = filterByTypes(
|
||||
// eslint-disable-next-line dot-notation
|
||||
parsers["micromark"].tokens,
|
||||
micromarkTokens,
|
||||
[ "atxHeading", "setextHeading" ]
|
||||
).filter((heading) => !inHtmlFlow(heading));
|
||||
for (const heading of headings) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue