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
11
lib/md028.js
11
lib/md028.js
|
|
@ -14,11 +14,14 @@ module.exports = {
|
|||
"description": "Blank line inside blockquote",
|
||||
"tags": [ "blockquote", "whitespace" ],
|
||||
"function": function MD028(params, onError) {
|
||||
// eslint-disable-next-line dot-notation
|
||||
const { tokens } = params.parsers["micromark"];
|
||||
for (const token of filterByTypes(tokens, [ "blockQuote" ])) {
|
||||
// eslint-disable-next-line jsdoc/valid-types
|
||||
/** @type import("../helpers/micromark.cjs").Token[] */
|
||||
const micromarkTokens =
|
||||
// @ts-ignore
|
||||
params.parsers.micromark.tokens;
|
||||
for (const token of filterByTypes(micromarkTokens, [ "blockQuote" ])) {
|
||||
const errorLineNumbers = [];
|
||||
const siblings = token.parent?.children || tokens;
|
||||
const siblings = token.parent?.children || micromarkTokens;
|
||||
for (let i = siblings.indexOf(token) + 1; i < siblings.length; i++) {
|
||||
const sibling = siblings[i];
|
||||
const { startLine, type } = sibling;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue