Skip to content

Commit b25e78a

Browse files
nodejs-github-botjuanarbol
authored andcommitted
tools: update lint-md-dependencies to [email protected]
PR-URL: #48705 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Moshe Atlow <[email protected]>
1 parent b7a076a commit b25e78a

File tree

3 files changed

+247
-83
lines changed

3 files changed

+247
-83
lines changed

tools/lint-md/lint-md.mjs

+61-32
Original file line numberDiff line numberDiff line change
@@ -206,28 +206,28 @@ function wrap(middleware, callback) {
206206
}
207207
}
208208

209-
function stringifyPosition(value) {
209+
function stringifyPosition$1(value) {
210210
if (!value || typeof value !== 'object') {
211211
return ''
212212
}
213213
if ('position' in value || 'type' in value) {
214-
return position(value.position)
214+
return position$1(value.position)
215215
}
216216
if ('start' in value || 'end' in value) {
217-
return position(value)
217+
return position$1(value)
218218
}
219219
if ('line' in value || 'column' in value) {
220-
return point$2(value)
220+
return point$3(value)
221221
}
222222
return ''
223223
}
224-
function point$2(point) {
225-
return index(point && point.line) + ':' + index(point && point.column)
224+
function point$3(point) {
225+
return index$1(point && point.line) + ':' + index$1(point && point.column)
226226
}
227-
function position(pos) {
228-
return point$2(pos && pos.start) + '-' + point$2(pos && pos.end)
227+
function position$1(pos) {
228+
return point$3(pos && pos.start) + '-' + point$3(pos && pos.end)
229229
}
230-
function index(value) {
230+
function index$1(value) {
231231
return value && typeof value === 'number' ? value : 1
232232
}
233233

@@ -265,7 +265,7 @@ let VFileMessage$1 = class VFileMessage extends Error {
265265
position.start = place;
266266
}
267267
}
268-
this.name = stringifyPosition(place) || '1:1';
268+
this.name = stringifyPosition$1(place) || '1:1';
269269
this.message = typeof reason === 'object' ? reason.message : reason;
270270
this.stack = '';
271271
if (typeof reason === 'object' && reason.stack) {
@@ -7289,7 +7289,7 @@ function compiler(options) {
72897289
handler.call(context, undefined, tail[0]);
72907290
}
72917291
tree.position = {
7292-
start: point$1(
7292+
start: point$2(
72937293
events.length > 0
72947294
? events[0][1].start
72957295
: {
@@ -7298,7 +7298,7 @@ function compiler(options) {
72987298
offset: 0
72997299
}
73007300
),
7301-
end: point$1(
7301+
end: point$2(
73027302
events.length > 0
73037303
? events[events.length - 2][1].end
73047304
: {
@@ -7448,7 +7448,7 @@ function compiler(options) {
74487448
this.stack.push(node);
74497449
this.tokenStack.push([token, errorHandler]);
74507450
node.position = {
7451-
start: point$1(token.start)
7451+
start: point$2(token.start)
74527452
};
74537453
return node
74547454
}
@@ -7467,7 +7467,7 @@ function compiler(options) {
74677467
'Cannot close `' +
74687468
token.type +
74697469
'` (' +
7470-
stringifyPosition({
7470+
stringifyPosition$1({
74717471
start: token.start,
74727472
end: token.end
74737473
}) +
@@ -7481,7 +7481,7 @@ function compiler(options) {
74817481
handler.call(this, token, open[0]);
74827482
}
74837483
}
7484-
node.position.end = point$1(token.end);
7484+
node.position.end = point$2(token.end);
74857485
return node
74867486
}
74877487
function resume() {
@@ -7564,7 +7564,7 @@ function compiler(options) {
75647564
if (!tail || tail.type !== 'text') {
75657565
tail = text();
75667566
tail.position = {
7567-
start: point$1(token.start)
7567+
start: point$2(token.start)
75687568
};
75697569
node.children.push(tail);
75707570
}
@@ -7573,13 +7573,13 @@ function compiler(options) {
75737573
function onexitdata(token) {
75747574
const tail = this.stack.pop();
75757575
tail.value += this.sliceSerialize(token);
7576-
tail.position.end = point$1(token.end);
7576+
tail.position.end = point$2(token.end);
75777577
}
75787578
function onexitlineending(token) {
75797579
const context = this.stack[this.stack.length - 1];
75807580
if (getData('atHardBreak')) {
75817581
const tail = context.children[context.children.length - 1];
7582-
tail.position.end = point$1(token.end);
7582+
tail.position.end = point$2(token.end);
75837583
setData('atHardBreak');
75847584
return
75857585
}
@@ -7699,7 +7699,7 @@ function compiler(options) {
76997699
}
77007700
const tail = this.stack.pop();
77017701
tail.value += value;
7702-
tail.position.end = point$1(token.end);
7702+
tail.position.end = point$2(token.end);
77037703
}
77047704
function onexitautolinkprotocol(token) {
77057705
onexitdata.call(this, token);
@@ -7821,7 +7821,7 @@ function compiler(options) {
78217821
}
78227822
}
78237823
}
7824-
function point$1(d) {
7824+
function point$2(d) {
78257825
return {
78267826
line: d.line,
78277827
column: d.column,
@@ -7868,14 +7868,14 @@ function defaultOnError(left, right) {
78687868
'Cannot close `' +
78697869
left.type +
78707870
'` (' +
7871-
stringifyPosition({
7871+
stringifyPosition$1({
78727872
start: left.start,
78737873
end: left.end
78747874
}) +
78757875
'): a different token (`' +
78767876
right.type +
78777877
'`, ' +
7878-
stringifyPosition({
7878+
stringifyPosition$1({
78797879
start: right.start,
78807880
end: right.end
78817881
}) +
@@ -7886,7 +7886,7 @@ function defaultOnError(left, right) {
78867886
'Cannot close document, a token (`' +
78877887
right.type +
78887888
'`, ' +
7889-
stringifyPosition({
7889+
stringifyPosition$1({
78907890
start: right.start,
78917891
end: right.end
78927892
}) +
@@ -12767,9 +12767,9 @@ const remarkLintListItemBulletIndent = lintRule(
1276712767
);
1276812768
var remarkLintListItemBulletIndent$1 = remarkLintListItemBulletIndent;
1276912769

12770-
const pointStart = point('start');
12771-
const pointEnd = point('end');
12772-
function point(type) {
12770+
const pointStart = point$1('start');
12771+
const pointEnd = point$1('end');
12772+
function point$1(type) {
1277312773
return point
1277412774
function point(node) {
1277512775
const point = (node && node.position && node.position[type]) || {};
@@ -13396,7 +13396,7 @@ const remarkLintNoDuplicateDefinitions = lintRule(
1339613396
node
1339713397
);
1339813398
}
13399-
map[identifier] = stringifyPosition(pointStart(node));
13399+
map[identifier] = stringifyPosition$1(pointStart(node));
1340013400
}
1340113401
});
1340213402
}
@@ -15965,7 +15965,7 @@ const remarkLintNoMultipleToplevelHeadings = lintRule(
1596515965
node
1596615966
);
1596715967
} else {
15968-
duplicate = stringifyPosition(pointStart(node));
15968+
duplicate = stringifyPosition$1(pointStart(node));
1596915969
}
1597015970
}
1597115971
});
@@ -19546,7 +19546,11 @@ getDefaultExportFromCjs(constants);
1954619546
var re$1 = {exports: {}};
1954719547

1954819548
(function (module, exports) {
19549-
const { MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_BUILD_LENGTH } = constants;
19549+
const {
19550+
MAX_SAFE_COMPONENT_LENGTH,
19551+
MAX_SAFE_BUILD_LENGTH,
19552+
MAX_LENGTH,
19553+
} = constants;
1955019554
const debug = debug_1;
1955119555
exports = module.exports = {};
1955219556
const re = exports.re = [];
@@ -19557,7 +19561,7 @@ var re$1 = {exports: {}};
1955719561
const LETTERDASHNUMBER = '[a-zA-Z0-9-]';
1955819562
const safeRegexReplacements = [
1955919563
['\\s', 1],
19560-
['\\d', MAX_SAFE_COMPONENT_LENGTH],
19564+
['\\d', MAX_LENGTH],
1956119565
[LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],
1956219566
];
1956319567
const makeSafeRegex = (value) => {
@@ -21049,6 +21053,31 @@ const settings = {
2104921053
};
2105021054
const remarkPresetLintNode = { plugins, settings };
2105121055

21056+
function stringifyPosition(value) {
21057+
if (!value || typeof value !== 'object') {
21058+
return ''
21059+
}
21060+
if ('position' in value || 'type' in value) {
21061+
return position(value.position)
21062+
}
21063+
if ('start' in value || 'end' in value) {
21064+
return position(value)
21065+
}
21066+
if ('line' in value || 'column' in value) {
21067+
return point(value)
21068+
}
21069+
return ''
21070+
}
21071+
function point(point) {
21072+
return index(point && point.line) + ':' + index(point && point.column)
21073+
}
21074+
function position(pos) {
21075+
return point(pos && pos.start) + '-' + point(pos && pos.end)
21076+
}
21077+
function index(value) {
21078+
return value && typeof value === 'number' ? value : 1
21079+
}
21080+
2105221081
class VFileMessage extends Error {
2105321082
constructor(causeOrReason, optionsOrParentOrPlace, origin) {
2105421083
super();
@@ -22006,7 +22035,7 @@ function createAncestorsLines(state, ancestors) {
2200622035
typeof value.name === 'string'
2200722036
? value.name
2200822037
: undefined;
22009-
const position = stringifyPosition(node.position);
22038+
const position = stringifyPosition$1(node.position);
2201022039
lines.push(
2201122040
' at ' +
2201222041
state.yellow +
@@ -22096,7 +22125,7 @@ function createMessageLine(state, message) {
2209622125
}
2209722126
const place = message.place || message.position;
2209822127
const row = [
22099-
stringifyPosition(place),
22128+
stringifyPosition$1(place),
2210022129
(label === 'error' ? state.red : state.yellow) + label + state.defaultColor,
2210122130
formatReason(state, reason),
2210222131
message.ruleId || '',

0 commit comments

Comments
 (0)