Skip to content
Permalink
Browse files

tools: update markdown linter

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 committed Feb 23, 2019
1 parent 2e125cc commit ccd6b12fec944c0e77fc60ffd8cea9781d850a2e
Showing with 100 additions and 80 deletions.
  1. +34 −33 tools/lint-md.js
  2. +65 −46 tools/node-lint-md-cli-rollup/package-lock.json
  3. +1 −1 tools/node-lint-md-cli-rollup/package.json
/* 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 */
__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),
[
__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"]
];


* 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.
* | -- | --------- | -- | ---- | ------ | -- | ---- | ------ | ------- | ----- | ----- | ---- |
* | 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>.
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

}
}

/* 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
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 &&
}
}

/* Whitelist from `initial` to `final`, zero-based. */
// Whitelist from `initial` to `final`, zero-based.
function whitelist(initial, final) {
while (initial < final) {
lines[initial++] = ''
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]
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
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
}
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
}
Oops, something went wrong.

0 comments on commit ccd6b12

Please sign in to comment.
You can’t perform that action at this time.