mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-22 05:40:48 +02:00
Update dependencies: eslint-plugin-jsdoc to 31.6.0, eslint-plugin-unicorn to 27.0.0.
This commit is contained in:
parent
ec907567e2
commit
c87d7f5b8c
13 changed files with 95 additions and 74 deletions
|
@ -124,8 +124,10 @@
|
|||
|
||||
"unicorn/better-regex": "off",
|
||||
"unicorn/catch-error-name": "error",
|
||||
"unicorn/consistent-destructuring": "error",
|
||||
"unicorn/consistent-function-scoping": "off",
|
||||
"unicorn/custom-error-definition": "error",
|
||||
"unicorn/empty-brace-spaces": "error",
|
||||
"unicorn/error-message": "error",
|
||||
"unicorn/escape-case": "error",
|
||||
"unicorn/expiring-todo-comments": "error",
|
||||
|
@ -135,18 +137,23 @@
|
|||
"unicorn/import-style": "error",
|
||||
"unicorn/new-for-builtins": "error",
|
||||
"unicorn/no-abusive-eslint-disable": "error",
|
||||
"unicorn/no-array-instanceof": "error",
|
||||
"unicorn/no-array-callback-reference": "off",
|
||||
"unicorn/no-array-for-each": "off",
|
||||
"unicorn/no-array-push-push": "error",
|
||||
"unicorn/no-array-reduce": "error",
|
||||
"unicorn/no-console-spaces": "error",
|
||||
"unicorn/no-fn-reference-in-iterator": "off",
|
||||
"unicorn/no-for-loop": "error",
|
||||
"unicorn/no-hex-escape": "error",
|
||||
"unicorn/no-instanceof-array": "error",
|
||||
"unicorn/no-keyword-prefix": "off",
|
||||
"unicorn/no-lonely-if": "error",
|
||||
"unicorn/no-nested-ternary": "error",
|
||||
"unicorn/no-new-array": "off",
|
||||
"unicorn/no-new-buffer": "error",
|
||||
"unicorn/no-null": "off",
|
||||
"unicorn/no-object-as-default-parameter": "error",
|
||||
"unicorn/no-process-exit": "error",
|
||||
"unicorn/no-reduce": "error",
|
||||
"unicorn/no-this-assignment": "error",
|
||||
"unicorn/no-unreadable-array-destructuring": "error",
|
||||
"unicorn/no-unsafe-regex": "off",
|
||||
"unicorn/no-unused-properties": "error",
|
||||
|
@ -156,27 +163,32 @@
|
|||
"unicorn/numeric-separators-style": "error",
|
||||
"unicorn/prefer-add-event-listener": "error",
|
||||
"unicorn/prefer-array-find": "error",
|
||||
"unicorn/prefer-dataset": "error",
|
||||
"unicorn/prefer-event-key": "error",
|
||||
"unicorn/prefer-flat-map": "error",
|
||||
"unicorn/prefer-array-flat-map": "error",
|
||||
"unicorn/prefer-array-index-of": "error",
|
||||
"unicorn/prefer-array-some": "error",
|
||||
"unicorn/prefer-date-now": "error",
|
||||
"unicorn/prefer-default-parameters": "error",
|
||||
"unicorn/prefer-dom-node-append": "error",
|
||||
"unicorn/prefer-dom-node-dataset": "error",
|
||||
"unicorn/prefer-dom-node-remove": "error",
|
||||
"unicorn/prefer-dom-node-text-content": "error",
|
||||
"unicorn/prefer-includes": "error",
|
||||
"unicorn/prefer-keyboard-event-key": "error",
|
||||
"unicorn/prefer-math-trunc": "error",
|
||||
"unicorn/prefer-modern-dom-apis": "error",
|
||||
"unicorn/prefer-negative-index": "error",
|
||||
"unicorn/prefer-node-append": "error",
|
||||
"unicorn/prefer-node-remove": "error",
|
||||
"unicorn/prefer-number-properties": "error",
|
||||
"unicorn/prefer-optional-catch-binding": "error",
|
||||
"unicorn/prefer-query-selector": "error",
|
||||
"unicorn/prefer-reflect-apply": "error",
|
||||
"unicorn/prefer-replace-all": "off",
|
||||
"unicorn/prefer-regexp-test": "error",
|
||||
"unicorn/prefer-set-has": "error",
|
||||
"unicorn/prefer-spread": "error",
|
||||
"unicorn/prefer-starts-ends-with": "error",
|
||||
"unicorn/prefer-string-replace-all": "off",
|
||||
"unicorn/prefer-string-slice": "off",
|
||||
"unicorn/prefer-string-starts-ends-with": "error",
|
||||
"unicorn/prefer-string-trim-start-end": "error",
|
||||
"unicorn/prefer-ternary": "error",
|
||||
"unicorn/prefer-text-content": "error",
|
||||
"unicorn/prefer-trim-start-end": "off",
|
||||
"unicorn/prefer-type-error": "error",
|
||||
"unicorn/prevent-abbreviations": "off",
|
||||
"unicorn/string-content": "error",
|
||||
|
|
|
@ -197,7 +197,7 @@ module.exports.fencedCodeBlockStyleFor =
|
|||
*/
|
||||
function indentFor(token) {
|
||||
var line = token.line.replace(/^[\s>]*(> |>)/, "");
|
||||
return line.length - line.trimLeft().length;
|
||||
return line.length - line.trimStart().length;
|
||||
}
|
||||
module.exports.indentFor = indentFor;
|
||||
// Returns the heading style for a heading token
|
||||
|
@ -822,10 +822,10 @@ function validateRuleList(ruleList) {
|
|||
result = newError(property);
|
||||
}
|
||||
});
|
||||
if (!result && rule.information) {
|
||||
if (Object.getPrototypeOf(rule.information) !== URL.prototype) {
|
||||
result = newError("information");
|
||||
}
|
||||
if (!result &&
|
||||
rule.information &&
|
||||
(Object.getPrototypeOf(rule.information) !== URL.prototype)) {
|
||||
result = newError("information");
|
||||
}
|
||||
if (!result) {
|
||||
rule.names.forEach(function forName(name) {
|
||||
|
@ -1437,6 +1437,7 @@ function lintInput(options, synchronous, callback) {
|
|||
// Normalize inputs
|
||||
options = options || {};
|
||||
callback = callback || function noop() { };
|
||||
// eslint-disable-next-line unicorn/prefer-spread
|
||||
var ruleList = rules.concat(options.customRules || []);
|
||||
var ruleErr = validateRuleList(ruleList);
|
||||
if (ruleErr) {
|
||||
|
@ -1986,7 +1987,7 @@ module.exports = {
|
|||
list.items.forEach(function (item) {
|
||||
var lineNumber = item.lineNumber, line = item.line;
|
||||
addErrorDetailIf(onError, lineNumber, 0, list.indent, null, null, rangeFromRegExp(line, listItemMarkerRe), {
|
||||
"deleteCount": line.length - line.trimLeft().length
|
||||
"deleteCount": line.length - line.trimStart().length
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@ -2097,20 +2098,20 @@ module.exports = {
|
|||
var expected = (brSpaces < 2) ? 0 : brSpaces;
|
||||
forEachLine(lineMetadata(), function (line, lineIndex, inCode) {
|
||||
var lineNumber = lineIndex + 1;
|
||||
var trailingSpaces = line.length - line.trimRight().length;
|
||||
if (trailingSpaces && !inCode &&
|
||||
!includesSorted(listItemLineNumbers, lineNumber)) {
|
||||
if ((expected !== trailingSpaces) ||
|
||||
var trailingSpaces = line.length - line.trimEnd().length;
|
||||
if (trailingSpaces &&
|
||||
!inCode &&
|
||||
!includesSorted(listItemLineNumbers, lineNumber) &&
|
||||
((expected !== trailingSpaces) ||
|
||||
(strict &&
|
||||
(!includesSorted(paragraphLineNumbers, lineNumber) ||
|
||||
includesSorted(codeInlineLineNumbers, lineNumber)))) {
|
||||
var column = line.length - trailingSpaces + 1;
|
||||
addError(onError, lineNumber, "Expected: " + (expected === 0 ? "" : "0 or ") +
|
||||
expected + "; Actual: " + trailingSpaces, null, [column, trailingSpaces], {
|
||||
"editColumn": column,
|
||||
"deleteCount": trailingSpaces
|
||||
});
|
||||
}
|
||||
includesSorted(codeInlineLineNumbers, lineNumber))))) {
|
||||
var column = line.length - trailingSpaces + 1;
|
||||
addError(onError, lineNumber, "Expected: " + (expected === 0 ? "" : "0 or ") +
|
||||
expected + "; Actual: " + trailingSpaces, null, [column, trailingSpaces], {
|
||||
"editColumn": column,
|
||||
"deleteCount": trailingSpaces
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -2616,7 +2617,7 @@ module.exports = {
|
|||
if (match) {
|
||||
var prefixAndFirstChar = match[0], prefix = match[1];
|
||||
var deleteCount = prefix.length;
|
||||
var prefixLengthNoSpace = prefix.trimRight().length;
|
||||
var prefixLengthNoSpace = prefix.trimEnd().length;
|
||||
if (prefixLengthNoSpace) {
|
||||
deleteCount -= prefixLengthNoSpace - 1;
|
||||
}
|
||||
|
@ -3023,7 +3024,7 @@ module.exports = {
|
|||
var firstIndex = list.open.map[0];
|
||||
if (!isBlankLine(lines[firstIndex - 1])) {
|
||||
var line = lines[firstIndex];
|
||||
var quotePrefix = line.match(quotePrefixRe)[0].trimRight();
|
||||
var quotePrefix = line.match(quotePrefixRe)[0].trimEnd();
|
||||
addErrorContext(onError, firstIndex + 1, line.trim(), null, null, null, {
|
||||
"insertText": quotePrefix + "\n"
|
||||
});
|
||||
|
@ -3031,7 +3032,7 @@ module.exports = {
|
|||
var lastIndex = list.lastLineIndex - 1;
|
||||
if (!isBlankLine(lines[lastIndex + 1])) {
|
||||
var line = lines[lastIndex];
|
||||
var quotePrefix = line.match(quotePrefixRe)[0].trimRight();
|
||||
var quotePrefix = line.match(quotePrefixRe)[0].trimEnd();
|
||||
addErrorContext(onError, lastIndex + 1, line.trim(), null, null, null, {
|
||||
"lineNumber": lastIndex + 2,
|
||||
"insertText": quotePrefix + "\n"
|
||||
|
@ -3286,10 +3287,10 @@ module.exports = {
|
|||
// Close current run
|
||||
var content = line.substring(emphasisIndex, matchIndex);
|
||||
if (!emphasisLength) {
|
||||
content = content.trimLeft();
|
||||
content = content.trimStart();
|
||||
}
|
||||
if (!match) {
|
||||
content = content.trimRight();
|
||||
content = content.trimEnd();
|
||||
}
|
||||
var leftSpace = leftSpaceRe.test(content);
|
||||
var rightSpace = rightSpaceRe.test(content);
|
||||
|
@ -3503,8 +3504,8 @@ module.exports = {
|
|||
}
|
||||
else if (type === "link_close") {
|
||||
inLink = false;
|
||||
var left = linkText.trimLeft().length !== linkText.length;
|
||||
var right = linkText.trimRight().length !== linkText.length;
|
||||
var left = linkText.trimStart().length !== linkText.length;
|
||||
var right = linkText.trimEnd().length !== linkText.length;
|
||||
if (left || right) {
|
||||
var line = params.lines[lineNumber - 1];
|
||||
var range = null;
|
||||
|
@ -4014,7 +4015,7 @@ module.exports = rules;
|
|||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = JSON.parse("{\"name\":\"markdownlint\",\"version\":\"0.22.0\",\"description\":\"A Node.js style checker and lint tool for Markdown/CommonMark files.\",\"main\":\"lib/markdownlint.js\",\"types\":\"lib/markdownlint.d.ts\",\"author\":\"David Anson (https://dlaa.me/)\",\"license\":\"MIT\",\"homepage\":\"https://github.com/DavidAnson/markdownlint\",\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/DavidAnson/markdownlint.git\"},\"bugs\":\"https://github.com/DavidAnson/markdownlint/issues\",\"scripts\":{\"build-config\":\"npm run build-config-schema && npm run build-config-example\",\"build-config-example\":\"node schema/build-config-example.js\",\"build-config-schema\":\"node schema/build-config-schema.js\",\"build-declaration\":\"tsc --allowJs --declaration --emitDeclarationOnly --resolveJsonModule lib/markdownlint.js && rimraf 'lib/{c,md,r}*.d.ts' 'helpers/*.d.ts'\",\"build-demo\":\"cpy node_modules/markdown-it/dist/markdown-it.min.js demo && cd demo && rimraf markdownlint-browser.* && webpack --no-stats\",\"build-example\":\"npm install --no-save --ignore-scripts grunt grunt-cli gulp through2\",\"ci\":\"npm-run-all --continue-on-error --parallel test-cover lint declaration build-config build-demo && git diff --exit-code\",\"clean-test-repos\":\"rimraf test-repos\",\"clone-test-repos\":\"mkdir test-repos && cd test-repos && git clone https://github.com/eslint/eslint eslint-eslint --depth 1 --no-tags --quiet && git clone https://github.com/mkdocs/mkdocs mkdocs-mkdocs --depth 1 --no-tags --quiet && git clone https://github.com/pi-hole/docs pi-hole-docs --depth 1 --no-tags --quiet\",\"clone-test-repos-large\":\"npm run clone-test-repos && cd test-repos && git clone https://github.com/dotnet/docs dotnet-docs --depth 1 --no-tags --quiet\",\"declaration\":\"npm run build-declaration && npm run test-declaration\",\"example\":\"cd example && node standalone.js && grunt markdownlint --force && gulp markdownlint\",\"lint\":\"eslint --max-warnings 0 .\",\"lint-test-repos\":\"ava --timeout=5m test/markdownlint-test-repos.js\",\"test\":\"ava test/markdownlint-test.js test/markdownlint-test-custom-rules.js test/markdownlint-test-helpers.js test/markdownlint-test-result-object.js test/markdownlint-test-scenarios.js\",\"test-cover\":\"c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 npm test\",\"test-declaration\":\"cd example/typescript && tsc && node type-check.js\",\"test-extra\":\"ava --timeout=5m test/markdownlint-test-extra.js\"},\"engines\":{\"node\":\">=10\"},\"dependencies\":{\"markdown-it\":\"12.0.4\"},\"devDependencies\":{\"ava\":\"~3.15.0\",\"c8\":\"~7.5.0\",\"cpy-cli\":\"~3.1.1\",\"eslint\":\"~7.19.0\",\"eslint-plugin-jsdoc\":\"~30.7.8\",\"eslint-plugin-node\":\"~11.1.0\",\"eslint-plugin-unicorn\":\"~23.0.0\",\"globby\":\"~11.0.2\",\"js-yaml\":\"~4.0.0\",\"markdown-it-for-inline\":\"~0.1.1\",\"markdown-it-sub\":\"~1.0.0\",\"markdown-it-sup\":\"~1.0.0\",\"markdown-it-texmath\":\"~0.8.0\",\"markdownlint-rule-helpers\":\"~0.13.0\",\"npm-run-all\":\"~4.1.5\",\"rimraf\":\"~3.0.2\",\"strip-json-comments\":\"~3.1.1\",\"toml\":\"~3.0.0\",\"ts-loader\":\"~8.0.15\",\"tv4\":\"~1.3.0\",\"typescript\":\"~4.1.3\",\"webpack\":\"~5.21.1\",\"webpack-cli\":\"~4.5.0\"},\"keywords\":[\"markdown\",\"lint\",\"md\",\"CommonMark\",\"markdownlint\"]}");
|
||||
module.exports = JSON.parse("{\"name\":\"markdownlint\",\"version\":\"0.22.0\",\"description\":\"A Node.js style checker and lint tool for Markdown/CommonMark files.\",\"main\":\"lib/markdownlint.js\",\"types\":\"lib/markdownlint.d.ts\",\"author\":\"David Anson (https://dlaa.me/)\",\"license\":\"MIT\",\"homepage\":\"https://github.com/DavidAnson/markdownlint\",\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/DavidAnson/markdownlint.git\"},\"bugs\":\"https://github.com/DavidAnson/markdownlint/issues\",\"scripts\":{\"build-config\":\"npm run build-config-schema && npm run build-config-example\",\"build-config-example\":\"node schema/build-config-example.js\",\"build-config-schema\":\"node schema/build-config-schema.js\",\"build-declaration\":\"tsc --allowJs --declaration --emitDeclarationOnly --resolveJsonModule lib/markdownlint.js && rimraf 'lib/{c,md,r}*.d.ts' 'helpers/*.d.ts'\",\"build-demo\":\"cpy node_modules/markdown-it/dist/markdown-it.min.js demo && cd demo && rimraf markdownlint-browser.* && webpack --no-stats\",\"build-example\":\"npm install --no-save --ignore-scripts grunt grunt-cli gulp through2\",\"ci\":\"npm-run-all --continue-on-error --parallel test-cover lint declaration build-config build-demo && git diff --exit-code\",\"clean-test-repos\":\"rimraf test-repos\",\"clone-test-repos\":\"mkdir test-repos && cd test-repos && git clone https://github.com/eslint/eslint eslint-eslint --depth 1 --no-tags --quiet && git clone https://github.com/mkdocs/mkdocs mkdocs-mkdocs --depth 1 --no-tags --quiet && git clone https://github.com/pi-hole/docs pi-hole-docs --depth 1 --no-tags --quiet\",\"clone-test-repos-large\":\"npm run clone-test-repos && cd test-repos && git clone https://github.com/dotnet/docs dotnet-docs --depth 1 --no-tags --quiet\",\"declaration\":\"npm run build-declaration && npm run test-declaration\",\"example\":\"cd example && node standalone.js && grunt markdownlint --force && gulp markdownlint\",\"lint\":\"eslint --max-warnings 0 .\",\"lint-test-repos\":\"ava --timeout=5m test/markdownlint-test-repos.js\",\"test\":\"ava test/markdownlint-test.js test/markdownlint-test-custom-rules.js test/markdownlint-test-helpers.js test/markdownlint-test-result-object.js test/markdownlint-test-scenarios.js\",\"test-cover\":\"c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 npm test\",\"test-declaration\":\"cd example/typescript && tsc && node type-check.js\",\"test-extra\":\"ava --timeout=5m test/markdownlint-test-extra.js\"},\"engines\":{\"node\":\">=10\"},\"dependencies\":{\"markdown-it\":\"12.0.4\"},\"devDependencies\":{\"ava\":\"~3.15.0\",\"c8\":\"~7.5.0\",\"cpy-cli\":\"~3.1.1\",\"eslint\":\"~7.19.0\",\"eslint-plugin-jsdoc\":\"~31.6.0\",\"eslint-plugin-node\":\"~11.1.0\",\"eslint-plugin-unicorn\":\"~27.0.0\",\"globby\":\"~11.0.2\",\"js-yaml\":\"~4.0.0\",\"markdown-it-for-inline\":\"~0.1.1\",\"markdown-it-sub\":\"~1.0.0\",\"markdown-it-sup\":\"~1.0.0\",\"markdown-it-texmath\":\"~0.8.0\",\"markdownlint-rule-helpers\":\"~0.13.0\",\"npm-run-all\":\"~4.1.5\",\"rimraf\":\"~3.0.2\",\"strip-json-comments\":\"~3.1.1\",\"toml\":\"~3.0.0\",\"ts-loader\":\"~8.0.15\",\"tv4\":\"~1.3.0\",\"typescript\":\"~4.1.3\",\"webpack\":\"~5.21.1\",\"webpack-cli\":\"~4.5.0\"},\"keywords\":[\"markdown\",\"lint\",\"md\",\"CommonMark\",\"markdownlint\"]}");
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
|
|
@ -188,7 +188,7 @@ module.exports.fencedCodeBlockStyleFor =
|
|||
*/
|
||||
function indentFor(token) {
|
||||
const line = token.line.replace(/^[\s>]*(> |>)/, "");
|
||||
return line.length - line.trimLeft().length;
|
||||
return line.length - line.trimStart().length;
|
||||
}
|
||||
module.exports.indentFor = indentFor;
|
||||
|
||||
|
|
|
@ -51,10 +51,12 @@ function validateRuleList(ruleList) {
|
|||
result = newError(property);
|
||||
}
|
||||
});
|
||||
if (!result && rule.information) {
|
||||
if (Object.getPrototypeOf(rule.information) !== URL.prototype) {
|
||||
result = newError("information");
|
||||
}
|
||||
if (
|
||||
!result &&
|
||||
rule.information &&
|
||||
(Object.getPrototypeOf(rule.information) !== URL.prototype)
|
||||
) {
|
||||
result = newError("information");
|
||||
}
|
||||
if (!result) {
|
||||
rule.names.forEach(function forName(name) {
|
||||
|
@ -721,6 +723,7 @@ function lintInput(options, synchronous, callback) {
|
|||
// Normalize inputs
|
||||
options = options || {};
|
||||
callback = callback || function noop() {};
|
||||
// eslint-disable-next-line unicorn/prefer-spread
|
||||
const ruleList = rules.concat(options.customRules || []);
|
||||
const ruleErr = validateRuleList(ruleList);
|
||||
if (ruleErr) {
|
||||
|
|
|
@ -25,7 +25,7 @@ module.exports = {
|
|||
null,
|
||||
rangeFromRegExp(line, listItemMarkerRe),
|
||||
{
|
||||
"deleteCount": line.length - line.trimLeft().length
|
||||
"deleteCount": line.length - line.trimStart().length
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
44
lib/md009.js
44
lib/md009.js
|
@ -49,26 +49,30 @@ module.exports = {
|
|||
const expected = (brSpaces < 2) ? 0 : brSpaces;
|
||||
forEachLine(lineMetadata(), (line, lineIndex, inCode) => {
|
||||
const lineNumber = lineIndex + 1;
|
||||
const trailingSpaces = line.length - line.trimRight().length;
|
||||
if (trailingSpaces && !inCode &&
|
||||
!includesSorted(listItemLineNumbers, lineNumber)) {
|
||||
if ((expected !== trailingSpaces) ||
|
||||
(strict &&
|
||||
(!includesSorted(paragraphLineNumbers, lineNumber) ||
|
||||
includesSorted(codeInlineLineNumbers, lineNumber)))) {
|
||||
const column = line.length - trailingSpaces + 1;
|
||||
addError(
|
||||
onError,
|
||||
lineNumber,
|
||||
"Expected: " + (expected === 0 ? "" : "0 or ") +
|
||||
expected + "; Actual: " + trailingSpaces,
|
||||
null,
|
||||
[ column, trailingSpaces ],
|
||||
{
|
||||
"editColumn": column,
|
||||
"deleteCount": trailingSpaces
|
||||
});
|
||||
}
|
||||
const trailingSpaces = line.length - line.trimEnd().length;
|
||||
if (
|
||||
trailingSpaces &&
|
||||
!inCode &&
|
||||
!includesSorted(listItemLineNumbers, lineNumber) &&
|
||||
(
|
||||
(expected !== trailingSpaces) ||
|
||||
(strict &&
|
||||
(!includesSorted(paragraphLineNumbers, lineNumber) ||
|
||||
includesSorted(codeInlineLineNumbers, lineNumber)))
|
||||
)
|
||||
) {
|
||||
const column = line.length - trailingSpaces + 1;
|
||||
addError(
|
||||
onError,
|
||||
lineNumber,
|
||||
"Expected: " + (expected === 0 ? "" : "0 or ") +
|
||||
expected + "; Actual: " + trailingSpaces,
|
||||
null,
|
||||
[ column, trailingSpaces ],
|
||||
{
|
||||
"editColumn": column,
|
||||
"deleteCount": trailingSpaces
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ module.exports = {
|
|||
if (match) {
|
||||
const [ prefixAndFirstChar, prefix ] = match;
|
||||
let deleteCount = prefix.length;
|
||||
const prefixLengthNoSpace = prefix.trimRight().length;
|
||||
const prefixLengthNoSpace = prefix.trimEnd().length;
|
||||
if (prefixLengthNoSpace) {
|
||||
deleteCount -= prefixLengthNoSpace - 1;
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ module.exports = {
|
|||
const firstIndex = list.open.map[0];
|
||||
if (!isBlankLine(lines[firstIndex - 1])) {
|
||||
const line = lines[firstIndex];
|
||||
const quotePrefix = line.match(quotePrefixRe)[0].trimRight();
|
||||
const quotePrefix = line.match(quotePrefixRe)[0].trimEnd();
|
||||
addErrorContext(
|
||||
onError,
|
||||
firstIndex + 1,
|
||||
|
@ -32,7 +32,7 @@ module.exports = {
|
|||
const lastIndex = list.lastLineIndex - 1;
|
||||
if (!isBlankLine(lines[lastIndex + 1])) {
|
||||
const line = lines[lastIndex];
|
||||
const quotePrefix = line.match(quotePrefixRe)[0].trimRight();
|
||||
const quotePrefix = line.match(quotePrefixRe)[0].trimEnd();
|
||||
addErrorContext(
|
||||
onError,
|
||||
lastIndex + 1,
|
||||
|
|
|
@ -35,10 +35,10 @@ module.exports = {
|
|||
// Close current run
|
||||
let content = line.substring(emphasisIndex, matchIndex);
|
||||
if (!emphasisLength) {
|
||||
content = content.trimLeft();
|
||||
content = content.trimStart();
|
||||
}
|
||||
if (!match) {
|
||||
content = content.trimRight();
|
||||
content = content.trimEnd();
|
||||
}
|
||||
const leftSpace = leftSpaceRe.test(content);
|
||||
const rightSpace = rightSpaceRe.test(content);
|
||||
|
|
|
@ -24,8 +24,8 @@ module.exports = {
|
|||
linkText = "";
|
||||
} else if (type === "link_close") {
|
||||
inLink = false;
|
||||
const left = linkText.trimLeft().length !== linkText.length;
|
||||
const right = linkText.trimRight().length !== linkText.length;
|
||||
const left = linkText.trimStart().length !== linkText.length;
|
||||
const right = linkText.trimEnd().length !== linkText.length;
|
||||
if (left || right) {
|
||||
const line = params.lines[lineNumber - 1];
|
||||
let range = null;
|
||||
|
|
|
@ -43,9 +43,9 @@
|
|||
"c8": "~7.5.0",
|
||||
"cpy-cli": "~3.1.1",
|
||||
"eslint": "~7.19.0",
|
||||
"eslint-plugin-jsdoc": "~30.7.8",
|
||||
"eslint-plugin-jsdoc": "~31.6.0",
|
||||
"eslint-plugin-node": "~11.1.0",
|
||||
"eslint-plugin-unicorn": "~23.0.0",
|
||||
"eslint-plugin-unicorn": "~27.0.0",
|
||||
"globby": "~11.0.2",
|
||||
"js-yaml": "~4.0.0",
|
||||
"markdown-it-for-inline": "~0.1.1",
|
||||
|
|
|
@ -60,7 +60,7 @@ function lintTestRepo(t, globPatterns, configPath) {
|
|||
// eslint-disable-next-line no-console
|
||||
console.log(resultsString);
|
||||
}
|
||||
t.true(!resultsString.length, "Unexpected linting violations");
|
||||
t.is(resultsString.length, 0, "Unexpected linting violations");
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -887,6 +887,7 @@ test.cb("rules", (t) => {
|
|||
const tagAliasParameterRe = /, |: | /;
|
||||
// eslint-disable-next-line func-style
|
||||
const testTagsAliasesParams = (r) => {
|
||||
// eslint-disable-next-line unicorn/prefer-default-parameters
|
||||
r = r || "[NO RULE]";
|
||||
t.true(ruleHasTags,
|
||||
"Missing tags for rule " + r.names + ".");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue