Skip to content

Commit c4664c5

Browse files
committed
tools: update remark-preset-lint-node to 1.5.0
This update includes an additional check for `End-of-life`. For consistency, we use `End-of-Life` everywhere.
1 parent 7773a38 commit c4664c5

File tree

2 files changed

+45
-40
lines changed

2 files changed

+45
-40
lines changed

tools/lint-md.js

+39-34
Original file line numberDiff line numberDiff line change
@@ -3909,7 +3909,7 @@ function resolvePlugin(name, options) {
39093909

39103910
module.exports = function (args, opts) {
39113911
if (!opts) opts = {};
3912-
3912+
39133913
var flags = { bools : {}, strings : {}, unknownFn: null };
39143914

39153915
if (typeof opts['unknown'] === 'function') {
@@ -3923,7 +3923,7 @@ module.exports = function (args, opts) {
39233923
flags.bools[key] = true;
39243924
});
39253925
}
3926-
3926+
39273927
var aliases = {};
39283928
Object.keys(opts.alias || {}).forEach(function (key) {
39293929
aliases[key] = [].concat(opts.alias[key]);
@@ -3942,12 +3942,12 @@ module.exports = function (args, opts) {
39423942
});
39433943

39443944
var defaults = opts['default'] || {};
3945-
3945+
39463946
var argv = { _ : [] };
39473947
Object.keys(flags.bools).forEach(function (key) {
39483948
setArg(key, defaults[key] === undefined ? false : defaults[key]);
39493949
});
3950-
3950+
39513951
var notFlags = [];
39523952

39533953
if (args.indexOf('--') !== -1) {
@@ -3969,7 +3969,7 @@ module.exports = function (args, opts) {
39693969
? Number(val) : val
39703970
;
39713971
setKey(argv, key.split('.'), value);
3972-
3972+
39733973
(aliases[key] || []).forEach(function (x) {
39743974
setKey(argv, x.split('.'), value);
39753975
});
@@ -3993,7 +3993,7 @@ module.exports = function (args, opts) {
39933993
o[key] = [ o[key], value ];
39943994
}
39953995
}
3996-
3996+
39973997
function aliasIsBoolean(key) {
39983998
return aliases[key].some(function (x) {
39993999
return flags.bools[x];
@@ -4002,7 +4002,7 @@ module.exports = function (args, opts) {
40024002

40034003
for (var i = 0; i < args.length; i++) {
40044004
var arg = args[i];
4005-
4005+
40064006
if (/^--.+=/.test(arg)) {
40074007
// Using [\s\S] instead of . because js doesn't support the
40084008
// 'dotall' regex modifier. See:
@@ -4039,29 +4039,29 @@ module.exports = function (args, opts) {
40394039
}
40404040
else if (/^-[^-]+/.test(arg)) {
40414041
var letters = arg.slice(1,-1).split('');
4042-
4042+
40434043
var broken = false;
40444044
for (var j = 0; j < letters.length; j++) {
40454045
var next = arg.slice(j+2);
4046-
4046+
40474047
if (next === '-') {
40484048
setArg(letters[j], next, arg)
40494049
continue;
40504050
}
4051-
4051+
40524052
if (/[A-Za-z]/.test(letters[j]) && /=/.test(next)) {
40534053
setArg(letters[j], next.split('=')[1], arg);
40544054
broken = true;
40554055
break;
40564056
}
4057-
4057+
40584058
if (/[A-Za-z]/.test(letters[j])
40594059
&& /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) {
40604060
setArg(letters[j], next, arg);
40614061
broken = true;
40624062
break;
40634063
}
4064-
4064+
40654065
if (letters[j+1] && letters[j+1].match(/\W/)) {
40664066
setArg(letters[j], arg.slice(j+2), arg);
40674067
broken = true;
@@ -4071,7 +4071,7 @@ module.exports = function (args, opts) {
40714071
setArg(letters[j], flags.strings[letters[j]] ? '' : true, arg);
40724072
}
40734073
}
4074-
4074+
40754075
var key = arg.slice(-1)[0];
40764076
if (!broken && key !== '-') {
40774077
if (args[i+1] && !/^(-|--)[^-]/.test(args[i+1])
@@ -4101,17 +4101,17 @@ module.exports = function (args, opts) {
41014101
}
41024102
}
41034103
}
4104-
4104+
41054105
Object.keys(defaults).forEach(function (key) {
41064106
if (!hasKey(argv, key.split('.'))) {
41074107
setKey(argv, key.split('.'), defaults[key]);
4108-
4108+
41094109
(aliases[key] || []).forEach(function (x) {
41104110
setKey(argv, x.split('.'), defaults[key]);
41114111
});
41124112
}
41134113
});
4114-
4114+
41154115
if (opts['--']) {
41164116
argv['--'] = new Array();
41174117
notFlags.forEach(function(key) {
@@ -8785,7 +8785,7 @@ const args = {
87858785
description: cli.description,
87868786
version: [
87878787
proc.name + ': ' + proc.version,
8788-
cli.name + ': ' + cli.version
8788+
cli.name + ': ' + cli.version,
87898789
].join(', '),
87908790
ignoreName: '.' + proc.name + 'ignore',
87918791
extensions: extensions
@@ -8794,7 +8794,7 @@ const config = options(process.argv.slice(2), args);
87948794
config.detectConfig = false;
87958795
config.plugins = plugins;
87968796

8797-
engine(config, function done(err, code) {
8797+
engine(config, (err, code) => {
87988798
if (err) console.error(err);
87998799
process.exit(code);
88008800
});
@@ -26623,15 +26623,15 @@ module.exports = function (rows_, opts) {
2662326623
var stringLength = opts.stringLength
2662426624
|| function (s) { return String(s).length; }
2662526625
;
26626-
26626+
2662726627
var dotsizes = reduce(rows_, function (acc, row) {
2662826628
forEach(row, function (c, ix) {
2662926629
var n = dotindex(c);
2663026630
if (!acc[ix] || n > acc[ix]) acc[ix] = n;
2663126631
});
2663226632
return acc;
2663326633
}, []);
26634-
26634+
2663526635
var rows = map(rows_, function (row) {
2663626636
return map(row, function (c_, ix) {
2663726637
var c = String(c_);
@@ -26645,15 +26645,15 @@ module.exports = function (rows_, opts) {
2664526645
else return c;
2664626646
});
2664726647
});
26648-
26648+
2664926649
var sizes = reduce(rows, function (acc, row) {
2665026650
forEach(row, function (c, ix) {
2665126651
var n = stringLength(c);
2665226652
if (!acc[ix] || n > acc[ix]) acc[ix] = n;
2665326653
});
2665426654
return acc;
2665526655
}, []);
26656-
26656+
2665726657
return map(rows, function (row) {
2665826658
return map(row, function (c, ix) {
2665926659
var n = (sizes[ix] - stringLength(c)) || 0;
@@ -26666,7 +26666,7 @@ module.exports = function (rows_, opts) {
2666626666
+ c + Array(Math.floor(n / 2 + 1)).join(' ')
2666726667
;
2666826668
}
26669-
26669+
2667026670
return c + s;
2667126671
}).join(hsep).replace(/\s+$/, '');
2667226672
}).join('\n');
@@ -26711,36 +26711,40 @@ function map (xs, f) {
2671126711
"use strict";
2671226712

2671326713

26714-
const preserveCamelCase = input => {
26714+
const preserveCamelCase = string => {
2671526715
let isLastCharLower = false;
2671626716
let isLastCharUpper = false;
2671726717
let isLastLastCharUpper = false;
2671826718

26719-
for (let i = 0; i < input.length; i++) {
26720-
const c = input[i];
26719+
for (let i = 0; i < string.length; i++) {
26720+
const character = string[i];
2672126721

26722-
if (isLastCharLower && /[a-zA-Z]/.test(c) && c.toUpperCase() === c) {
26723-
input = input.slice(0, i) + '-' + input.slice(i);
26722+
if (isLastCharLower && /[a-zA-Z]/.test(character) && character.toUpperCase() === character) {
26723+
string = string.slice(0, i) + '-' + string.slice(i);
2672426724
isLastCharLower = false;
2672526725
isLastLastCharUpper = isLastCharUpper;
2672626726
isLastCharUpper = true;
2672726727
i++;
26728-
} else if (isLastCharUpper && isLastLastCharUpper && /[a-zA-Z]/.test(c) && c.toLowerCase() === c) {
26729-
input = input.slice(0, i - 1) + '-' + input.slice(i - 1);
26728+
} else if (isLastCharUpper && isLastLastCharUpper && /[a-zA-Z]/.test(character) && character.toLowerCase() === character) {
26729+
string = string.slice(0, i - 1) + '-' + string.slice(i - 1);
2673026730
isLastLastCharUpper = isLastCharUpper;
2673126731
isLastCharUpper = false;
2673226732
isLastCharLower = true;
2673326733
} else {
26734-
isLastCharLower = c.toLowerCase() === c;
26734+
isLastCharLower = character.toLowerCase() === character;
2673526735
isLastLastCharUpper = isLastCharUpper;
26736-
isLastCharUpper = c.toUpperCase() === c;
26736+
isLastCharUpper = character.toUpperCase() === character;
2673726737
}
2673826738
}
2673926739

26740-
return input;
26740+
return string;
2674126741
};
2674226742

2674326743
module.exports = (input, options) => {
26744+
if (!(typeof input === 'string' || Array.isArray(input))) {
26745+
throw new TypeError('Expected the input to be `string | string[]`');
26746+
}
26747+
2674426748
options = Object.assign({
2674526749
pascalCase: false
2674626750
}, options);
@@ -35198,7 +35202,7 @@ function tableCell(node) {
3519835202
/* 302 */
3519935203
/***/ (function(module) {
3520035204

35201-
module.exports = {"name":"remark","version":"10.0.1","description":"Markdown processor powered by plugins","license":"MIT","keywords":["markdown","abstract","syntax","tree","ast","parse","stringify","process"],"homepage":"https://remark.js.org","repository":"https://github.com/remarkjs/remark/tree/master/packages/remark","bugs":"https://github.com/remarkjs/remark/issues","author":"Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)","contributors":["Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"],"files":["index.js"],"dependencies":{"remark-parse":"^6.0.0","remark-stringify":"^6.0.0","unified":"^7.0.0"},"devDependencies":{"tape":"^4.9.1"},"scripts":{"test":"tape test.js"},"xo":false,"_resolved":"https://registry.npmjs.org/remark/-/remark-10.0.1.tgz","_integrity":"sha512-E6lMuoLIy2TyiokHprMjcWNJ5UxfGQjaMSMhV+f4idM625UjjK4j798+gPs5mfjzDE6vL0oFKVeZM6gZVSVrzQ==","_from":"remark@10.0.1"};
35205+
module.exports = {"_from":"remark@^10.0.0","_id":"remark@10.0.1","_inBundle":false,"_integrity":"sha512-E6lMuoLIy2TyiokHprMjcWNJ5UxfGQjaMSMhV+f4idM625UjjK4j798+gPs5mfjzDE6vL0oFKVeZM6gZVSVrzQ==","_location":"/remark","_phantomChildren":{},"_requested":{"type":"range","registry":true,"raw":"remark@^10.0.0","name":"remark","escapedName":"remark","rawSpec":"^10.0.0","saveSpec":null,"fetchSpec":"^10.0.0"},"_requiredBy":["/"],"_resolved":"https://registry.npmjs.org/remark/-/remark-10.0.1.tgz","_shasum":"3058076dc41781bf505d8978c291485fe47667df","_spec":"remark@^10.0.0","_where":"/Users/trott/io.js/tools/node-lint-md-cli-rollup","author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"bugs":{"url":"https://github.com/remarkjs/remark/issues"},"bundleDependencies":false,"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"dependencies":{"remark-parse":"^6.0.0","remark-stringify":"^6.0.0","unified":"^7.0.0"},"deprecated":false,"description":"Markdown processor powered by plugins","devDependencies":{"tape":"^4.9.1"},"files":["index.js"],"homepage":"https://remark.js.org","keywords":["markdown","abstract","syntax","tree","ast","parse","stringify","process"],"license":"MIT","name":"remark","repository":{"type":"git","url":"https://github.com/remarkjs/remark/tree/master/packages/remark"},"scripts":{"test":"tape test.js"},"version":"10.0.1","xo":false};
3520235206

3520335207
/***/ }),
3520435208
/* 303 */
@@ -35261,6 +35265,7 @@ module.exports.plugins = [
3526135265
__webpack_require__(346),
3526235266
[
3526335267
{ no: "End-Of-Life", yes: "End-of-Life" },
35268+
{ no: "End-of-life", yes: "End-of-Life" },
3526435269
{ no: "Github", yes: "GitHub" },
3526535270
{ no: "Javascript", yes: "JavaScript" },
3526635271
{ no: "Node.JS", yes: "Node.js" },

tools/node-lint-md-cli-rollup/package-lock.json

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)