tools: update lint-md-dependencies to @rollup/plugin-node-resolve@15.0.2

PR-URL: https://github.com/nodejs/node/pull/47431
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
This commit is contained in:
Node.js GitHub Bot 2023-04-08 00:58:25 +01:00 committed by GitHub
parent a75871a36e
commit 7ef5c60e80
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 119 additions and 119 deletions

View file

@ -738,28 +738,39 @@ function looksLikeAVFileValue(value) {
return typeof value === 'string' || isBuffer(value) return typeof value === 'string' || isBuffer(value)
} }
const emptyOptions = {};
function toString(value, options) { function toString(value, options) {
const includeImageAlt = (options || {}).includeImageAlt; const settings = options || emptyOptions;
return one( const includeImageAlt =
value, typeof settings.includeImageAlt === 'boolean'
typeof includeImageAlt === 'boolean' ? includeImageAlt : true ? settings.includeImageAlt
) : true;
const includeHtml =
typeof settings.includeHtml === 'boolean' ? settings.includeHtml : true;
return one(value, includeImageAlt, includeHtml)
} }
function one(value, includeImageAlt) { function one(value, includeImageAlt, includeHtml) {
return ( if (node(value)) {
(node(value) && if ('value' in value) {
(('value' in value && value.value) || return value.type === 'html' && !includeHtml ? '' : value.value
(includeImageAlt && 'alt' in value && value.alt) || }
('children' in value && all(value.children, includeImageAlt)))) || if (includeImageAlt && 'alt' in value && value.alt) {
(Array.isArray(value) && all(value, includeImageAlt)) || return value.alt
'' }
) if ('children' in value) {
return all(value.children, includeImageAlt, includeHtml)
}
}
if (Array.isArray(value)) {
return all(value, includeImageAlt, includeHtml)
}
return ''
} }
function all(values, includeImageAlt) { function all(values, includeImageAlt, includeHtml) {
const result = []; const result = [];
let index = -1; let index = -1;
while (++index < values.length) { while (++index < values.length) {
result[index] = one(values[index], includeImageAlt); result[index] = one(values[index], includeImageAlt, includeHtml);
} }
return result.join('') return result.join('')
} }
@ -9827,7 +9838,7 @@ function tokenizePotentialGfmFootnoteCall(effects, ok, nok) {
end: self.now() end: self.now()
}) })
); );
if (id.charCodeAt(0) !== 94 || !defined.includes(id.slice(1))) { if (id.codePointAt(0) !== 94 || !defined.includes(id.slice(1))) {
return nok(code) return nok(code)
} }
effects.enter('gfmFootnoteCallLabelMarker'); effects.enter('gfmFootnoteCallLabelMarker');
@ -9915,24 +9926,32 @@ function tokenizeGfmFootnoteCall(effects, ok, nok) {
return callData return callData
} }
function callData(code) { function callData(code) {
let token; if (
if (code === null || code === 91 || size++ > 999) { size > 999 ||
(code === 93 && !data) ||
code === null ||
code === 91 ||
markdownLineEndingOrSpace(code)
) {
return nok(code) return nok(code)
} }
if (code === 93) { if (code === 93) {
if (!data) { effects.exit('chunkString');
const token = effects.exit('gfmFootnoteCallString');
if (!defined.includes(normalizeIdentifier(self.sliceSerialize(token)))) {
return nok(code) return nok(code)
} }
effects.exit('chunkString'); effects.enter('gfmFootnoteCallLabelMarker');
token = effects.exit('gfmFootnoteCallString'); effects.consume(code);
return defined.includes(normalizeIdentifier(self.sliceSerialize(token))) effects.exit('gfmFootnoteCallLabelMarker');
? end(code) effects.exit('gfmFootnoteCall');
: nok(code) return ok
} }
effects.consume(code);
if (!markdownLineEndingOrSpace(code)) { if (!markdownLineEndingOrSpace(code)) {
data = true; data = true;
} }
size++;
effects.consume(code);
return code === 92 ? callEscape : callData return code === 92 ? callEscape : callData
} }
function callEscape(code) { function callEscape(code) {
@ -9943,13 +9962,6 @@ function tokenizeGfmFootnoteCall(effects, ok, nok) {
} }
return callData(code) return callData(code)
} }
function end(code) {
effects.enter('gfmFootnoteCallLabelMarker');
effects.consume(code);
effects.exit('gfmFootnoteCallLabelMarker');
effects.exit('gfmFootnoteCall');
return ok
}
} }
function tokenizeDefinitionStart(effects, ok, nok) { function tokenizeDefinitionStart(effects, ok, nok) {
const self = this; const self = this;
@ -9964,28 +9976,32 @@ function tokenizeDefinitionStart(effects, ok, nok) {
effects.enter('gfmFootnoteDefinitionLabelMarker'); effects.enter('gfmFootnoteDefinitionLabelMarker');
effects.consume(code); effects.consume(code);
effects.exit('gfmFootnoteDefinitionLabelMarker'); effects.exit('gfmFootnoteDefinitionLabelMarker');
return labelStart return labelAtMarker
} }
function labelStart(code) { function labelAtMarker(code) {
if (code === 94) { if (code === 94) {
effects.enter('gfmFootnoteDefinitionMarker'); effects.enter('gfmFootnoteDefinitionMarker');
effects.consume(code); effects.consume(code);
effects.exit('gfmFootnoteDefinitionMarker'); effects.exit('gfmFootnoteDefinitionMarker');
effects.enter('gfmFootnoteDefinitionLabelString'); effects.enter('gfmFootnoteDefinitionLabelString');
return atBreak effects.enter('chunkString').contentType = 'string';
return labelInside
} }
return nok(code) return nok(code)
} }
function atBreak(code) { function labelInside(code) {
let token; if (
if (code === null || code === 91 || size > 999) { size > 999 ||
(code === 93 && !data) ||
code === null ||
code === 91 ||
markdownLineEndingOrSpace(code)
) {
return nok(code) return nok(code)
} }
if (code === 93) { if (code === 93) {
if (!data) { effects.exit('chunkString');
return nok(code) const token = effects.exit('gfmFootnoteDefinitionLabelString');
}
token = effects.exit('gfmFootnoteDefinitionLabelString');
identifier = normalizeIdentifier(self.sliceSerialize(token)); identifier = normalizeIdentifier(self.sliceSerialize(token));
effects.enter('gfmFootnoteDefinitionLabelMarker'); effects.enter('gfmFootnoteDefinitionLabelMarker');
effects.consume(code); effects.consume(code);
@ -9993,55 +10009,38 @@ function tokenizeDefinitionStart(effects, ok, nok) {
effects.exit('gfmFootnoteDefinitionLabel'); effects.exit('gfmFootnoteDefinitionLabel');
return labelAfter return labelAfter
} }
if (markdownLineEnding(code)) {
effects.enter('lineEnding');
effects.consume(code);
effects.exit('lineEnding');
size++;
return atBreak
}
effects.enter('chunkString').contentType = 'string';
return label(code)
}
function label(code) {
if (
code === null ||
markdownLineEnding(code) ||
code === 91 ||
code === 93 ||
size > 999
) {
effects.exit('chunkString');
return atBreak(code)
}
if (!markdownLineEndingOrSpace(code)) { if (!markdownLineEndingOrSpace(code)) {
data = true; data = true;
} }
size++; size++;
effects.consume(code); effects.consume(code);
return code === 92 ? labelEscape : label return code === 92 ? labelEscape : labelInside
} }
function labelEscape(code) { function labelEscape(code) {
if (code === 91 || code === 92 || code === 93) { if (code === 91 || code === 92 || code === 93) {
effects.consume(code); effects.consume(code);
size++; size++;
return label return labelInside
} }
return label(code) return labelInside(code)
} }
function labelAfter(code) { function labelAfter(code) {
if (code === 58) { if (code === 58) {
effects.enter('definitionMarker'); effects.enter('definitionMarker');
effects.consume(code); effects.consume(code);
effects.exit('definitionMarker'); effects.exit('definitionMarker');
return factorySpace(effects, done, 'gfmFootnoteDefinitionWhitespace') if (!defined.includes(identifier)) {
defined.push(identifier);
}
return factorySpace(
effects,
whitespaceAfter,
'gfmFootnoteDefinitionWhitespace'
)
} }
return nok(code) return nok(code)
} }
function done(code) { function whitespaceAfter(code) {
if (!defined.includes(identifier)) {
defined.push(identifier);
}
return ok(code) return ok(code)
} }
} }
@ -10069,8 +10068,9 @@ function tokenizeIndent(effects, ok, nok) {
} }
} }
function gfmStrikethrough(options = {}) { function gfmStrikethrough(options) {
let single = options.singleTilde; const options_ = options || {};
let single = options_.singleTilde;
const tokenizer = { const tokenizer = {
tokenize: tokenizeStrikethrough, tokenize: tokenizeStrikethrough,
resolveAll: resolveAllStrikethrough resolveAll: resolveAllStrikethrough
@ -10124,16 +10124,15 @@ function gfmStrikethrough(options = {}) {
['exit', events[open][1], context], ['exit', events[open][1], context],
['enter', text, context] ['enter', text, context]
]; ];
splice( const insideSpan = context.parser.constructs.insideSpan.null;
nextEvents, if (insideSpan) {
nextEvents.length, splice(
0, nextEvents,
resolveAll( nextEvents.length,
context.parser.constructs.insideSpan.null, 0,
events.slice(open + 1, index), resolveAll(insideSpan, events.slice(open + 1, index), context)
context );
) }
);
splice(nextEvents, nextEvents.length, 0, [ splice(nextEvents, nextEvents.length, 0, [
['exit', text, context], ['exit', text, context],
['enter', events[index][1], context], ['enter', events[index][1], context],
@ -10673,29 +10672,30 @@ function tokenizeTasklistCheck(effects, ok, nok) {
effects.consume(code); effects.consume(code);
effects.exit('taskListCheckMarker'); effects.exit('taskListCheckMarker');
effects.exit('taskListCheck'); effects.exit('taskListCheck');
return after
}
return nok(code)
}
function after(code) {
if (markdownLineEnding(code)) {
return ok(code)
}
if (markdownSpace(code)) {
return effects.check( return effects.check(
{ {
tokenize: spaceThenNonSpace tokenize: spaceThenNonSpace
}, },
ok, ok,
nok nok
) )(code)
} }
return nok(code) return nok(code)
} }
} }
function spaceThenNonSpace(effects, ok, nok) { function spaceThenNonSpace(effects, ok, nok) {
const self = this;
return factorySpace(effects, after, 'whitespace') return factorySpace(effects, after, 'whitespace')
function after(code) { function after(code) {
const tail = self.events[self.events.length - 1]; return code === null ? nok(code) : ok(code)
return (
((tail && tail[1].type === 'whitespace') ||
markdownLineEnding(code)) &&
code !== null
? ok(code)
: nok(code)
)
} }
} }

View file

@ -17,7 +17,7 @@
}, },
"devDependencies": { "devDependencies": {
"@rollup/plugin-commonjs": "^24.0.1", "@rollup/plugin-commonjs": "^24.0.1",
"@rollup/plugin-node-resolve": "^15.0.1", "@rollup/plugin-node-resolve": "^15.0.2",
"rollup": "^3.20.2", "rollup": "^3.20.2",
"rollup-plugin-cleanup": "^3.2.1" "rollup-plugin-cleanup": "^3.2.1"
} }
@ -54,15 +54,15 @@
} }
}, },
"node_modules/@rollup/plugin-node-resolve": { "node_modules/@rollup/plugin-node-resolve": {
"version": "15.0.1", "version": "15.0.2",
"resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-15.0.1.tgz", "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-15.0.2.tgz",
"integrity": "sha512-ReY88T7JhJjeRVbfCyNj+NXAG3IIsVMsX9b5/9jC98dRP8/yxlZdz7mHZbHk5zHr24wZZICS5AcXsFZAXYUQEg==", "integrity": "sha512-Y35fRGUjC3FaurG722uhUuG8YHOJRJQbI6/CkbRkdPotSpDj9NtIN85z1zrcyDcCQIW4qp5mgG72U+gJ0TAFEg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@rollup/pluginutils": "^5.0.1", "@rollup/pluginutils": "^5.0.1",
"@types/resolve": "1.20.2", "@types/resolve": "1.20.2",
"deepmerge": "^4.2.2", "deepmerge": "^4.2.2",
"is-builtin-module": "^3.2.0", "is-builtin-module": "^3.2.1",
"is-module": "^1.0.0", "is-module": "^1.0.0",
"resolve": "^1.22.1" "resolve": "^1.22.1"
}, },
@ -755,9 +755,9 @@
} }
}, },
"node_modules/mdast-util-to-string": { "node_modules/mdast-util-to-string": {
"version": "3.1.1", "version": "3.2.0",
"resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-3.1.1.tgz", "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-3.2.0.tgz",
"integrity": "sha512-tGvhT94e+cVnQt8JWE9/b3cUQZWS732TJxXHktvP+BYo62PpYD53Ls/6cC60rW21dW+txxiM4zMdc6abASvZKA==", "integrity": "sha512-V4Zn/ncyN1QNSqSBxTrMOLpjr+IKdHl2v3KVLoWmDPscP4r9GcCi71gjgvUV1SFSKh92AjAG4peFuBl2/YgCJg==",
"dependencies": { "dependencies": {
"@types/mdast": "^3.0.0" "@types/mdast": "^3.0.0"
}, },
@ -869,9 +869,9 @@
} }
}, },
"node_modules/micromark-extension-gfm-footnote": { "node_modules/micromark-extension-gfm-footnote": {
"version": "1.0.4", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/micromark-extension-gfm-footnote/-/micromark-extension-gfm-footnote-1.0.4.tgz", "resolved": "https://registry.npmjs.org/micromark-extension-gfm-footnote/-/micromark-extension-gfm-footnote-1.1.0.tgz",
"integrity": "sha512-E/fmPmDqLiMUP8mLJ8NbJWJ4bTw6tS+FEQS8CcuDtZpILuOb2kjLqPEeAePF1djXROHXChM/wPJw0iS4kHCcIg==", "integrity": "sha512-RWYce7j8+c0n7Djzv5NzGEGitNNYO3uj+h/XYMdS/JinH1Go+/Qkomg/rfxExFzYTiydaV6GLeffGO5qcJbMPA==",
"dependencies": { "dependencies": {
"micromark-core-commonmark": "^1.0.0", "micromark-core-commonmark": "^1.0.0",
"micromark-factory-space": "^1.0.0", "micromark-factory-space": "^1.0.0",
@ -888,9 +888,9 @@
} }
}, },
"node_modules/micromark-extension-gfm-strikethrough": { "node_modules/micromark-extension-gfm-strikethrough": {
"version": "1.0.4", "version": "1.0.5",
"resolved": "https://registry.npmjs.org/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-1.0.4.tgz", "resolved": "https://registry.npmjs.org/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-1.0.5.tgz",
"integrity": "sha512-/vjHU/lalmjZCT5xt7CcHVJGq8sYRm80z24qAKXzaHzem/xsDYb2yLL+NNVbYvmpLx3O7SYPuGL5pzusL9CLIQ==", "integrity": "sha512-X0oI5eYYQVARhiNfbETy7BfLSmSilzN1eOuoRnrf9oUNsPRrWOAe9UqSizgw1vNxQBfOwL+n2610S3bYjVNi7w==",
"dependencies": { "dependencies": {
"micromark-util-chunked": "^1.0.0", "micromark-util-chunked": "^1.0.0",
"micromark-util-classify-character": "^1.0.0", "micromark-util-classify-character": "^1.0.0",
@ -921,9 +921,9 @@
} }
}, },
"node_modules/micromark-extension-gfm-tagfilter": { "node_modules/micromark-extension-gfm-tagfilter": {
"version": "1.0.1", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/micromark-extension-gfm-tagfilter/-/micromark-extension-gfm-tagfilter-1.0.1.tgz", "resolved": "https://registry.npmjs.org/micromark-extension-gfm-tagfilter/-/micromark-extension-gfm-tagfilter-1.0.2.tgz",
"integrity": "sha512-Ty6psLAcAjboRa/UKUbbUcwjVAv5plxmpUTy2XC/3nJFL37eHej8jrHrRzkqcpipJliuBH30DTs7+3wqNcQUVA==", "integrity": "sha512-5XWB9GbAUSHTn8VPU8/1DBXMuKYT5uOgEjJb8gN3mW0PNW5OPHpSdojoqf+iq1xo7vWzw/P8bAHY0n6ijpXF7g==",
"dependencies": { "dependencies": {
"micromark-util-types": "^1.0.0" "micromark-util-types": "^1.0.0"
}, },
@ -933,9 +933,9 @@
} }
}, },
"node_modules/micromark-extension-gfm-task-list-item": { "node_modules/micromark-extension-gfm-task-list-item": {
"version": "1.0.3", "version": "1.0.4",
"resolved": "https://registry.npmjs.org/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-1.0.3.tgz", "resolved": "https://registry.npmjs.org/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-1.0.4.tgz",
"integrity": "sha512-PpysK2S1Q/5VXi72IIapbi/jliaiOFzv7THH4amwXeYXLq3l1uo8/2Be0Ac1rEwK20MQEsGH2ltAZLNY2KI/0Q==", "integrity": "sha512-9XlIUUVnYXHsFF2HZ9jby4h3npfX10S1coXTnV035QGPgrtNYQq3J6IfIvcCIUAJrrqBVi5BqA/LmaOMJqPwMQ==",
"dependencies": { "dependencies": {
"micromark-factory-space": "^1.0.0", "micromark-factory-space": "^1.0.0",
"micromark-util-character": "^1.0.0", "micromark-util-character": "^1.0.0",
@ -2215,12 +2215,12 @@
} }
}, },
"node_modules/resolve": { "node_modules/resolve": {
"version": "1.22.1", "version": "1.22.2",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz",
"integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", "integrity": "sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"is-core-module": "^2.9.0", "is-core-module": "^2.11.0",
"path-parse": "^1.0.7", "path-parse": "^1.0.7",
"supports-preserve-symlinks-flag": "^1.0.0" "supports-preserve-symlinks-flag": "^1.0.0"
}, },

View file

@ -15,7 +15,7 @@
}, },
"devDependencies": { "devDependencies": {
"@rollup/plugin-commonjs": "^24.0.1", "@rollup/plugin-commonjs": "^24.0.1",
"@rollup/plugin-node-resolve": "^15.0.1", "@rollup/plugin-node-resolve": "^15.0.2",
"rollup": "^3.20.2", "rollup": "^3.20.2",
"rollup-plugin-cleanup": "^3.2.1" "rollup-plugin-cleanup": "^3.2.1"
} }