mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-24 09:50: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
11
lib/md026.js
11
lib/md026.js
|
|
@ -19,11 +19,12 @@ module.exports = {
|
|||
);
|
||||
const trailingPunctuationRe =
|
||||
new RegExp("\\s*[" + escapeForRegExp(punctuation) + "]+$");
|
||||
const headings = filterByTypes(
|
||||
// eslint-disable-next-line dot-notation
|
||||
params.parsers["micromark"].tokens,
|
||||
[ "atxHeadingText", "setextHeadingText" ]
|
||||
);
|
||||
// eslint-disable-next-line jsdoc/valid-types
|
||||
/** @type import("../helpers/micromark.cjs").Token[] */
|
||||
const micromarkTokens =
|
||||
// @ts-ignore
|
||||
params.parsers.micromark.tokens;
|
||||
const headings = filterByTypes(micromarkTokens, [ "atxHeadingText", "setextHeadingText" ]);
|
||||
for (const heading of headings) {
|
||||
const { endColumn, endLine, text } = heading;
|
||||
const match = trailingPunctuationRe.exec(text);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue