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
10
lib/md032.js
10
lib/md032.js
|
|
@ -42,12 +42,16 @@ module.exports = {
|
|||
"description": "Lists should be surrounded by blank lines",
|
||||
"tags": [ "bullet", "ul", "ol", "blank_lines" ],
|
||||
"function": function MD032(params, onError) {
|
||||
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;
|
||||
|
||||
// For every top-level list...
|
||||
const topLevelLists = filterByPredicate(
|
||||
// eslint-disable-next-line dot-notation
|
||||
parsers["micromark"].tokens,
|
||||
micromarkTokens,
|
||||
isList,
|
||||
(token) => (
|
||||
(isList(token) || (token.type === "htmlFlow")) ? [] : token.children
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue