Skip to content

Commit

Permalink
tools: update markdown linter
Browse files Browse the repository at this point in the history
Update remark-preset-lint-node to 1.4.0. This adds `End-Of-Life` as a
prohibited string, favoring `End-of-Life` for consistency.

Refs: #26251

PR-URL: #26281
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
Trott authored and addaleax committed Mar 1, 2019
1 parent ff57a1c commit 0080350
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 80 deletions.
67 changes: 34 additions & 33 deletions tools/lint-md.js
Original file line number Diff line number Diff line change
Expand Up @@ -35184,13 +35184,13 @@ function tableCell(node) {
/* 302 */
/***/ (function(module) {

module.exports = {"name":"remark","version":"10.0.0","description":"Markdown processor powered by plugins","license":"MIT","keywords":["markdown","abstract","syntax","tree","ast","parse","stringify","process"],"homepage":"http://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> (http://wooorm.com)","contributors":["Titus Wormer <tituswormer@gmail.com> (http://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.0.tgz","_integrity":"sha512-0fZvVmd9CgDi1qHGsRTyhpJShw60r3/4OSdRpAx+I7CmE8/Jmt829T9KWHpw2Ygw3chRZ26sMorqb8aIolU9tQ==","_from":"remark@10.0.0"};
module.exports = {"_args":[["remark@10.0.0","/Users/trott/io.js/tools/node-lint-md-cli-rollup"]],"_from":"remark@10.0.0","_id":"remark@10.0.0","_inBundle":false,"_integrity":"sha512-0fZvVmd9CgDi1qHGsRTyhpJShw60r3/4OSdRpAx+I7CmE8/Jmt829T9KWHpw2Ygw3chRZ26sMorqb8aIolU9tQ==","_location":"/remark","_phantomChildren":{},"_requested":{"type":"version","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.0.tgz","_spec":"10.0.0","_where":"/Users/trott/io.js/tools/node-lint-md-cli-rollup","author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"http://wooorm.com"},"bugs":{"url":"https://github.com/remarkjs/remark/issues"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"http://wooorm.com"}],"dependencies":{"remark-parse":"^6.0.0","remark-stringify":"^6.0.0","unified":"^7.0.0"},"description":"Markdown processor powered by plugins","devDependencies":{"tape":"^4.9.1"},"files":["index.js"],"homepage":"http://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.0","xo":false};

/***/ }),
/* 303 */
/***/ (function(module) {

module.exports = {"name":"node-lint-md-cli-rollup","description":"remark packaged for node markdown linting","version":"1.0.0","devDependencies":{"@zeit/ncc":"^0.2.0"},"dependencies":{"markdown-extensions":"^1.1.0","remark":"^10.0.0","remark-lint":"^6.0.3","remark-preset-lint-node":"^1.3.1","unified-args":"^6.0.0","unified-engine":"^5.1.0"},"main":"src/cli-entry.js","scripts":{"build":"ncc build","build-node":"npm run build && cp dist/index.js ../lint-md.js"}};
module.exports = {"name":"node-lint-md-cli-rollup","description":"remark packaged for node markdown linting","version":"1.0.0","devDependencies":{"@zeit/ncc":"^0.2.0"},"dependencies":{"markdown-extensions":"^1.1.0","remark":"^10.0.0","remark-lint":"^6.0.3","remark-preset-lint-node":"^1.4.0","unified-args":"^6.0.0","unified-engine":"^5.1.0"},"main":"src/cli-entry.js","scripts":{"build":"ncc build","build-node":"npm run build && cp dist/index.js ../lint-md.js"}};

/***/ }),
/* 304 */
Expand All @@ -35210,10 +35210,7 @@ module.exports.plugins = [
__webpack_require__(316),
__webpack_require__(93),
__webpack_require__(93),
[
__webpack_require__(317),
'space'
],
[__webpack_require__(317), "space"],
__webpack_require__(320),
__webpack_require__(321),
__webpack_require__(322),
Expand All @@ -35237,25 +35234,27 @@ module.exports.plugins = [
[
__webpack_require__(340),
{
'checked': 'x', 'unchecked': ' '
checked: "x",
unchecked: " "
}
],
[__webpack_require__(341), 'fenced'],
[__webpack_require__(342), '`'],
[__webpack_require__(343), 'md'],
[__webpack_require__(341), "fenced"],
[__webpack_require__(342), "`"],
[__webpack_require__(343), "md"],
[__webpack_require__(344), 1],
[__webpack_require__(345), 'atx'],
[__webpack_require__(345), "atx"],
[
__webpack_require__(346),
[
{ no: 'Github', yes: 'GitHub' },
{ no: 'Javascript', yes: 'JavaScript' },
{ no: 'Node.JS', yes: 'Node.js' },
{ no: 'v8', yes: 'V8' }
{ no: "End-Of-Life", yes: "End-of-Life" },
{ no: "Github", yes: "GitHub" },
{ no: "Javascript", yes: "JavaScript" },
{ no: "Node.JS", yes: "Node.js" },
{ no: "v8", yes: "V8" }
]
],
[__webpack_require__(347), '*'],
[__webpack_require__(348), 'padded']
[__webpack_require__(347), "*"],
[__webpack_require__(348), "padded"]
];


Expand Down Expand Up @@ -36842,7 +36841,7 @@ module.exports = {"addendum":"addenda","aircraft":"aircraft","alga":"algae","alu
* Options: `number`, default: `80`.
*
* Ignores nodes that cannot be wrapped, such as headings, tables,
* code, and definitions.
* code, definitions, HTML, and JSX.
*
* Ignores images, links, and inline code if they start before the wrap, end
* after the wrap, and there’s no white-space after them.
Expand All @@ -36868,6 +36867,8 @@ module.exports = {"addendum":"addenda","aircraft":"aircraft","alga":"algae","alu
* | -- | --------- | -- | ---- | ------ | -- | ---- | ------ | ------- | ----- | ----- | ---- |
* | be | helped | | | | | | | | | | . |
*
* <a><b><i><p><q><s><u>alpha bravo charlie delta echo foxtrot golf</u></s></q></p></i></b></a>
*
* The following is also fine, because there is no white-space.
*
* <http://this-long-url-with-a-long-domain-is-invalid.co.uk/a-long-path?query=variables>.
Expand Down Expand Up @@ -36941,10 +36942,11 @@ function maximumLineLength(tree, file, pref) {
var index = -1
var lineLength

visit(tree, ['heading', 'table', 'code', 'definition'], ignore)
// Note: JSX is from MDX: <https://github.com/mdx-js/specification>.
visit(tree, ['heading', 'table', 'code', 'definition', 'html', 'jsx'], ignore)
visit(tree, ['link', 'image', 'inlineCode'], inline)

/* Iterate over every line, and warn for violating lines. */
// Iterate over every line, and warn for violating lines.
while (++index < length) {
lineLength = lines[index].length

Expand All @@ -36956,9 +36958,9 @@ function maximumLineLength(tree, file, pref) {
}
}

/* Finally, whitelist some inline spans, but only if they occur at or after
* the wrap. However, when they do, and there’s white-space after it, they
* are not whitelisted. */
// Finally, whitelist some inline spans, but only if they occur at or after
// the wrap. However, when they do, and there’s white-space after it, they
// are not whitelisted.
function inline(node, pos, parent) {
var next = parent.children[pos + 1]
var initial
Expand All @@ -36972,13 +36974,12 @@ function maximumLineLength(tree, file, pref) {
initial = start(node)
final = end(node)

/* No whitelisting when starting after the border, or ending before it. */
// No whitelisting when starting after the border, or ending before it.
if (initial.column > style || final.column < style) {
return
}

/* No whitelisting when there’s white-space after
* the link. */
// No whitelisting when there’s white-space after the link.
if (
next &&
start(next).line === initial.line &&
Expand All @@ -36997,7 +36998,7 @@ function maximumLineLength(tree, file, pref) {
}
}

/* Whitelist from `initial` to `final`, zero-based. */
// Whitelist from `initial` to `final`, zero-based.
function whitelist(initial, final) {
while (initial < final) {
lines[initial++] = ''
Expand Down Expand Up @@ -39599,16 +39600,16 @@ function tableCellPadding(tree, file, pref) {
var entry
var final

/* Check rows. */
// Check rows.
while (++index < length) {
row = rows[index]
cells = row.children
cellCount = cells.length
column = -2 /* Start without a first cell */
column = -2 // Start without a first cell.
next = null
final = undefined

/* Check fences (before, between, and after cells) */
// Check fences (before, between, and after cells).
while (++column < cellCount) {
cell = next
next = cells[column + 1]
Expand All @@ -39623,7 +39624,7 @@ function tableCellPadding(tree, file, pref) {
if (cell && cell.children.length !== 0 && final !== undefined) {
entries.push({node: cell, start: final, end: pos, index: column})

/* Detect max space per column. */
// Detect max space per column.
sizes[column] = Math.max(sizes[column] || 0, size(cell))
} else {
final = undefined
Expand Down Expand Up @@ -39670,7 +39671,7 @@ function tableCellPadding(tree, file, pref) {
if (style === 0) {
reason += 'compact'

/* Ignore every cell except the biggest in the column. */
// Ignore every cell except the biggest in the column.
if (size(cell) < sizes[index]) {
return
}
Expand All @@ -39680,7 +39681,7 @@ function tableCellPadding(tree, file, pref) {
if (spacing > style) {
reason += ' with 1 space, not ' + spacing

/* May be right or center aligned. */
// May be right or center aligned.
if (size(cell) < sizes[index]) {
return
}
Expand Down
Loading

0 comments on commit 0080350

Please sign in to comment.