mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-29 20:18: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
13
lib/md054.js
13
lib/md054.js
|
|
@ -28,7 +28,7 @@ module.exports = {
|
|||
"description": "Link and image style",
|
||||
"tags": [ "images", "links" ],
|
||||
"function": (params, onError) => {
|
||||
const { parsers, config } = params;
|
||||
const config = params.config;
|
||||
const autolink = (config.autolink === undefined) || !!config.autolink;
|
||||
const inline = (config.inline === undefined) || !!config.inline;
|
||||
const full = (config.full === undefined) || !!config.full;
|
||||
|
|
@ -39,12 +39,13 @@ module.exports = {
|
|||
// Everything allowed, nothing to check
|
||||
return;
|
||||
}
|
||||
// eslint-disable-next-line jsdoc/valid-types
|
||||
/** @type import("../helpers/micromark.cjs").Token[] */
|
||||
const micromarkTokens =
|
||||
// @ts-ignore
|
||||
params.parsers.micromark.tokens;
|
||||
const { definitions } = referenceLinkImageData();
|
||||
const links = filterByTypes(
|
||||
// eslint-disable-next-line dot-notation
|
||||
parsers["micromark"].tokens,
|
||||
[ "autolink", "image", "link" ]
|
||||
);
|
||||
const links = filterByTypes(micromarkTokens, [ "autolink", "image", "link" ]);
|
||||
for (const link of links) {
|
||||
let label = null;
|
||||
let destination = null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue