mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-21 21:30:47 +02:00
Remove MD002 (deprecated in v0.13.0) and MD006 (deprecated in v0.19.0).
This commit is contained in:
parent
80539b774e
commit
20a552b4b7
40 changed files with 250 additions and 1239 deletions
2
.github/dictionary.txt
vendored
2
.github/dictionary.txt
vendored
|
@ -33,8 +33,6 @@ ES2015
|
||||||
ES6
|
ES6
|
||||||
ESLint
|
ESLint
|
||||||
eslint-plugin-markdownlint
|
eslint-plugin-markdownlint
|
||||||
first-header-h1
|
|
||||||
first-heading-h1
|
|
||||||
first-line-h1
|
first-line-h1
|
||||||
formatter
|
formatter
|
||||||
fs
|
fs
|
||||||
|
|
17
README.md
17
README.md
|
@ -87,11 +87,9 @@ playground for learning and exploring.
|
||||||
<!-- markdownlint-disable line-length -->
|
<!-- markdownlint-disable line-length -->
|
||||||
|
|
||||||
- **[MD001](doc/md001.md)** *heading-increment/header-increment* - Heading levels should only increment by one level at a time
|
- **[MD001](doc/md001.md)** *heading-increment/header-increment* - Heading levels should only increment by one level at a time
|
||||||
- ~~**[MD002](doc/md002.md)** *first-heading-h1/first-header-h1* - First heading should be a top-level heading~~
|
|
||||||
- **[MD003](doc/md003.md)** *heading-style/header-style* - Heading style
|
- **[MD003](doc/md003.md)** *heading-style/header-style* - Heading style
|
||||||
- **[MD004](doc/md004.md)** *ul-style* - Unordered list style
|
- **[MD004](doc/md004.md)** *ul-style* - Unordered list style
|
||||||
- **[MD005](doc/md005.md)** *list-indent* - Inconsistent indentation for list items at the same level
|
- **[MD005](doc/md005.md)** *list-indent* - Inconsistent indentation for list items at the same level
|
||||||
- ~~**[MD006](doc/md006.md)** *ul-start-left* - Consider starting bulleted lists at the beginning of the line~~
|
|
||||||
- **[MD007](doc/md007.md)** *ul-indent* - Unordered list indentation
|
- **[MD007](doc/md007.md)** *ul-indent* - Unordered list indentation
|
||||||
- **[MD009](doc/md009.md)** *no-trailing-spaces* - Trailing spaces
|
- **[MD009](doc/md009.md)** *no-trailing-spaces* - Trailing spaces
|
||||||
- **[MD010](doc/md010.md)** *no-hard-tabs* - Hard tabs
|
- **[MD010](doc/md010.md)** *no-hard-tabs* - Hard tabs
|
||||||
|
@ -141,8 +139,6 @@ playground for learning and exploring.
|
||||||
|
|
||||||
See [Rules.md](doc/Rules.md) for more details.
|
See [Rules.md](doc/Rules.md) for more details.
|
||||||
|
|
||||||
~~Struck through~~ rules are deprecated and provided for backward-compatibility.
|
|
||||||
|
|
||||||
> All rules with `heading` as part of their name are also available as `header`
|
> All rules with `heading` as part of their name are also available as `header`
|
||||||
> aliases (e.g. `heading-increment` is also available as `header-increment`).
|
> aliases (e.g. `heading-increment` is also available as `header-increment`).
|
||||||
> The use of `header` is deprecated and provided for backward-compatibility.
|
> The use of `header` is deprecated and provided for backward-compatibility.
|
||||||
|
@ -166,19 +162,18 @@ rules at once.
|
||||||
- **`atx_closed`** - `MD020`, `MD021`
|
- **`atx_closed`** - `MD020`, `MD021`
|
||||||
- **`blank_lines`** - `MD012`, `MD022`, `MD031`, `MD032`, `MD047`
|
- **`blank_lines`** - `MD012`, `MD022`, `MD031`, `MD032`, `MD047`
|
||||||
- **`blockquote`** - `MD027`, `MD028`
|
- **`blockquote`** - `MD027`, `MD028`
|
||||||
- **`bullet`** - `MD004`, `MD005`, `MD006`, `MD007`, `MD032`
|
- **`bullet`** - `MD004`, `MD005`, `MD007`, `MD032`
|
||||||
- **`code`** - `MD014`, `MD031`, `MD038`, `MD040`, `MD046`, `MD048`
|
- **`code`** - `MD014`, `MD031`, `MD038`, `MD040`, `MD046`, `MD048`
|
||||||
- **`emphasis`** - `MD036`, `MD037`, `MD049`, `MD050`
|
- **`emphasis`** - `MD036`, `MD037`, `MD049`, `MD050`
|
||||||
- **`hard_tab`** - `MD010`
|
- **`hard_tab`** - `MD010`
|
||||||
- **`headers`** - `MD001`, `MD002`, `MD003`, `MD018`, `MD019`, `MD020`, `MD021`,
|
- **`headers`** - `MD001`, `MD003`, `MD018`, `MD019`, `MD020`, `MD021`, `MD022`,
|
||||||
|
`MD023`, `MD024`, `MD025`, `MD026`, `MD036`, `MD041`, `MD043`
|
||||||
|
- **`headings`** - `MD001`, `MD003`, `MD018`, `MD019`, `MD020`, `MD021`,
|
||||||
`MD022`, `MD023`, `MD024`, `MD025`, `MD026`, `MD036`, `MD041`, `MD043`
|
`MD022`, `MD023`, `MD024`, `MD025`, `MD026`, `MD036`, `MD041`, `MD043`
|
||||||
- **`headings`** - `MD001`, `MD002`, `MD003`, `MD018`, `MD019`, `MD020`,
|
|
||||||
`MD021`, `MD022`, `MD023`, `MD024`, `MD025`, `MD026`, `MD036`, `MD041`,
|
|
||||||
`MD043`
|
|
||||||
- **`hr`** - `MD035`
|
- **`hr`** - `MD035`
|
||||||
- **`html`** - `MD033`
|
- **`html`** - `MD033`
|
||||||
- **`images`** - `MD045`, `MD052`, `MD053`, `MD054`
|
- **`images`** - `MD045`, `MD052`, `MD053`, `MD054`
|
||||||
- **`indentation`** - `MD005`, `MD006`, `MD007`, `MD027`
|
- **`indentation`** - `MD005`, `MD007`, `MD027`
|
||||||
- **`language`** - `MD040`
|
- **`language`** - `MD040`
|
||||||
- **`line_length`** - `MD013`
|
- **`line_length`** - `MD013`
|
||||||
- **`links`** - `MD011`, `MD034`, `MD039`, `MD042`, `MD051`, `MD052`, `MD053`,
|
- **`links`** - `MD011`, `MD034`, `MD039`, `MD042`, `MD051`, `MD052`, `MD053`,
|
||||||
|
@ -186,7 +181,7 @@ rules at once.
|
||||||
- **`ol`** - `MD029`, `MD030`, `MD032`
|
- **`ol`** - `MD029`, `MD030`, `MD032`
|
||||||
- **`spaces`** - `MD018`, `MD019`, `MD020`, `MD021`, `MD023`
|
- **`spaces`** - `MD018`, `MD019`, `MD020`, `MD021`, `MD023`
|
||||||
- **`spelling`** - `MD044`
|
- **`spelling`** - `MD044`
|
||||||
- **`ul`** - `MD004`, `MD005`, `MD006`, `MD007`, `MD030`, `MD032`
|
- **`ul`** - `MD004`, `MD005`, `MD007`, `MD030`, `MD032`
|
||||||
- **`url`** - `MD034`
|
- **`url`** - `MD034`
|
||||||
- **`whitespace`** - `MD009`, `MD010`, `MD012`, `MD027`, `MD028`, `MD030`,
|
- **`whitespace`** - `MD009`, `MD010`, `MD012`, `MD027`, `MD028`, `MD030`,
|
||||||
`MD037`, `MD038`, `MD039`
|
`MD037`, `MD038`, `MD039`
|
||||||
|
|
|
@ -228,7 +228,6 @@
|
||||||
"Click a violation for information about it or click its line number to highlighted it in the lower-left box.",
|
"Click a violation for information about it or click its line number to highlighted it in the lower-left box.",
|
||||||
"",
|
"",
|
||||||
"> *Note*: [All rules](https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md) are enabled except [MD013/line-length](https://github.com/DavidAnson/markdownlint/blob/main/doc/md013.md).",
|
"> *Note*: [All rules](https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md) are enabled except [MD013/line-length](https://github.com/DavidAnson/markdownlint/blob/main/doc/md013.md).",
|
||||||
"> ([MD002/first-heading-h1](https://github.com/DavidAnson/markdownlint/blob/main/doc/md002.md) and [MD006/ul-start-left](https://github.com/DavidAnson/markdownlint/blob/main/doc/md006.md) are deprecated.)",
|
|
||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
"#### Resources",
|
"#### Resources",
|
||||||
|
|
|
@ -1654,8 +1654,8 @@ module.exports.referenceLinkImageData = function () {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
module.exports.deprecatedRuleNames = ["MD002", "MD006"];
|
module.exports.deprecatedRuleNames = [];
|
||||||
module.exports.fixableRuleNames = ["MD004", "MD005", "MD006", "MD007", "MD009", "MD010", "MD011", "MD012", "MD014", "MD018", "MD019", "MD020", "MD021", "MD022", "MD023", "MD026", "MD027", "MD030", "MD031", "MD032", "MD034", "MD037", "MD038", "MD039", "MD044", "MD047", "MD049", "MD050", "MD051", "MD053", "MD054"];
|
module.exports.fixableRuleNames = ["MD004", "MD005", "MD007", "MD009", "MD010", "MD011", "MD012", "MD014", "MD018", "MD019", "MD020", "MD021", "MD022", "MD023", "MD026", "MD027", "MD030", "MD031", "MD032", "MD034", "MD037", "MD038", "MD039", "MD044", "MD047", "MD049", "MD050", "MD051", "MD053", "MD054"];
|
||||||
module.exports.homepage = "https://github.com/DavidAnson/markdownlint";
|
module.exports.homepage = "https://github.com/DavidAnson/markdownlint";
|
||||||
module.exports.version = "0.31.1";
|
module.exports.version = "0.31.1";
|
||||||
|
|
||||||
|
@ -1694,8 +1694,7 @@ var _require = __webpack_require__(/*! node:util */ "?39e5"),
|
||||||
promisify = _require.promisify;
|
promisify = _require.promisify;
|
||||||
var markdownit = __webpack_require__(/*! markdown-it */ "markdown-it");
|
var markdownit = __webpack_require__(/*! markdown-it */ "markdown-it");
|
||||||
var micromark = __webpack_require__(/*! ../helpers/micromark.cjs */ "../helpers/micromark.cjs");
|
var micromark = __webpack_require__(/*! ../helpers/micromark.cjs */ "../helpers/micromark.cjs");
|
||||||
var _require2 = __webpack_require__(/*! ./constants */ "../lib/constants.js"),
|
// const { deprecatedRuleNames } = require("./constants");
|
||||||
deprecatedRuleNames = _require2.deprecatedRuleNames;
|
|
||||||
var rules = __webpack_require__(/*! ./rules */ "../lib/rules.js");
|
var rules = __webpack_require__(/*! ./rules */ "../lib/rules.js");
|
||||||
var helpers = __webpack_require__(/*! ../helpers */ "../helpers/helpers.js");
|
var helpers = __webpack_require__(/*! ../helpers */ "../helpers/helpers.js");
|
||||||
var cache = __webpack_require__(/*! ./cache */ "../lib/cache.js");
|
var cache = __webpack_require__(/*! ./cache */ "../lib/cache.js");
|
||||||
|
@ -2116,23 +2115,14 @@ function getEffectiveConfig(ruleList, config, aliasToRuleNames) {
|
||||||
var _ruleName2 = rule.names[0].toUpperCase();
|
var _ruleName2 = rule.names[0].toUpperCase();
|
||||||
effectiveConfig[_ruleName2] = ruleDefault;
|
effectiveConfig[_ruleName2] = ruleDefault;
|
||||||
}
|
}
|
||||||
|
// for (const ruleName of deprecatedRuleNames) {
|
||||||
|
// effectiveConfig[ruleName] = false;
|
||||||
|
// }
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
_iterator14.e(err);
|
_iterator14.e(err);
|
||||||
} finally {
|
} finally {
|
||||||
_iterator14.f();
|
_iterator14.f();
|
||||||
}
|
}
|
||||||
var _iterator15 = _createForOfIteratorHelper(deprecatedRuleNames),
|
|
||||||
_step15;
|
|
||||||
try {
|
|
||||||
for (_iterator15.s(); !(_step15 = _iterator15.n()).done;) {
|
|
||||||
var _ruleName3 = _step15.value;
|
|
||||||
effectiveConfig[_ruleName3] = false;
|
|
||||||
}
|
|
||||||
} catch (err) {
|
|
||||||
_iterator15.e(err);
|
|
||||||
} finally {
|
|
||||||
_iterator15.f();
|
|
||||||
}
|
|
||||||
for (var _i5 = 0, _Object$keys = Object.keys(config); _i5 < _Object$keys.length; _i5++) {
|
for (var _i5 = 0, _Object$keys = Object.keys(config); _i5 < _Object$keys.length; _i5++) {
|
||||||
var key = _Object$keys[_i5];
|
var key = _Object$keys[_i5];
|
||||||
var value = config[key];
|
var value = config[key];
|
||||||
|
@ -2144,17 +2134,17 @@ function getEffectiveConfig(ruleList, config, aliasToRuleNames) {
|
||||||
value = false;
|
value = false;
|
||||||
}
|
}
|
||||||
var keyUpper = key.toUpperCase();
|
var keyUpper = key.toUpperCase();
|
||||||
var _iterator16 = _createForOfIteratorHelper(aliasToRuleNames[keyUpper] || []),
|
var _iterator15 = _createForOfIteratorHelper(aliasToRuleNames[keyUpper] || []),
|
||||||
_step16;
|
_step15;
|
||||||
try {
|
try {
|
||||||
for (_iterator16.s(); !(_step16 = _iterator16.n()).done;) {
|
for (_iterator15.s(); !(_step15 = _iterator15.n()).done;) {
|
||||||
var ruleName = _step16.value;
|
var ruleName = _step15.value;
|
||||||
effectiveConfig[ruleName] = value;
|
effectiveConfig[ruleName] = value;
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
_iterator16.e(err);
|
_iterator15.e(err);
|
||||||
} finally {
|
} finally {
|
||||||
_iterator16.f();
|
_iterator15.f();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return effectiveConfig;
|
return effectiveConfig;
|
||||||
|
@ -2215,13 +2205,13 @@ function getEnabledRulesPerLineNumber(ruleList, lines, frontMatterLines, noInlin
|
||||||
// Helper functions
|
// Helper functions
|
||||||
// eslint-disable-next-line jsdoc/require-jsdoc
|
// eslint-disable-next-line jsdoc/require-jsdoc
|
||||||
function handleInlineConfig(input, forEachMatch, forEachLine) {
|
function handleInlineConfig(input, forEachMatch, forEachLine) {
|
||||||
var _iterator17 = _createForOfIteratorHelper(input.entries()),
|
var _iterator16 = _createForOfIteratorHelper(input.entries()),
|
||||||
_step17;
|
_step16;
|
||||||
try {
|
try {
|
||||||
for (_iterator17.s(); !(_step17 = _iterator17.n()).done;) {
|
for (_iterator16.s(); !(_step16 = _iterator16.n()).done;) {
|
||||||
var _step17$value = _slicedToArray(_step17.value, 2),
|
var _step16$value = _slicedToArray(_step16.value, 2),
|
||||||
lineIndex = _step17$value[0],
|
lineIndex = _step16$value[0],
|
||||||
line = _step17$value[1];
|
line = _step16$value[1];
|
||||||
if (!noInlineConfig) {
|
if (!noInlineConfig) {
|
||||||
var match = null;
|
var match = null;
|
||||||
while (match = helpers.inlineCommentStartRe.exec(line)) {
|
while (match = helpers.inlineCommentStartRe.exec(line)) {
|
||||||
|
@ -2240,9 +2230,9 @@ function getEnabledRulesPerLineNumber(ruleList, lines, frontMatterLines, noInlin
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
_iterator17.e(err);
|
_iterator16.e(err);
|
||||||
} finally {
|
} finally {
|
||||||
_iterator17.f();
|
_iterator16.f();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// eslint-disable-next-line jsdoc/require-jsdoc
|
// eslint-disable-next-line jsdoc/require-jsdoc
|
||||||
|
@ -2261,29 +2251,29 @@ function getEnabledRulesPerLineNumber(ruleList, lines, frontMatterLines, noInlin
|
||||||
var enabled = action.startsWith("ENABLE");
|
var enabled = action.startsWith("ENABLE");
|
||||||
var trimmed = parameter && parameter.trim();
|
var trimmed = parameter && parameter.trim();
|
||||||
var items = trimmed ? trimmed.toUpperCase().split(/\s+/) : allRuleNames;
|
var items = trimmed ? trimmed.toUpperCase().split(/\s+/) : allRuleNames;
|
||||||
var _iterator18 = _createForOfIteratorHelper(items),
|
var _iterator17 = _createForOfIteratorHelper(items),
|
||||||
|
_step17;
|
||||||
|
try {
|
||||||
|
for (_iterator17.s(); !(_step17 = _iterator17.n()).done;) {
|
||||||
|
var nameUpper = _step17.value;
|
||||||
|
var _iterator18 = _createForOfIteratorHelper(aliasToRuleNames[nameUpper] || []),
|
||||||
_step18;
|
_step18;
|
||||||
try {
|
try {
|
||||||
for (_iterator18.s(); !(_step18 = _iterator18.n()).done;) {
|
for (_iterator18.s(); !(_step18 = _iterator18.n()).done;) {
|
||||||
var nameUpper = _step18.value;
|
var ruleName = _step18.value;
|
||||||
var _iterator19 = _createForOfIteratorHelper(aliasToRuleNames[nameUpper] || []),
|
|
||||||
_step19;
|
|
||||||
try {
|
|
||||||
for (_iterator19.s(); !(_step19 = _iterator19.n()).done;) {
|
|
||||||
var ruleName = _step19.value;
|
|
||||||
state[ruleName] = enabled;
|
state[ruleName] = enabled;
|
||||||
}
|
}
|
||||||
} catch (err) {
|
|
||||||
_iterator19.e(err);
|
|
||||||
} finally {
|
|
||||||
_iterator19.f();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
_iterator18.e(err);
|
_iterator18.e(err);
|
||||||
} finally {
|
} finally {
|
||||||
_iterator18.f();
|
_iterator18.f();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
_iterator17.e(err);
|
||||||
|
} finally {
|
||||||
|
_iterator17.f();
|
||||||
|
}
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
// eslint-disable-next-line jsdoc/require-jsdoc
|
// eslint-disable-next-line jsdoc/require-jsdoc
|
||||||
|
@ -2318,19 +2308,19 @@ function getEnabledRulesPerLineNumber(ruleList, lines, frontMatterLines, noInlin
|
||||||
// Handle inline comments
|
// Handle inline comments
|
||||||
handleInlineConfig([lines.join("\n")], configureFile);
|
handleInlineConfig([lines.join("\n")], configureFile);
|
||||||
var effectiveConfig = getEffectiveConfig(ruleList, config, aliasToRuleNames);
|
var effectiveConfig = getEffectiveConfig(ruleList, config, aliasToRuleNames);
|
||||||
var _iterator20 = _createForOfIteratorHelper(ruleList),
|
var _iterator19 = _createForOfIteratorHelper(ruleList),
|
||||||
_step20;
|
_step19;
|
||||||
try {
|
try {
|
||||||
for (_iterator20.s(); !(_step20 = _iterator20.n()).done;) {
|
for (_iterator19.s(); !(_step19 = _iterator19.n()).done;) {
|
||||||
var rule = _step20.value;
|
var rule = _step19.value;
|
||||||
var ruleName = rule.names[0].toUpperCase();
|
var ruleName = rule.names[0].toUpperCase();
|
||||||
allRuleNames.push(ruleName);
|
allRuleNames.push(ruleName);
|
||||||
enabledRules[ruleName] = !!effectiveConfig[ruleName];
|
enabledRules[ruleName] = !!effectiveConfig[ruleName];
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
_iterator20.e(err);
|
_iterator19.e(err);
|
||||||
} finally {
|
} finally {
|
||||||
_iterator20.f();
|
_iterator19.f();
|
||||||
}
|
}
|
||||||
capturedRules = enabledRules;
|
capturedRules = enabledRules;
|
||||||
handleInlineConfig(lines, enableDisableFile);
|
handleInlineConfig(lines, enableDisableFile);
|
||||||
|
@ -2533,51 +2523,51 @@ function lintContent(ruleList, aliasToRuleNames, name, content, md, config, conf
|
||||||
if (resultVersion === 0) {
|
if (resultVersion === 0) {
|
||||||
// Return a dictionary of rule->[line numbers]
|
// Return a dictionary of rule->[line numbers]
|
||||||
var dictionary = {};
|
var dictionary = {};
|
||||||
var _iterator21 = _createForOfIteratorHelper(results),
|
var _iterator20 = _createForOfIteratorHelper(results),
|
||||||
_step21;
|
_step20;
|
||||||
try {
|
try {
|
||||||
for (_iterator21.s(); !(_step21 = _iterator21.n()).done;) {
|
for (_iterator20.s(); !(_step20 = _iterator20.n()).done;) {
|
||||||
var error = _step21.value;
|
var error = _step20.value;
|
||||||
var ruleLines = dictionary[error.ruleName] || [];
|
var ruleLines = dictionary[error.ruleName] || [];
|
||||||
ruleLines.push(error.lineNumber);
|
ruleLines.push(error.lineNumber);
|
||||||
dictionary[error.ruleName] = ruleLines;
|
dictionary[error.ruleName] = ruleLines;
|
||||||
}
|
}
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
_iterator21.e(err);
|
_iterator20.e(err);
|
||||||
} finally {
|
} finally {
|
||||||
_iterator21.f();
|
_iterator20.f();
|
||||||
}
|
}
|
||||||
results = dictionary;
|
results = dictionary;
|
||||||
} else if (resultVersion === 1) {
|
} else if (resultVersion === 1) {
|
||||||
// Use ruleAlias instead of ruleNames
|
// Use ruleAlias instead of ruleNames
|
||||||
|
var _iterator21 = _createForOfIteratorHelper(results),
|
||||||
|
_step21;
|
||||||
|
try {
|
||||||
|
for (_iterator21.s(); !(_step21 = _iterator21.n()).done;) {
|
||||||
|
var _error = _step21.value;
|
||||||
|
_error.ruleAlias = _error.ruleNames[1] || _error.ruleName;
|
||||||
|
delete _error.ruleNames;
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
_iterator21.e(err);
|
||||||
|
} finally {
|
||||||
|
_iterator21.f();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// resultVersion 2 or 3: Remove unwanted ruleName
|
||||||
var _iterator22 = _createForOfIteratorHelper(results),
|
var _iterator22 = _createForOfIteratorHelper(results),
|
||||||
_step22;
|
_step22;
|
||||||
try {
|
try {
|
||||||
for (_iterator22.s(); !(_step22 = _iterator22.n()).done;) {
|
for (_iterator22.s(); !(_step22 = _iterator22.n()).done;) {
|
||||||
var _error = _step22.value;
|
var _error2 = _step22.value;
|
||||||
_error.ruleAlias = _error.ruleNames[1] || _error.ruleName;
|
delete _error2.ruleName;
|
||||||
delete _error.ruleNames;
|
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
_iterator22.e(err);
|
_iterator22.e(err);
|
||||||
} finally {
|
} finally {
|
||||||
_iterator22.f();
|
_iterator22.f();
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
// resultVersion 2 or 3: Remove unwanted ruleName
|
|
||||||
var _iterator23 = _createForOfIteratorHelper(results),
|
|
||||||
_step23;
|
|
||||||
try {
|
|
||||||
for (_iterator23.s(); !(_step23 = _iterator23.n()).done;) {
|
|
||||||
var _error2 = _step23.value;
|
|
||||||
delete _error2.ruleName;
|
|
||||||
}
|
|
||||||
} catch (err) {
|
|
||||||
_iterator23.e(err);
|
|
||||||
} finally {
|
|
||||||
_iterator23.f();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
@ -2693,18 +2683,18 @@ function lintInput(options, synchronous, callback) {
|
||||||
"html": true
|
"html": true
|
||||||
});
|
});
|
||||||
var markdownItPlugins = options.markdownItPlugins || [];
|
var markdownItPlugins = options.markdownItPlugins || [];
|
||||||
var _iterator24 = _createForOfIteratorHelper(markdownItPlugins),
|
var _iterator23 = _createForOfIteratorHelper(markdownItPlugins),
|
||||||
_step24;
|
_step23;
|
||||||
try {
|
try {
|
||||||
for (_iterator24.s(); !(_step24 = _iterator24.n()).done;) {
|
for (_iterator23.s(); !(_step23 = _iterator23.n()).done;) {
|
||||||
var plugin = _step24.value;
|
var plugin = _step23.value;
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
md.use.apply(md, _toConsumableArray(plugin));
|
md.use.apply(md, _toConsumableArray(plugin));
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
_iterator24.e(err);
|
_iterator23.e(err);
|
||||||
} finally {
|
} finally {
|
||||||
_iterator24.f();
|
_iterator23.f();
|
||||||
}
|
}
|
||||||
var fs = options.fs || __webpack_require__(/*! node:fs */ "?d0ee");
|
var fs = options.fs || __webpack_require__(/*! node:fs */ "?d0ee");
|
||||||
var aliasToRuleNames = mapAliasToRuleNames(ruleList);
|
var aliasToRuleNames = mapAliasToRuleNames(ruleList);
|
||||||
|
@ -3264,38 +3254,6 @@ module.exports = {
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ "../lib/md002.js":
|
|
||||||
/*!***********************!*\
|
|
||||||
!*** ../lib/md002.js ***!
|
|
||||||
\***********************/
|
|
||||||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
||||||
|
|
||||||
"use strict";
|
|
||||||
// @ts-check
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var _require = __webpack_require__(/*! ../helpers */ "../helpers/helpers.js"),
|
|
||||||
addErrorDetailIf = _require.addErrorDetailIf;
|
|
||||||
module.exports = {
|
|
||||||
"names": ["MD002", "first-heading-h1", "first-header-h1"],
|
|
||||||
"description": "First heading should be a top-level heading",
|
|
||||||
"tags": ["headings", "headers"],
|
|
||||||
"function": function MD002(params, onError) {
|
|
||||||
var level = Number(params.config.level || 1);
|
|
||||||
var tag = "h" + level;
|
|
||||||
params.parsers.markdownit.tokens.every(function forToken(token) {
|
|
||||||
if (token.type === "heading_open") {
|
|
||||||
addErrorDetailIf(onError, token.lineNumber, tag, token.tag);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "../lib/md003.js":
|
/***/ "../lib/md003.js":
|
||||||
/*!***********************!*\
|
/*!***********************!*\
|
||||||
!*** ../lib/md003.js ***!
|
!*** ../lib/md003.js ***!
|
||||||
|
@ -3525,65 +3483,6 @@ module.exports = {
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ "../lib/md006.js":
|
|
||||||
/*!***********************!*\
|
|
||||||
!*** ../lib/md006.js ***!
|
|
||||||
\***********************/
|
|
||||||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
||||||
|
|
||||||
"use strict";
|
|
||||||
// @ts-check
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
||||||
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
||||||
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
||||||
var _require = __webpack_require__(/*! ../helpers */ "../helpers/helpers.js"),
|
|
||||||
addErrorDetailIf = _require.addErrorDetailIf,
|
|
||||||
listItemMarkerRe = _require.listItemMarkerRe,
|
|
||||||
rangeFromRegExp = _require.rangeFromRegExp;
|
|
||||||
var _require2 = __webpack_require__(/*! ./cache */ "../lib/cache.js"),
|
|
||||||
flattenedLists = _require2.flattenedLists;
|
|
||||||
module.exports = {
|
|
||||||
"names": ["MD006", "ul-start-left"],
|
|
||||||
"description": "Consider starting bulleted lists at the beginning of the line",
|
|
||||||
"tags": ["bullet", "ul", "indentation"],
|
|
||||||
"function": function MD006(params, onError) {
|
|
||||||
var _iterator = _createForOfIteratorHelper(flattenedLists()),
|
|
||||||
_step;
|
|
||||||
try {
|
|
||||||
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
||||||
var list = _step.value;
|
|
||||||
if (list.unordered && !list.nesting && list.indent !== 0) {
|
|
||||||
var _iterator2 = _createForOfIteratorHelper(list.items),
|
|
||||||
_step2;
|
|
||||||
try {
|
|
||||||
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
||||||
var item = _step2.value;
|
|
||||||
var lineNumber = item.lineNumber,
|
|
||||||
line = item.line;
|
|
||||||
addErrorDetailIf(onError, lineNumber, 0, list.indent, null, null, rangeFromRegExp(line, listItemMarkerRe), {
|
|
||||||
"deleteCount": line.length - line.trimStart().length
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} catch (err) {
|
|
||||||
_iterator2.e(err);
|
|
||||||
} finally {
|
|
||||||
_iterator2.f();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (err) {
|
|
||||||
_iterator.e(err);
|
|
||||||
} finally {
|
|
||||||
_iterator.f();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "../lib/md007.js":
|
/***/ "../lib/md007.js":
|
||||||
/*!***********************!*\
|
/*!***********************!*\
|
||||||
!*** ../lib/md007.js ***!
|
!*** ../lib/md007.js ***!
|
||||||
|
@ -6840,7 +6739,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
||||||
var _require = __webpack_require__(/*! ./constants */ "../lib/constants.js"),
|
var _require = __webpack_require__(/*! ./constants */ "../lib/constants.js"),
|
||||||
homepage = _require.homepage,
|
homepage = _require.homepage,
|
||||||
version = _require.version;
|
version = _require.version;
|
||||||
var rules = [__webpack_require__(/*! ./md001 */ "../lib/md001.js"), __webpack_require__(/*! ./md002 */ "../lib/md002.js"), __webpack_require__(/*! ./md003 */ "../lib/md003.js"), __webpack_require__(/*! ./md004 */ "../lib/md004.js"), __webpack_require__(/*! ./md005 */ "../lib/md005.js"), __webpack_require__(/*! ./md006 */ "../lib/md006.js"), __webpack_require__(/*! ./md007 */ "../lib/md007.js"), __webpack_require__(/*! ./md009 */ "../lib/md009.js"), __webpack_require__(/*! ./md010 */ "../lib/md010.js"), __webpack_require__(/*! ./md011 */ "../lib/md011.js"), __webpack_require__(/*! ./md012 */ "../lib/md012.js"), __webpack_require__(/*! ./md013 */ "../lib/md013.js"), __webpack_require__(/*! ./md014 */ "../lib/md014.js"), __webpack_require__(/*! ./md018 */ "../lib/md018.js"), __webpack_require__(/*! ./md019 */ "../lib/md019.js"), __webpack_require__(/*! ./md020 */ "../lib/md020.js"), __webpack_require__(/*! ./md021 */ "../lib/md021.js"), __webpack_require__(/*! ./md022 */ "../lib/md022.js"), __webpack_require__(/*! ./md023 */ "../lib/md023.js"), __webpack_require__(/*! ./md024 */ "../lib/md024.js"), __webpack_require__(/*! ./md025 */ "../lib/md025.js"), __webpack_require__(/*! ./md026 */ "../lib/md026.js"), __webpack_require__(/*! ./md027 */ "../lib/md027.js"), __webpack_require__(/*! ./md028 */ "../lib/md028.js"), __webpack_require__(/*! ./md029 */ "../lib/md029.js"), __webpack_require__(/*! ./md030 */ "../lib/md030.js"), __webpack_require__(/*! ./md031 */ "../lib/md031.js"), __webpack_require__(/*! ./md032 */ "../lib/md032.js"), __webpack_require__(/*! ./md033 */ "../lib/md033.js"), __webpack_require__(/*! ./md034 */ "../lib/md034.js"), __webpack_require__(/*! ./md035 */ "../lib/md035.js"), __webpack_require__(/*! ./md036 */ "../lib/md036.js"), __webpack_require__(/*! ./md037 */ "../lib/md037.js"), __webpack_require__(/*! ./md038 */ "../lib/md038.js"), __webpack_require__(/*! ./md039 */ "../lib/md039.js"), __webpack_require__(/*! ./md040 */ "../lib/md040.js"), __webpack_require__(/*! ./md041 */ "../lib/md041.js"), __webpack_require__(/*! ./md042 */ "../lib/md042.js"), __webpack_require__(/*! ./md043 */ "../lib/md043.js"), __webpack_require__(/*! ./md044 */ "../lib/md044.js"), __webpack_require__(/*! ./md045 */ "../lib/md045.js"), __webpack_require__(/*! ./md046 */ "../lib/md046.js"), __webpack_require__(/*! ./md047 */ "../lib/md047.js"), __webpack_require__(/*! ./md048 */ "../lib/md048.js")].concat(_toConsumableArray(__webpack_require__(/*! ./md049-md050 */ "../lib/md049-md050.js")), [__webpack_require__(/*! ./md051 */ "../lib/md051.js"), __webpack_require__(/*! ./md052 */ "../lib/md052.js"), __webpack_require__(/*! ./md053 */ "../lib/md053.js"), __webpack_require__(/*! ./md054 */ "../lib/md054.js")
|
var rules = [__webpack_require__(/*! ./md001 */ "../lib/md001.js"), __webpack_require__(/*! ./md003 */ "../lib/md003.js"), __webpack_require__(/*! ./md004 */ "../lib/md004.js"), __webpack_require__(/*! ./md005 */ "../lib/md005.js"), __webpack_require__(/*! ./md007 */ "../lib/md007.js"), __webpack_require__(/*! ./md009 */ "../lib/md009.js"), __webpack_require__(/*! ./md010 */ "../lib/md010.js"), __webpack_require__(/*! ./md011 */ "../lib/md011.js"), __webpack_require__(/*! ./md012 */ "../lib/md012.js"), __webpack_require__(/*! ./md013 */ "../lib/md013.js"), __webpack_require__(/*! ./md014 */ "../lib/md014.js"), __webpack_require__(/*! ./md018 */ "../lib/md018.js"), __webpack_require__(/*! ./md019 */ "../lib/md019.js"), __webpack_require__(/*! ./md020 */ "../lib/md020.js"), __webpack_require__(/*! ./md021 */ "../lib/md021.js"), __webpack_require__(/*! ./md022 */ "../lib/md022.js"), __webpack_require__(/*! ./md023 */ "../lib/md023.js"), __webpack_require__(/*! ./md024 */ "../lib/md024.js"), __webpack_require__(/*! ./md025 */ "../lib/md025.js"), __webpack_require__(/*! ./md026 */ "../lib/md026.js"), __webpack_require__(/*! ./md027 */ "../lib/md027.js"), __webpack_require__(/*! ./md028 */ "../lib/md028.js"), __webpack_require__(/*! ./md029 */ "../lib/md029.js"), __webpack_require__(/*! ./md030 */ "../lib/md030.js"), __webpack_require__(/*! ./md031 */ "../lib/md031.js"), __webpack_require__(/*! ./md032 */ "../lib/md032.js"), __webpack_require__(/*! ./md033 */ "../lib/md033.js"), __webpack_require__(/*! ./md034 */ "../lib/md034.js"), __webpack_require__(/*! ./md035 */ "../lib/md035.js"), __webpack_require__(/*! ./md036 */ "../lib/md036.js"), __webpack_require__(/*! ./md037 */ "../lib/md037.js"), __webpack_require__(/*! ./md038 */ "../lib/md038.js"), __webpack_require__(/*! ./md039 */ "../lib/md039.js"), __webpack_require__(/*! ./md040 */ "../lib/md040.js"), __webpack_require__(/*! ./md041 */ "../lib/md041.js"), __webpack_require__(/*! ./md042 */ "../lib/md042.js"), __webpack_require__(/*! ./md043 */ "../lib/md043.js"), __webpack_require__(/*! ./md044 */ "../lib/md044.js"), __webpack_require__(/*! ./md045 */ "../lib/md045.js"), __webpack_require__(/*! ./md046 */ "../lib/md046.js"), __webpack_require__(/*! ./md047 */ "../lib/md047.js"), __webpack_require__(/*! ./md048 */ "../lib/md048.js")].concat(_toConsumableArray(__webpack_require__(/*! ./md049-md050 */ "../lib/md049-md050.js")), [__webpack_require__(/*! ./md051 */ "../lib/md051.js"), __webpack_require__(/*! ./md052 */ "../lib/md052.js"), __webpack_require__(/*! ./md053 */ "../lib/md053.js"), __webpack_require__(/*! ./md054 */ "../lib/md054.js")
|
||||||
// md055: See https://github.com/markdownlint/markdownlint
|
// md055: See https://github.com/markdownlint/markdownlint
|
||||||
// md056: See https://github.com/markdownlint/markdownlint
|
// md056: See https://github.com/markdownlint/markdownlint
|
||||||
// md057: See https://github.com/markdownlint/markdownlint
|
// md057: See https://github.com/markdownlint/markdownlint
|
||||||
|
|
|
@ -2,5 +2,4 @@
|
||||||
|
|
||||||
This document contains a description of all rules, what they are checking for,
|
This document contains a description of all rules, what they are checking for,
|
||||||
as well as examples of documents that break the rule and corrected
|
as well as examples of documents that break the rule and corrected
|
||||||
versions of the examples. Any rule whose heading is ~~struck through~~ is
|
versions of the examples.
|
||||||
deprecated, but still provided for backward-compatibility.
|
|
||||||
|
|
|
@ -1,25 +0,0 @@
|
||||||
> Note: *MD002 has been deprecated and is disabled by default.*
|
|
||||||
> [MD041/first-line-heading](md041.md) offers an improved implementation.
|
|
||||||
|
|
||||||
This rule is intended to ensure document headings start at the top level and
|
|
||||||
is triggered when the first heading in the document isn't an h1 heading:
|
|
||||||
|
|
||||||
```markdown
|
|
||||||
## This isn't an H1 heading
|
|
||||||
|
|
||||||
### Another heading
|
|
||||||
```
|
|
||||||
|
|
||||||
The first heading in the document should be an h1 heading:
|
|
||||||
|
|
||||||
```markdown
|
|
||||||
# Start with an H1 heading
|
|
||||||
|
|
||||||
## Then use an H2 for subsections
|
|
||||||
```
|
|
||||||
|
|
||||||
Note: The `level` parameter can be used to change the top-level (ex: to h2) in
|
|
||||||
cases where an h1 is added externally.
|
|
||||||
|
|
||||||
Rationale: The top-level heading often acts as the title of a document. More
|
|
||||||
information: <https://cirosantilli.com/markdown-style-guide#top-level-header>.
|
|
|
@ -1,36 +0,0 @@
|
||||||
This rule is triggered when top-level lists don't start at the beginning of a
|
|
||||||
line:
|
|
||||||
|
|
||||||
```markdown
|
|
||||||
Some text
|
|
||||||
|
|
||||||
* List item
|
|
||||||
* List item
|
|
||||||
```
|
|
||||||
|
|
||||||
To fix, ensure that top-level list items are not indented:
|
|
||||||
|
|
||||||
```markdown
|
|
||||||
Some test
|
|
||||||
|
|
||||||
* List item
|
|
||||||
* List item
|
|
||||||
```
|
|
||||||
|
|
||||||
Note: This rule is triggered for the following scenario because the unordered
|
|
||||||
sublist is not recognized as such by the parser. Not being nested 3 characters
|
|
||||||
as required by the outer ordered list, it creates a top-level unordered list
|
|
||||||
instead.
|
|
||||||
|
|
||||||
```markdown
|
|
||||||
1. List item
|
|
||||||
- List item
|
|
||||||
- List item
|
|
||||||
1. List item
|
|
||||||
```
|
|
||||||
|
|
||||||
Rationale: Starting lists at the beginning of the line means that nested list
|
|
||||||
items can all be indented by the same amount when an editor's indent function
|
|
||||||
or the tab key is used to indent. Starting a list 1 space in means that the
|
|
||||||
indent of the first nested list is less than the indent of the second level (3
|
|
||||||
characters if you use 4 space tabs, or 1 character if you use 2 space tabs).
|
|
|
@ -20,10 +20,9 @@ unordered (otherwise, extra indentation of ordered lists interferes with the
|
||||||
rule).
|
rule).
|
||||||
|
|
||||||
The `start_indented` parameter allows the first level of lists to be indented by
|
The `start_indented` parameter allows the first level of lists to be indented by
|
||||||
the configured number of spaces rather than starting at zero (the inverse of
|
the configured number of spaces rather than starting at zero. The `start_indent`
|
||||||
MD006). The `start_indent` parameter allows the first level of lists to be
|
parameter allows the first level of lists to be indented by a different number
|
||||||
indented by a different number of spaces than the rest (ignored when
|
of spaces than the rest (ignored when `start_indented` is not set).
|
||||||
`start_indented` is not set).
|
|
||||||
|
|
||||||
Rationale: Indenting by 2 spaces allows the content of a nested list to be in
|
Rationale: Indenting by 2 spaces allows the content of a nested list to be in
|
||||||
line with the start of the content of the parent list when a single space is
|
line with the start of the content of the parent list when a single space is
|
||||||
|
|
99
doc/Rules.md
99
doc/Rules.md
|
@ -2,8 +2,7 @@
|
||||||
|
|
||||||
This document contains a description of all rules, what they are checking for,
|
This document contains a description of all rules, what they are checking for,
|
||||||
as well as examples of documents that break the rule and corrected
|
as well as examples of documents that break the rule and corrected
|
||||||
versions of the examples. Any rule whose heading is ~~struck through~~ is
|
versions of the examples.
|
||||||
deprecated, but still provided for backward-compatibility.
|
|
||||||
|
|
||||||
<a name="md001"></a>
|
<a name="md001"></a>
|
||||||
|
|
||||||
|
@ -45,46 +44,6 @@ Rationale: Headings represent the structure of a document and can be confusing
|
||||||
when skipped - especially for accessibility scenarios. More information:
|
when skipped - especially for accessibility scenarios. More information:
|
||||||
<https://www.w3.org/WAI/tutorials/page-structure/headings/>.
|
<https://www.w3.org/WAI/tutorials/page-structure/headings/>.
|
||||||
|
|
||||||
<a name="md002"></a>
|
|
||||||
|
|
||||||
## ~~`MD002` - First heading should be a top-level heading~~
|
|
||||||
|
|
||||||
> This rule is deprecated and provided for backward-compatibility
|
|
||||||
|
|
||||||
Tags: `headers`, `headings`
|
|
||||||
|
|
||||||
Aliases: `first-header-h1`, `first-heading-h1`
|
|
||||||
|
|
||||||
Parameters:
|
|
||||||
|
|
||||||
- `level`: Heading level (`integer`, default `1`)
|
|
||||||
|
|
||||||
> Note: *MD002 has been deprecated and is disabled by default.*
|
|
||||||
> [MD041/first-line-heading](md041.md) offers an improved implementation.
|
|
||||||
|
|
||||||
This rule is intended to ensure document headings start at the top level and
|
|
||||||
is triggered when the first heading in the document isn't an h1 heading:
|
|
||||||
|
|
||||||
```markdown
|
|
||||||
## This isn't an H1 heading
|
|
||||||
|
|
||||||
### Another heading
|
|
||||||
```
|
|
||||||
|
|
||||||
The first heading in the document should be an h1 heading:
|
|
||||||
|
|
||||||
```markdown
|
|
||||||
# Start with an H1 heading
|
|
||||||
|
|
||||||
## Then use an H2 for subsections
|
|
||||||
```
|
|
||||||
|
|
||||||
Note: The `level` parameter can be used to change the top-level (ex: to h2) in
|
|
||||||
cases where an h1 is added externally.
|
|
||||||
|
|
||||||
Rationale: The top-level heading often acts as the title of a document. More
|
|
||||||
information: <https://cirosantilli.com/markdown-style-guide#top-level-header>.
|
|
||||||
|
|
||||||
<a name="md003"></a>
|
<a name="md003"></a>
|
||||||
|
|
||||||
## `MD003` - Heading style
|
## `MD003` - Heading style
|
||||||
|
@ -255,55 +214,6 @@ the same ending column:
|
||||||
|
|
||||||
Rationale: Violations of this rule can lead to improperly rendered content.
|
Rationale: Violations of this rule can lead to improperly rendered content.
|
||||||
|
|
||||||
<a name="md006"></a>
|
|
||||||
|
|
||||||
## ~~`MD006` - Consider starting bulleted lists at the beginning of the line~~
|
|
||||||
|
|
||||||
> This rule is deprecated and provided for backward-compatibility
|
|
||||||
|
|
||||||
Tags: `bullet`, `indentation`, `ul`
|
|
||||||
|
|
||||||
Aliases: `ul-start-left`
|
|
||||||
|
|
||||||
Fixable: Some violations can be fixed by tooling
|
|
||||||
|
|
||||||
This rule is triggered when top-level lists don't start at the beginning of a
|
|
||||||
line:
|
|
||||||
|
|
||||||
```markdown
|
|
||||||
Some text
|
|
||||||
|
|
||||||
* List item
|
|
||||||
* List item
|
|
||||||
```
|
|
||||||
|
|
||||||
To fix, ensure that top-level list items are not indented:
|
|
||||||
|
|
||||||
```markdown
|
|
||||||
Some test
|
|
||||||
|
|
||||||
* List item
|
|
||||||
* List item
|
|
||||||
```
|
|
||||||
|
|
||||||
Note: This rule is triggered for the following scenario because the unordered
|
|
||||||
sublist is not recognized as such by the parser. Not being nested 3 characters
|
|
||||||
as required by the outer ordered list, it creates a top-level unordered list
|
|
||||||
instead.
|
|
||||||
|
|
||||||
```markdown
|
|
||||||
1. List item
|
|
||||||
- List item
|
|
||||||
- List item
|
|
||||||
1. List item
|
|
||||||
```
|
|
||||||
|
|
||||||
Rationale: Starting lists at the beginning of the line means that nested list
|
|
||||||
items can all be indented by the same amount when an editor's indent function
|
|
||||||
or the tab key is used to indent. Starting a list 1 space in means that the
|
|
||||||
indent of the first nested list is less than the indent of the second level (3
|
|
||||||
characters if you use 4 space tabs, or 1 character if you use 2 space tabs).
|
|
||||||
|
|
||||||
<a name="md007"></a>
|
<a name="md007"></a>
|
||||||
|
|
||||||
## `MD007` - Unordered list indentation
|
## `MD007` - Unordered list indentation
|
||||||
|
@ -344,10 +254,9 @@ unordered (otherwise, extra indentation of ordered lists interferes with the
|
||||||
rule).
|
rule).
|
||||||
|
|
||||||
The `start_indented` parameter allows the first level of lists to be indented by
|
The `start_indented` parameter allows the first level of lists to be indented by
|
||||||
the configured number of spaces rather than starting at zero (the inverse of
|
the configured number of spaces rather than starting at zero. The `start_indent`
|
||||||
MD006). The `start_indent` parameter allows the first level of lists to be
|
parameter allows the first level of lists to be indented by a different number
|
||||||
indented by a different number of spaces than the rest (ignored when
|
of spaces than the rest (ignored when `start_indented` is not set).
|
||||||
`start_indented` is not set).
|
|
||||||
|
|
||||||
Rationale: Indenting by 2 spaces allows the content of a nested list to be in
|
Rationale: Indenting by 2 spaces allows the content of a nested list to be in
|
||||||
line with the start of the content of the parent list when a single space is
|
line with the start of the content of the parent list when a single space is
|
||||||
|
|
37
doc/md002.md
37
doc/md002.md
|
@ -1,37 +0,0 @@
|
||||||
# ~~`MD002` - First heading should be a top-level heading~~
|
|
||||||
|
|
||||||
> This rule is deprecated and provided for backward-compatibility
|
|
||||||
|
|
||||||
Tags: `headers`, `headings`
|
|
||||||
|
|
||||||
Aliases: `first-header-h1`, `first-heading-h1`
|
|
||||||
|
|
||||||
Parameters:
|
|
||||||
|
|
||||||
- `level`: Heading level (`integer`, default `1`)
|
|
||||||
|
|
||||||
> Note: *MD002 has been deprecated and is disabled by default.*
|
|
||||||
> [MD041/first-line-heading](md041.md) offers an improved implementation.
|
|
||||||
|
|
||||||
This rule is intended to ensure document headings start at the top level and
|
|
||||||
is triggered when the first heading in the document isn't an h1 heading:
|
|
||||||
|
|
||||||
```markdown
|
|
||||||
## This isn't an H1 heading
|
|
||||||
|
|
||||||
### Another heading
|
|
||||||
```
|
|
||||||
|
|
||||||
The first heading in the document should be an h1 heading:
|
|
||||||
|
|
||||||
```markdown
|
|
||||||
# Start with an H1 heading
|
|
||||||
|
|
||||||
## Then use an H2 for subsections
|
|
||||||
```
|
|
||||||
|
|
||||||
Note: The `level` parameter can be used to change the top-level (ex: to h2) in
|
|
||||||
cases where an h1 is added externally.
|
|
||||||
|
|
||||||
Rationale: The top-level heading often acts as the title of a document. More
|
|
||||||
information: <https://cirosantilli.com/markdown-style-guide#top-level-header>.
|
|
46
doc/md006.md
46
doc/md006.md
|
@ -1,46 +0,0 @@
|
||||||
# ~~`MD006` - Consider starting bulleted lists at the beginning of the line~~
|
|
||||||
|
|
||||||
> This rule is deprecated and provided for backward-compatibility
|
|
||||||
|
|
||||||
Tags: `bullet`, `indentation`, `ul`
|
|
||||||
|
|
||||||
Aliases: `ul-start-left`
|
|
||||||
|
|
||||||
Fixable: Some violations can be fixed by tooling
|
|
||||||
|
|
||||||
This rule is triggered when top-level lists don't start at the beginning of a
|
|
||||||
line:
|
|
||||||
|
|
||||||
```markdown
|
|
||||||
Some text
|
|
||||||
|
|
||||||
* List item
|
|
||||||
* List item
|
|
||||||
```
|
|
||||||
|
|
||||||
To fix, ensure that top-level list items are not indented:
|
|
||||||
|
|
||||||
```markdown
|
|
||||||
Some test
|
|
||||||
|
|
||||||
* List item
|
|
||||||
* List item
|
|
||||||
```
|
|
||||||
|
|
||||||
Note: This rule is triggered for the following scenario because the unordered
|
|
||||||
sublist is not recognized as such by the parser. Not being nested 3 characters
|
|
||||||
as required by the outer ordered list, it creates a top-level unordered list
|
|
||||||
instead.
|
|
||||||
|
|
||||||
```markdown
|
|
||||||
1. List item
|
|
||||||
- List item
|
|
||||||
- List item
|
|
||||||
1. List item
|
|
||||||
```
|
|
||||||
|
|
||||||
Rationale: Starting lists at the beginning of the line means that nested list
|
|
||||||
items can all be indented by the same amount when an editor's indent function
|
|
||||||
or the tab key is used to indent. Starting a list 1 space in means that the
|
|
||||||
indent of the first nested list is less than the indent of the second level (3
|
|
||||||
characters if you use 4 space tabs, or 1 character if you use 2 space tabs).
|
|
|
@ -36,10 +36,9 @@ unordered (otherwise, extra indentation of ordered lists interferes with the
|
||||||
rule).
|
rule).
|
||||||
|
|
||||||
The `start_indented` parameter allows the first level of lists to be indented by
|
The `start_indented` parameter allows the first level of lists to be indented by
|
||||||
the configured number of spaces rather than starting at zero (the inverse of
|
the configured number of spaces rather than starting at zero. The `start_indent`
|
||||||
MD006). The `start_indent` parameter allows the first level of lists to be
|
parameter allows the first level of lists to be indented by a different number
|
||||||
indented by a different number of spaces than the rest (ignored when
|
of spaces than the rest (ignored when `start_indented` is not set).
|
||||||
`start_indented` is not set).
|
|
||||||
|
|
||||||
Rationale: Indenting by 2 spaces allows the content of a nested list to be in
|
Rationale: Indenting by 2 spaces allows the content of a nested list to be in
|
||||||
line with the start of the content of the parent list when a single space is
|
line with the start of the content of the parent list when a single space is
|
||||||
|
|
51
lib/configuration.d.ts
vendored
51
lib/configuration.d.ts
vendored
|
@ -30,39 +30,6 @@ export interface Configuration {
|
||||||
* MD001/heading-increment/header-increment : Heading levels should only increment by one level at a time : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md001.md
|
* MD001/heading-increment/header-increment : Heading levels should only increment by one level at a time : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md001.md
|
||||||
*/
|
*/
|
||||||
"header-increment"?: boolean;
|
"header-increment"?: boolean;
|
||||||
/**
|
|
||||||
* MD002/first-heading-h1/first-header-h1 : First heading should be a top-level heading : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md002.md
|
|
||||||
*/
|
|
||||||
MD002?:
|
|
||||||
| boolean
|
|
||||||
| {
|
|
||||||
/**
|
|
||||||
* Heading level
|
|
||||||
*/
|
|
||||||
level?: number;
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* MD002/first-heading-h1/first-header-h1 : First heading should be a top-level heading : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md002.md
|
|
||||||
*/
|
|
||||||
"first-heading-h1"?:
|
|
||||||
| boolean
|
|
||||||
| {
|
|
||||||
/**
|
|
||||||
* Heading level
|
|
||||||
*/
|
|
||||||
level?: number;
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* MD002/first-heading-h1/first-header-h1 : First heading should be a top-level heading : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md002.md
|
|
||||||
*/
|
|
||||||
"first-header-h1"?:
|
|
||||||
| boolean
|
|
||||||
| {
|
|
||||||
/**
|
|
||||||
* Heading level
|
|
||||||
*/
|
|
||||||
level?: number;
|
|
||||||
};
|
|
||||||
/**
|
/**
|
||||||
* MD003/heading-style/header-style : Heading style : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md003.md
|
* MD003/heading-style/header-style : Heading style : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md003.md
|
||||||
*/
|
*/
|
||||||
|
@ -126,14 +93,6 @@ export interface Configuration {
|
||||||
* MD005/list-indent : Inconsistent indentation for list items at the same level : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md005.md
|
* MD005/list-indent : Inconsistent indentation for list items at the same level : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md005.md
|
||||||
*/
|
*/
|
||||||
"list-indent"?: boolean;
|
"list-indent"?: boolean;
|
||||||
/**
|
|
||||||
* MD006/ul-start-left : Consider starting bulleted lists at the beginning of the line : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md006.md
|
|
||||||
*/
|
|
||||||
MD006?: boolean;
|
|
||||||
/**
|
|
||||||
* MD006/ul-start-left : Consider starting bulleted lists at the beginning of the line : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md006.md
|
|
||||||
*/
|
|
||||||
"ul-start-left"?: boolean;
|
|
||||||
/**
|
/**
|
||||||
* MD007/ul-indent : Unordered list indentation : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md007.md
|
* MD007/ul-indent : Unordered list indentation : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md007.md
|
||||||
*/
|
*/
|
||||||
|
@ -1169,23 +1128,23 @@ export interface Configuration {
|
||||||
reference?: boolean;
|
reference?: boolean;
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* headings : MD001, MD002, MD003, MD018, MD019, MD020, MD021, MD022, MD023, MD024, MD025, MD026, MD036, MD041, MD043
|
* headings : MD001, MD003, MD018, MD019, MD020, MD021, MD022, MD023, MD024, MD025, MD026, MD036, MD041, MD043
|
||||||
*/
|
*/
|
||||||
headings?: boolean;
|
headings?: boolean;
|
||||||
/**
|
/**
|
||||||
* headers : MD001, MD002, MD003, MD018, MD019, MD020, MD021, MD022, MD023, MD024, MD025, MD026, MD036, MD041, MD043
|
* headers : MD001, MD003, MD018, MD019, MD020, MD021, MD022, MD023, MD024, MD025, MD026, MD036, MD041, MD043
|
||||||
*/
|
*/
|
||||||
headers?: boolean;
|
headers?: boolean;
|
||||||
/**
|
/**
|
||||||
* bullet : MD004, MD005, MD006, MD007, MD032
|
* bullet : MD004, MD005, MD007, MD032
|
||||||
*/
|
*/
|
||||||
bullet?: boolean;
|
bullet?: boolean;
|
||||||
/**
|
/**
|
||||||
* ul : MD004, MD005, MD006, MD007, MD030, MD032
|
* ul : MD004, MD005, MD007, MD030, MD032
|
||||||
*/
|
*/
|
||||||
ul?: boolean;
|
ul?: boolean;
|
||||||
/**
|
/**
|
||||||
* indentation : MD005, MD006, MD007, MD027
|
* indentation : MD005, MD007, MD027
|
||||||
*/
|
*/
|
||||||
indentation?: boolean;
|
indentation?: boolean;
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -2,14 +2,13 @@
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
module.exports.deprecatedRuleNames = [ "MD002", "MD006" ];
|
module.exports.deprecatedRuleNames = [];
|
||||||
module.exports.fixableRuleNames = [
|
module.exports.fixableRuleNames = [
|
||||||
"MD004", "MD005", "MD006", "MD007", "MD009", "MD010",
|
"MD004", "MD005", "MD007", "MD009", "MD010", "MD011",
|
||||||
"MD011", "MD012", "MD014", "MD018", "MD019", "MD020",
|
"MD012", "MD014", "MD018", "MD019", "MD020", "MD021",
|
||||||
"MD021", "MD022", "MD023", "MD026", "MD027", "MD030",
|
"MD022", "MD023", "MD026", "MD027", "MD030", "MD031",
|
||||||
"MD031", "MD032", "MD034", "MD037", "MD038", "MD039",
|
"MD032", "MD034", "MD037", "MD038", "MD039", "MD044",
|
||||||
"MD044", "MD047", "MD049", "MD050", "MD051", "MD053",
|
"MD047", "MD049", "MD050", "MD051", "MD053", "MD054"
|
||||||
"MD054"
|
|
||||||
];
|
];
|
||||||
module.exports.homepage = "https://github.com/DavidAnson/markdownlint";
|
module.exports.homepage = "https://github.com/DavidAnson/markdownlint";
|
||||||
module.exports.version = "0.31.1";
|
module.exports.version = "0.31.1";
|
||||||
|
|
|
@ -6,7 +6,7 @@ const path = require("node:path");
|
||||||
const { promisify } = require("node:util");
|
const { promisify } = require("node:util");
|
||||||
const markdownit = require("markdown-it");
|
const markdownit = require("markdown-it");
|
||||||
const micromark = require("../helpers/micromark.cjs");
|
const micromark = require("../helpers/micromark.cjs");
|
||||||
const { deprecatedRuleNames } = require("./constants");
|
// const { deprecatedRuleNames } = require("./constants");
|
||||||
const rules = require("./rules");
|
const rules = require("./rules");
|
||||||
const helpers = require("../helpers");
|
const helpers = require("../helpers");
|
||||||
const cache = require("./cache");
|
const cache = require("./cache");
|
||||||
|
@ -323,9 +323,9 @@ function getEffectiveConfig(ruleList, config, aliasToRuleNames) {
|
||||||
const ruleName = rule.names[0].toUpperCase();
|
const ruleName = rule.names[0].toUpperCase();
|
||||||
effectiveConfig[ruleName] = ruleDefault;
|
effectiveConfig[ruleName] = ruleDefault;
|
||||||
}
|
}
|
||||||
for (const ruleName of deprecatedRuleNames) {
|
// for (const ruleName of deprecatedRuleNames) {
|
||||||
effectiveConfig[ruleName] = false;
|
// effectiveConfig[ruleName] = false;
|
||||||
}
|
// }
|
||||||
for (const key of Object.keys(config)) {
|
for (const key of Object.keys(config)) {
|
||||||
let value = config[key];
|
let value = config[key];
|
||||||
if (value) {
|
if (value) {
|
||||||
|
|
22
lib/md002.js
22
lib/md002.js
|
@ -1,22 +0,0 @@
|
||||||
// @ts-check
|
|
||||||
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
const { addErrorDetailIf } = require("../helpers");
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
"names": [ "MD002", "first-heading-h1", "first-header-h1" ],
|
|
||||||
"description": "First heading should be a top-level heading",
|
|
||||||
"tags": [ "headings", "headers" ],
|
|
||||||
"function": function MD002(params, onError) {
|
|
||||||
const level = Number(params.config.level || 1);
|
|
||||||
const tag = "h" + level;
|
|
||||||
params.parsers.markdownit.tokens.every(function forToken(token) {
|
|
||||||
if (token.type === "heading_open") {
|
|
||||||
addErrorDetailIf(onError, token.lineNumber, tag, token.tag);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
34
lib/md006.js
34
lib/md006.js
|
@ -1,34 +0,0 @@
|
||||||
// @ts-check
|
|
||||||
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
const { addErrorDetailIf, listItemMarkerRe, rangeFromRegExp } =
|
|
||||||
require("../helpers");
|
|
||||||
const { flattenedLists } = require("./cache");
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
"names": [ "MD006", "ul-start-left" ],
|
|
||||||
"description":
|
|
||||||
"Consider starting bulleted lists at the beginning of the line",
|
|
||||||
"tags": [ "bullet", "ul", "indentation" ],
|
|
||||||
"function": function MD006(params, onError) {
|
|
||||||
for (const list of flattenedLists()) {
|
|
||||||
if (list.unordered && !list.nesting && (list.indent !== 0)) {
|
|
||||||
for (const item of list.items) {
|
|
||||||
const { lineNumber, line } = item;
|
|
||||||
addErrorDetailIf(
|
|
||||||
onError,
|
|
||||||
lineNumber,
|
|
||||||
0,
|
|
||||||
list.indent,
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
rangeFromRegExp(line, listItemMarkerRe),
|
|
||||||
{
|
|
||||||
"deleteCount": line.length - line.trimStart().length
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
|
@ -6,11 +6,9 @@ const { homepage, version } = require("./constants");
|
||||||
|
|
||||||
const rules = [
|
const rules = [
|
||||||
require("./md001"),
|
require("./md001"),
|
||||||
require("./md002"),
|
|
||||||
require("./md003"),
|
require("./md003"),
|
||||||
require("./md004"),
|
require("./md004"),
|
||||||
require("./md005"),
|
require("./md005"),
|
||||||
require("./md006"),
|
|
||||||
require("./md007"),
|
require("./md007"),
|
||||||
require("./md009"),
|
require("./md009"),
|
||||||
require("./md010"),
|
require("./md010"),
|
||||||
|
|
|
@ -10,12 +10,6 @@
|
||||||
// MD001/heading-increment/header-increment : Heading levels should only increment by one level at a time : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md001.md
|
// MD001/heading-increment/header-increment : Heading levels should only increment by one level at a time : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md001.md
|
||||||
"MD001": true,
|
"MD001": true,
|
||||||
|
|
||||||
// MD002/first-heading-h1/first-header-h1 : First heading should be a top-level heading : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md002.md
|
|
||||||
"MD002": {
|
|
||||||
// Heading level
|
|
||||||
"level": 1
|
|
||||||
},
|
|
||||||
|
|
||||||
// MD003/heading-style/header-style : Heading style : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md003.md
|
// MD003/heading-style/header-style : Heading style : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md003.md
|
||||||
"MD003": {
|
"MD003": {
|
||||||
// Heading style
|
// Heading style
|
||||||
|
@ -31,9 +25,6 @@
|
||||||
// MD005/list-indent : Inconsistent indentation for list items at the same level : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md005.md
|
// MD005/list-indent : Inconsistent indentation for list items at the same level : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md005.md
|
||||||
"MD005": true,
|
"MD005": true,
|
||||||
|
|
||||||
// MD006/ul-start-left : Consider starting bulleted lists at the beginning of the line : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md006.md
|
|
||||||
"MD006": true,
|
|
||||||
|
|
||||||
// MD007/ul-indent : Unordered list indentation : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md007.md
|
// MD007/ul-indent : Unordered list indentation : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md007.md
|
||||||
"MD007": {
|
"MD007": {
|
||||||
// Spaces for indent
|
// Spaces for indent
|
||||||
|
|
|
@ -9,11 +9,6 @@ extends: null
|
||||||
# MD001/heading-increment/header-increment : Heading levels should only increment by one level at a time : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md001.md
|
# MD001/heading-increment/header-increment : Heading levels should only increment by one level at a time : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md001.md
|
||||||
MD001: true
|
MD001: true
|
||||||
|
|
||||||
# MD002/first-heading-h1/first-header-h1 : First heading should be a top-level heading : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md002.md
|
|
||||||
MD002:
|
|
||||||
# Heading level
|
|
||||||
level: 1
|
|
||||||
|
|
||||||
# MD003/heading-style/header-style : Heading style : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md003.md
|
# MD003/heading-style/header-style : Heading style : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md003.md
|
||||||
MD003:
|
MD003:
|
||||||
# Heading style
|
# Heading style
|
||||||
|
@ -27,9 +22,6 @@ MD004:
|
||||||
# MD005/list-indent : Inconsistent indentation for list items at the same level : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md005.md
|
# MD005/list-indent : Inconsistent indentation for list items at the same level : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md005.md
|
||||||
MD005: true
|
MD005: true
|
||||||
|
|
||||||
# MD006/ul-start-left : Consider starting bulleted lists at the beginning of the line : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md006.md
|
|
||||||
MD006: true
|
|
||||||
|
|
||||||
# MD007/ul-indent : Unordered list indentation : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md007.md
|
# MD007/ul-indent : Unordered list indentation : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md007.md
|
||||||
MD007:
|
MD007:
|
||||||
# Spaces for indent
|
# Spaces for indent
|
||||||
|
|
|
@ -58,17 +58,6 @@ for (const rule of rules) {
|
||||||
};
|
};
|
||||||
let custom = true;
|
let custom = true;
|
||||||
switch (rule.names[0]) {
|
switch (rule.names[0]) {
|
||||||
case "MD002":
|
|
||||||
scheme.properties = {
|
|
||||||
"level": {
|
|
||||||
"description": "Heading level",
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1,
|
|
||||||
"maximum": 6,
|
|
||||||
"default": 1
|
|
||||||
}
|
|
||||||
};
|
|
||||||
break;
|
|
||||||
case "MD003":
|
case "MD003":
|
||||||
scheme.properties = {
|
scheme.properties = {
|
||||||
"style": {
|
"style": {
|
||||||
|
|
|
@ -36,60 +36,6 @@
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"MD002": {
|
|
||||||
"description": "MD002/first-heading-h1/first-header-h1 : First heading should be a top-level heading : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md002.md",
|
|
||||||
"type": [
|
|
||||||
"boolean",
|
|
||||||
"object"
|
|
||||||
],
|
|
||||||
"default": true,
|
|
||||||
"properties": {
|
|
||||||
"level": {
|
|
||||||
"description": "Heading level",
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1,
|
|
||||||
"maximum": 6,
|
|
||||||
"default": 1
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"additionalProperties": false
|
|
||||||
},
|
|
||||||
"first-heading-h1": {
|
|
||||||
"description": "MD002/first-heading-h1/first-header-h1 : First heading should be a top-level heading : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md002.md",
|
|
||||||
"type": [
|
|
||||||
"boolean",
|
|
||||||
"object"
|
|
||||||
],
|
|
||||||
"default": true,
|
|
||||||
"properties": {
|
|
||||||
"level": {
|
|
||||||
"description": "Heading level",
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1,
|
|
||||||
"maximum": 6,
|
|
||||||
"default": 1
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"additionalProperties": false
|
|
||||||
},
|
|
||||||
"first-header-h1": {
|
|
||||||
"description": "MD002/first-heading-h1/first-header-h1 : First heading should be a top-level heading : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md002.md",
|
|
||||||
"type": [
|
|
||||||
"boolean",
|
|
||||||
"object"
|
|
||||||
],
|
|
||||||
"default": true,
|
|
||||||
"properties": {
|
|
||||||
"level": {
|
|
||||||
"description": "Heading level",
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1,
|
|
||||||
"maximum": 6,
|
|
||||||
"default": 1
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"additionalProperties": false
|
|
||||||
},
|
|
||||||
"MD003": {
|
"MD003": {
|
||||||
"description": "MD003/heading-style/header-style : Heading style : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md003.md",
|
"description": "MD003/heading-style/header-style : Heading style : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md003.md",
|
||||||
"type": [
|
"type": [
|
||||||
|
@ -218,16 +164,6 @@
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"MD006": {
|
|
||||||
"description": "MD006/ul-start-left : Consider starting bulleted lists at the beginning of the line : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md006.md",
|
|
||||||
"type": "boolean",
|
|
||||||
"default": true
|
|
||||||
},
|
|
||||||
"ul-start-left": {
|
|
||||||
"description": "MD006/ul-start-left : Consider starting bulleted lists at the beginning of the line : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md006.md",
|
|
||||||
"type": "boolean",
|
|
||||||
"default": true
|
|
||||||
},
|
|
||||||
"MD007": {
|
"MD007": {
|
||||||
"description": "MD007/ul-indent : Unordered list indentation : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md007.md",
|
"description": "MD007/ul-indent : Unordered list indentation : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md007.md",
|
||||||
"type": [
|
"type": [
|
||||||
|
@ -1840,27 +1776,27 @@
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
"headings": {
|
"headings": {
|
||||||
"description": "headings : MD001, MD002, MD003, MD018, MD019, MD020, MD021, MD022, MD023, MD024, MD025, MD026, MD036, MD041, MD043",
|
"description": "headings : MD001, MD003, MD018, MD019, MD020, MD021, MD022, MD023, MD024, MD025, MD026, MD036, MD041, MD043",
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"headers": {
|
"headers": {
|
||||||
"description": "headers : MD001, MD002, MD003, MD018, MD019, MD020, MD021, MD022, MD023, MD024, MD025, MD026, MD036, MD041, MD043",
|
"description": "headers : MD001, MD003, MD018, MD019, MD020, MD021, MD022, MD023, MD024, MD025, MD026, MD036, MD041, MD043",
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"bullet": {
|
"bullet": {
|
||||||
"description": "bullet : MD004, MD005, MD006, MD007, MD032",
|
"description": "bullet : MD004, MD005, MD007, MD032",
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"ul": {
|
"ul": {
|
||||||
"description": "ul : MD004, MD005, MD006, MD007, MD030, MD032",
|
"description": "ul : MD004, MD005, MD007, MD030, MD032",
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"indentation": {
|
"indentation": {
|
||||||
"description": "indentation : MD005, MD006, MD007, MD027",
|
"description": "indentation : MD005, MD007, MD027",
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
"default": true,
|
"default": true,
|
||||||
"whitespace": false,
|
"whitespace": false,
|
||||||
"line_length": false,
|
"line_length": false,
|
||||||
"ul-start-left": false,
|
|
||||||
"ul-indent": false,
|
"ul-indent": false,
|
||||||
"no-inline-html": false,
|
"no-inline-html": false,
|
||||||
"no-bare-urls": false,
|
"no-bare-urls": false,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
## One {MD002}
|
## One
|
||||||
|
|
||||||
#### Two {MD001}
|
#### Two {MD001}
|
||||||
|
|
||||||
|
@ -9,8 +9,8 @@
|
||||||
|
|
||||||
- Charlie {MD004}
|
- Charlie {MD004}
|
||||||
|
|
||||||
* Delta {MD006} {MD007}
|
* Delta {MD007}
|
||||||
* Echo {MD006} {MD007}
|
* Echo {MD007}
|
||||||
|
|
||||||
Text {MD009}
|
Text {MD009}
|
||||||
|
|
||||||
|
@ -30,7 +30,5 @@ Text text {MD010}
|
||||||
12. Twelve
|
12. Twelve
|
||||||
|
|
||||||
<!-- markdownlint-configure-file {
|
<!-- markdownlint-configure-file {
|
||||||
"first-heading-h1": true,
|
|
||||||
"ul-start-left": true,
|
|
||||||
"first-line-heading": false
|
"first-line-heading": false
|
||||||
} -->
|
} -->
|
||||||
|
|
|
@ -3,9 +3,6 @@
|
||||||
## Another one {MD025}
|
## Another one {MD025}
|
||||||
|
|
||||||
<!-- markdownlint-configure-file {
|
<!-- markdownlint-configure-file {
|
||||||
"first-heading-h1": {
|
|
||||||
"level": 2
|
|
||||||
},
|
|
||||||
"single-title": {
|
"single-title": {
|
||||||
"level": 2
|
"level": 2
|
||||||
},
|
},
|
||||||
|
|
|
@ -19,6 +19,5 @@
|
||||||
## Heading 10 {MD003} \#
|
## Heading 10 {MD003} \#
|
||||||
|
|
||||||
<!-- markdownlint-configure-file {
|
<!-- markdownlint-configure-file {
|
||||||
"first-heading-h1": false,
|
|
||||||
"first-line-heading": false
|
"first-line-heading": false
|
||||||
} -->
|
} -->
|
||||||
|
|
|
@ -5,6 +5,5 @@
|
||||||
## Heading 3 {MD019}
|
## Heading 3 {MD019}
|
||||||
|
|
||||||
<!-- markdownlint-configure-file {
|
<!-- markdownlint-configure-file {
|
||||||
"first-heading-h1": false,
|
|
||||||
"first-line-heading": false
|
"first-line-heading": false
|
||||||
} -->
|
} -->
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
## Heading 1 {MD002:1} {MD041:1}
|
## Heading 1 {MD041:1}
|
||||||
|
|
||||||
#### Heading 2 {MD001:3}
|
#### Heading 2 {MD001:3}
|
||||||
|
|
||||||
# Heading 3 {MD003} {MD043} #
|
# Heading 3 {MD003} {MD043} #
|
||||||
|
|
||||||
* list {MD032}
|
* list {MD032}
|
||||||
+ list {MD004} {MD006} {MD007} {MD030} {MD032}
|
+ list {MD004} {MD007} {MD030} {MD032}
|
||||||
|
|
||||||
* list
|
* list
|
||||||
* list {MD007}
|
* list {MD007}
|
||||||
|
@ -35,7 +35,7 @@ long line long line long line long line long line long line long line long line
|
||||||
# Heading 8
|
# Heading 8
|
||||||
|
|
||||||
{MD024:35}
|
{MD024:35}
|
||||||
Note: Can not break MD025 and MD002 in the same file
|
Note: Can not break MD025 and MD041 in the same file
|
||||||
|
|
||||||
# Heading 9 {MD023} {MD026}.
|
# Heading 9 {MD023} {MD026}.
|
||||||
|
|
||||||
|
@ -106,11 +106,9 @@ Strong **with** different style {MD050}
|
||||||
[url]: https://example.com/page
|
[url]: https://example.com/page
|
||||||
|
|
||||||
<!-- markdownlint-configure-file {
|
<!-- markdownlint-configure-file {
|
||||||
"first-heading-h1": true,
|
|
||||||
"ul-start-left": true,
|
|
||||||
"required-headings": {
|
"required-headings": {
|
||||||
"headings": [
|
"headings": [
|
||||||
"## Heading 1 {MD002:1} {MD041:1}",
|
"## Heading 1 {MD041:1}",
|
||||||
"#### Heading 2 {MD001:3}",
|
"#### Heading 2 {MD001:3}",
|
||||||
"# Broken"
|
"# Broken"
|
||||||
]
|
]
|
||||||
|
|
|
@ -12,13 +12,13 @@ Text
|
||||||
|
|
||||||
Text
|
Text
|
||||||
|
|
||||||
* Item {MD006} {MD007}
|
|
||||||
* Item {MD007}
|
* Item {MD007}
|
||||||
* Item {MD007}
|
* Item {MD007}
|
||||||
* Item {MD007}
|
* Item {MD007}
|
||||||
* Item {MD007}
|
* Item {MD007}
|
||||||
* Item {MD006} {MD007}
|
* Item {MD007}
|
||||||
* Item {MD006} {MD007}
|
* Item {MD007}
|
||||||
|
* Item {MD007}
|
||||||
|
|
||||||
Text
|
Text
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ Text
|
||||||
|
|
||||||
Text
|
Text
|
||||||
|
|
||||||
* Item {MD006} {MD007}
|
* Item {MD007}
|
||||||
* Item {MD007}
|
* Item {MD007}
|
||||||
|
|
||||||
Text
|
Text
|
||||||
|
@ -38,9 +38,9 @@ Text
|
||||||
|
|
||||||
Text
|
Text
|
||||||
|
|
||||||
* Item {MD006} {MD007}
|
* Item {MD007}
|
||||||
* Item {MD006} {MD007}
|
* Item {MD007}
|
||||||
* Item {MD006} {MD007}
|
* Item {MD007}
|
||||||
|
|
||||||
Text
|
Text
|
||||||
|
|
||||||
|
@ -52,12 +52,8 @@ Text
|
||||||
|
|
||||||
Text
|
Text
|
||||||
|
|
||||||
* Item {MD006} {MD007}
|
* Item {MD007}
|
||||||
|
|
||||||
* Item {MD006} {MD007}
|
* Item {MD007}
|
||||||
|
|
||||||
* Item {MD006} {MD007}
|
* Item {MD007}
|
||||||
|
|
||||||
<!-- markdownlint-configure-file {
|
|
||||||
"ul-start-left": true
|
|
||||||
} -->
|
|
||||||
|
|
|
@ -9,8 +9,5 @@ categories: jekyll update
|
||||||
Front matter from [Jekyll documentation](https://jekyllrb.com/docs/posts/#a-typical-post).
|
Front matter from [Jekyll documentation](https://jekyllrb.com/docs/posts/#a-typical-post).
|
||||||
|
|
||||||
<!-- markdownlint-configure-file {
|
<!-- markdownlint-configure-file {
|
||||||
"first-heading-h1": {
|
|
||||||
"level": 2
|
|
||||||
},
|
|
||||||
"line-length": false
|
"line-length": false
|
||||||
} -->
|
} -->
|
||||||
|
|
|
@ -39,7 +39,6 @@
|
||||||
* item 3 {MD007}
|
* item 3 {MD007}
|
||||||
|
|
||||||
<!-- markdownlint-configure-file {
|
<!-- markdownlint-configure-file {
|
||||||
"ul-start-left": false,
|
|
||||||
"ul-indent": {
|
"ul-indent": {
|
||||||
"indent": 3,
|
"indent": 3,
|
||||||
"start_indented": true
|
"start_indented": true
|
||||||
|
|
|
@ -47,14 +47,10 @@ Text
|
||||||
|
|
||||||
## Invalid Indentation - Should Start at Zero
|
## Invalid Indentation - Should Start at Zero
|
||||||
|
|
||||||
- item 1 {MD006} {MD007}
|
- item 1 {MD007}
|
||||||
- item 2 {MD006} {MD007}
|
- item 2 {MD007}
|
||||||
- item 2.1 {MD007}
|
- item 2.1 {MD007}
|
||||||
- item 2.2 {MD007}
|
- item 2.2 {MD007}
|
||||||
- item 2.2.1 {MD007}
|
- item 2.2.1 {MD007}
|
||||||
- item 2.3 {MD007}
|
- item 2.3 {MD007}
|
||||||
- item 3 {MD006} {MD007}
|
- item 3 {MD007}
|
||||||
|
|
||||||
<!-- markdownlint-configure-file {
|
|
||||||
"ul-start-left": true
|
|
||||||
} -->
|
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
- three {MD032}
|
- three {MD032}
|
||||||
|
|
||||||
1. one {MD032}
|
1. one {MD032}
|
||||||
- two {MD006} {MD007} {MD032}
|
- two {MD007} {MD032}
|
||||||
1. three {MD032}
|
1. three {MD032}
|
||||||
|
|
||||||
## Correct nesting, same type
|
## Correct nesting, same type
|
||||||
|
@ -94,10 +94,6 @@
|
||||||
1. seven
|
1. seven
|
||||||
- eight
|
- eight
|
||||||
|
|
||||||
* 1. Item {MD004} {MD006} {MD007}
|
* 1. Item {MD004} {MD007}
|
||||||
* 2. Item {MD004} {MD006} {MD007}
|
* 2. Item {MD004} {MD007}
|
||||||
* 3. Item {MD004} {MD006} {MD007}
|
* 3. Item {MD004} {MD007}
|
||||||
|
|
||||||
<!-- markdownlint-configure-file {
|
|
||||||
"ul-start-left": true
|
|
||||||
} -->
|
|
||||||
|
|
|
@ -90,7 +90,7 @@ test("configCustomFileSystem", (t) => new Promise((resolve) => {
|
||||||
};
|
};
|
||||||
const extendedContent = {
|
const extendedContent = {
|
||||||
"MD001": true,
|
"MD001": true,
|
||||||
"MD002": true
|
"MD041": true
|
||||||
};
|
};
|
||||||
const fsApi = {
|
const fsApi = {
|
||||||
"access": (p, m, cb) => {
|
"access": (p, m, cb) => {
|
||||||
|
@ -403,7 +403,7 @@ test("configCustomFileSystemSync", (t) => {
|
||||||
};
|
};
|
||||||
const extendedContent = {
|
const extendedContent = {
|
||||||
"MD001": true,
|
"MD001": true,
|
||||||
"MD002": true
|
"MD041": true
|
||||||
};
|
};
|
||||||
const fsApi = {
|
const fsApi = {
|
||||||
"accessSync": (p) => {
|
"accessSync": (p) => {
|
||||||
|
@ -465,7 +465,7 @@ test("configCustomFileSystemPromise", (t) => new Promise((resolve) => {
|
||||||
};
|
};
|
||||||
const extendedContent = {
|
const extendedContent = {
|
||||||
"MD001": true,
|
"MD001": true,
|
||||||
"MD002": true
|
"MD041": true
|
||||||
};
|
};
|
||||||
const fsApi = {
|
const fsApi = {
|
||||||
"access": (p, m, cb) => {
|
"access": (p, m, cb) => {
|
||||||
|
@ -534,7 +534,7 @@ test("extendCustomFileSystemPromise", (t) => new Promise((resolve) => {
|
||||||
};
|
};
|
||||||
const extendedContent = {
|
const extendedContent = {
|
||||||
"MD001": true,
|
"MD001": true,
|
||||||
"MD002": true
|
"MD041": true
|
||||||
};
|
};
|
||||||
const fsApi = {
|
const fsApi = {
|
||||||
"access": (p, m, cb) => {
|
"access": (p, m, cb) => {
|
||||||
|
|
|
@ -33,8 +33,7 @@ test("resultFormattingV0", (t) => new Promise((resolve) => {
|
||||||
"./test/first_heading_bad_atx.md"
|
"./test/first_heading_bad_atx.md"
|
||||||
],
|
],
|
||||||
"config": {
|
"config": {
|
||||||
"MD002": true,
|
"MD041": true
|
||||||
"MD041": false
|
|
||||||
},
|
},
|
||||||
"noInlineConfig": true,
|
"noInlineConfig": true,
|
||||||
"resultVersion": 0
|
"resultVersion": 0
|
||||||
|
@ -43,42 +42,43 @@ test("resultFormattingV0", (t) => new Promise((resolve) => {
|
||||||
t.falsy(err);
|
t.falsy(err);
|
||||||
const expectedResult = {
|
const expectedResult = {
|
||||||
"./test/atx_heading_spacing.md": {
|
"./test/atx_heading_spacing.md": {
|
||||||
"MD002": [ 3 ],
|
|
||||||
"MD018": [ 1 ],
|
"MD018": [ 1 ],
|
||||||
"MD019": [ 3, 5 ]
|
"MD019": [ 3, 5 ],
|
||||||
|
"MD041": [ 1 ]
|
||||||
},
|
},
|
||||||
"./test/first_heading_bad_atx.md": {
|
"./test/first_heading_bad_atx.md": {
|
||||||
"MD002": [ 1 ]
|
"MD041": [ 1 ]
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
t.deepEqual(actualResult, expectedResult, "Undetected issues.");
|
t.deepEqual(actualResult, expectedResult, "Undetected issues.");
|
||||||
|
// @ts-ignore
|
||||||
let actualMessage = actualResult.toString();
|
let actualMessage = actualResult.toString();
|
||||||
let expectedMessage =
|
let expectedMessage =
|
||||||
"./test/atx_heading_spacing.md: 3: MD002" +
|
|
||||||
" First heading should be a top-level heading\n" +
|
|
||||||
"./test/atx_heading_spacing.md: 1: MD018" +
|
"./test/atx_heading_spacing.md: 1: MD018" +
|
||||||
" No space after hash on atx style heading\n" +
|
" No space after hash on atx style heading\n" +
|
||||||
"./test/atx_heading_spacing.md: 3: MD019" +
|
"./test/atx_heading_spacing.md: 3: MD019" +
|
||||||
" Multiple spaces after hash on atx style heading\n" +
|
" Multiple spaces after hash on atx style heading\n" +
|
||||||
"./test/atx_heading_spacing.md: 5: MD019" +
|
"./test/atx_heading_spacing.md: 5: MD019" +
|
||||||
" Multiple spaces after hash on atx style heading\n" +
|
" Multiple spaces after hash on atx style heading\n" +
|
||||||
"./test/first_heading_bad_atx.md: 1: MD002" +
|
"./test/atx_heading_spacing.md: 1: MD041" +
|
||||||
" First heading should be a top-level heading";
|
" First line in a file should be a top-level heading\n" +
|
||||||
|
"./test/first_heading_bad_atx.md: 1: MD041" +
|
||||||
|
" First line in a file should be a top-level heading"
|
||||||
t.is(actualMessage, expectedMessage, "Incorrect message (name).");
|
t.is(actualMessage, expectedMessage, "Incorrect message (name).");
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
actualMessage = actualResult.toString(true);
|
actualMessage = actualResult.toString(true);
|
||||||
expectedMessage =
|
expectedMessage =
|
||||||
"./test/atx_heading_spacing.md: 3: first-heading-h1" +
|
|
||||||
" First heading should be a top-level heading\n" +
|
|
||||||
"./test/atx_heading_spacing.md: 1: no-missing-space-atx" +
|
"./test/atx_heading_spacing.md: 1: no-missing-space-atx" +
|
||||||
" No space after hash on atx style heading\n" +
|
" No space after hash on atx style heading\n" +
|
||||||
"./test/atx_heading_spacing.md: 3: no-multiple-space-atx" +
|
"./test/atx_heading_spacing.md: 3: no-multiple-space-atx" +
|
||||||
" Multiple spaces after hash on atx style heading\n" +
|
" Multiple spaces after hash on atx style heading\n" +
|
||||||
"./test/atx_heading_spacing.md: 5: no-multiple-space-atx" +
|
"./test/atx_heading_spacing.md: 5: no-multiple-space-atx" +
|
||||||
" Multiple spaces after hash on atx style heading\n" +
|
" Multiple spaces after hash on atx style heading\n" +
|
||||||
"./test/first_heading_bad_atx.md: 1: first-heading-h1" +
|
"./test/atx_heading_spacing.md: 1: first-line-heading" +
|
||||||
" First heading should be a top-level heading";
|
" First line in a file should be a top-level heading\n" +
|
||||||
|
"./test/first_heading_bad_atx.md: 1: first-line-heading" +
|
||||||
|
" First line in a file should be a top-level heading"
|
||||||
t.is(actualMessage, expectedMessage, "Incorrect message (alias).");
|
t.is(actualMessage, expectedMessage, "Incorrect message (alias).");
|
||||||
resolve();
|
resolve();
|
||||||
});
|
});
|
||||||
|
@ -92,8 +92,7 @@ test("resultFormattingSyncV0", (t) => {
|
||||||
"./test/first_heading_bad_atx.md"
|
"./test/first_heading_bad_atx.md"
|
||||||
],
|
],
|
||||||
"config": {
|
"config": {
|
||||||
"MD002": true,
|
"MD041": true
|
||||||
"MD041": false
|
|
||||||
},
|
},
|
||||||
"noInlineConfig": true,
|
"noInlineConfig": true,
|
||||||
"resultVersion": 0
|
"resultVersion": 0
|
||||||
|
@ -101,42 +100,42 @@ test("resultFormattingSyncV0", (t) => {
|
||||||
const actualResult = markdownlint.sync(options);
|
const actualResult = markdownlint.sync(options);
|
||||||
const expectedResult = {
|
const expectedResult = {
|
||||||
"./test/atx_heading_spacing.md": {
|
"./test/atx_heading_spacing.md": {
|
||||||
"MD002": [ 3 ],
|
|
||||||
"MD018": [ 1 ],
|
"MD018": [ 1 ],
|
||||||
"MD019": [ 3, 5 ]
|
"MD019": [ 3, 5 ],
|
||||||
|
"MD041": [ 1 ]
|
||||||
},
|
},
|
||||||
"./test/first_heading_bad_atx.md": {
|
"./test/first_heading_bad_atx.md": {
|
||||||
"MD002": [ 1 ]
|
"MD041": [ 1 ]
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
t.deepEqual(actualResult, expectedResult, "Undetected issues.");
|
t.deepEqual(actualResult, expectedResult, "Undetected issues.");
|
||||||
let actualMessage = actualResult.toString();
|
let actualMessage = actualResult.toString();
|
||||||
let expectedMessage =
|
let expectedMessage =
|
||||||
"./test/atx_heading_spacing.md: 3: MD002" +
|
|
||||||
" First heading should be a top-level heading\n" +
|
|
||||||
"./test/atx_heading_spacing.md: 1: MD018" +
|
"./test/atx_heading_spacing.md: 1: MD018" +
|
||||||
" No space after hash on atx style heading\n" +
|
" No space after hash on atx style heading\n" +
|
||||||
"./test/atx_heading_spacing.md: 3: MD019" +
|
"./test/atx_heading_spacing.md: 3: MD019" +
|
||||||
" Multiple spaces after hash on atx style heading\n" +
|
" Multiple spaces after hash on atx style heading\n" +
|
||||||
"./test/atx_heading_spacing.md: 5: MD019" +
|
"./test/atx_heading_spacing.md: 5: MD019" +
|
||||||
" Multiple spaces after hash on atx style heading\n" +
|
" Multiple spaces after hash on atx style heading\n" +
|
||||||
"./test/first_heading_bad_atx.md: 1: MD002" +
|
"./test/atx_heading_spacing.md: 1: MD041" +
|
||||||
" First heading should be a top-level heading";
|
" First line in a file should be a top-level heading\n" +
|
||||||
|
"./test/first_heading_bad_atx.md: 1: MD041" +
|
||||||
|
" First line in a file should be a top-level heading"
|
||||||
t.is(actualMessage, expectedMessage, "Incorrect message (name).");
|
t.is(actualMessage, expectedMessage, "Incorrect message (name).");
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
actualMessage = actualResult.toString(true);
|
actualMessage = actualResult.toString(true);
|
||||||
expectedMessage =
|
expectedMessage =
|
||||||
"./test/atx_heading_spacing.md: 3: first-heading-h1" +
|
|
||||||
" First heading should be a top-level heading\n" +
|
|
||||||
"./test/atx_heading_spacing.md: 1: no-missing-space-atx" +
|
"./test/atx_heading_spacing.md: 1: no-missing-space-atx" +
|
||||||
" No space after hash on atx style heading\n" +
|
" No space after hash on atx style heading\n" +
|
||||||
"./test/atx_heading_spacing.md: 3: no-multiple-space-atx" +
|
"./test/atx_heading_spacing.md: 3: no-multiple-space-atx" +
|
||||||
" Multiple spaces after hash on atx style heading\n" +
|
" Multiple spaces after hash on atx style heading\n" +
|
||||||
"./test/atx_heading_spacing.md: 5: no-multiple-space-atx" +
|
"./test/atx_heading_spacing.md: 5: no-multiple-space-atx" +
|
||||||
" Multiple spaces after hash on atx style heading\n" +
|
" Multiple spaces after hash on atx style heading\n" +
|
||||||
"./test/first_heading_bad_atx.md: 1: first-heading-h1" +
|
"./test/atx_heading_spacing.md: 1: first-line-heading" +
|
||||||
" First heading should be a top-level heading";
|
" First line in a file should be a top-level heading\n" +
|
||||||
|
"./test/first_heading_bad_atx.md: 1: first-line-heading" +
|
||||||
|
" First line in a file should be a top-level heading"
|
||||||
t.is(actualMessage, expectedMessage, "Incorrect message (alias).");
|
t.is(actualMessage, expectedMessage, "Incorrect message (alias).");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -152,8 +151,7 @@ test("resultFormattingV1", (t) => new Promise((resolve) => {
|
||||||
"./test/first_heading_bad_atx.md"
|
"./test/first_heading_bad_atx.md"
|
||||||
],
|
],
|
||||||
"config": {
|
"config": {
|
||||||
"MD002": true,
|
"MD041": true
|
||||||
"MD041": false
|
|
||||||
},
|
},
|
||||||
"noInlineConfig": true,
|
"noInlineConfig": true,
|
||||||
"resultVersion": 1
|
"resultVersion": 1
|
||||||
|
@ -173,14 +171,6 @@ test("resultFormattingV1", (t) => new Promise((resolve) => {
|
||||||
"errorRange": [ 1, 4 ] }
|
"errorRange": [ 1, 4 ] }
|
||||||
],
|
],
|
||||||
"./test/atx_heading_spacing.md": [
|
"./test/atx_heading_spacing.md": [
|
||||||
{ "lineNumber": 3,
|
|
||||||
"ruleName": "MD002",
|
|
||||||
"ruleAlias": "first-heading-h1",
|
|
||||||
"ruleDescription": "First heading should be a top-level heading",
|
|
||||||
"ruleInformation": `${homepage}/blob/v${version}/doc/md002.md`,
|
|
||||||
"errorDetail": "Expected: h1; Actual: h2",
|
|
||||||
"errorContext": null,
|
|
||||||
"errorRange": null },
|
|
||||||
{ "lineNumber": 1,
|
{ "lineNumber": 1,
|
||||||
"ruleName": "MD018",
|
"ruleName": "MD018",
|
||||||
"ruleAlias": "no-missing-space-atx",
|
"ruleAlias": "no-missing-space-atx",
|
||||||
|
@ -204,26 +194,32 @@ test("resultFormattingV1", (t) => new Promise((resolve) => {
|
||||||
"ruleInformation": `${homepage}/blob/v${version}/doc/md019.md`,
|
"ruleInformation": `${homepage}/blob/v${version}/doc/md019.md`,
|
||||||
"errorDetail": null,
|
"errorDetail": null,
|
||||||
"errorContext": "## Heading 3 {MD019}",
|
"errorContext": "## Heading 3 {MD019}",
|
||||||
"errorRange": [ 1, 6 ] }
|
"errorRange": [ 1, 6 ] },
|
||||||
|
{ "lineNumber": 1,
|
||||||
|
"ruleName": "MD041",
|
||||||
|
"ruleAlias": "first-line-heading",
|
||||||
|
"ruleDescription": "First line in a file should be a top-level heading",
|
||||||
|
"ruleInformation": `${homepage}/blob/v${version}/doc/md041.md`,
|
||||||
|
"errorDetail": null,
|
||||||
|
"errorContext": "#Heading 1 {MD018}",
|
||||||
|
"errorRange": null }
|
||||||
],
|
],
|
||||||
"./test/first_heading_bad_atx.md": [
|
"./test/first_heading_bad_atx.md": [
|
||||||
{ "lineNumber": 1,
|
{ "lineNumber": 1,
|
||||||
"ruleName": "MD002",
|
"ruleName": "MD041",
|
||||||
"ruleAlias": "first-heading-h1",
|
"ruleAlias": "first-line-heading",
|
||||||
"ruleDescription": "First heading should be a top-level heading",
|
"ruleDescription": "First line in a file should be a top-level heading",
|
||||||
"ruleInformation": `${homepage}/blob/v${version}/doc/md002.md`,
|
"ruleInformation": `${homepage}/blob/v${version}/doc/md041.md`,
|
||||||
"errorDetail": "Expected: h1; Actual: h2",
|
"errorDetail": null,
|
||||||
"errorContext": null,
|
"errorContext": "## Heading",
|
||||||
"errorRange": null }
|
"errorRange": null }
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
t.deepEqual(actualResult, expectedResult, "Undetected issues.");
|
t.deepEqual(actualResult, expectedResult, "Undetected issues.");
|
||||||
|
// @ts-ignore
|
||||||
const actualMessage = actualResult.toString();
|
const actualMessage = actualResult.toString();
|
||||||
const expectedMessage =
|
const expectedMessage =
|
||||||
"./test/atx_heading_spacing.md: 3: MD002/first-heading-h1" +
|
|
||||||
" First heading should be a top-level heading" +
|
|
||||||
" [Expected: h1; Actual: h2]\n" +
|
|
||||||
"./test/atx_heading_spacing.md: 1: MD018/no-missing-space-atx" +
|
"./test/atx_heading_spacing.md: 1: MD018/no-missing-space-atx" +
|
||||||
" No space after hash on atx style heading" +
|
" No space after hash on atx style heading" +
|
||||||
" [Context: \"#Heading 1 {MD018}\"]\n" +
|
" [Context: \"#Heading 1 {MD018}\"]\n" +
|
||||||
|
@ -233,9 +229,12 @@ test("resultFormattingV1", (t) => new Promise((resolve) => {
|
||||||
"./test/atx_heading_spacing.md: 5: MD019/no-multiple-space-atx" +
|
"./test/atx_heading_spacing.md: 5: MD019/no-multiple-space-atx" +
|
||||||
" Multiple spaces after hash on atx style heading" +
|
" Multiple spaces after hash on atx style heading" +
|
||||||
" [Context: \"## Heading 3 {MD019}\"]\n" +
|
" [Context: \"## Heading 3 {MD019}\"]\n" +
|
||||||
"./test/first_heading_bad_atx.md: 1: MD002/first-heading-h1" +
|
"./test/atx_heading_spacing.md: 1: MD041/first-line-heading" +
|
||||||
" First heading should be a top-level heading" +
|
" First line in a file should be a top-level heading" +
|
||||||
" [Expected: h1; Actual: h2]\n" +
|
" [Context: \"#Heading 1 {MD018}\"]\n" +
|
||||||
|
"./test/first_heading_bad_atx.md: 1: MD041/first-line-heading" +
|
||||||
|
" First line in a file should be a top-level heading" +
|
||||||
|
" [Context: \"## Heading\"]\n" +
|
||||||
"truncate: 1: MD021/no-multiple-space-closed-atx" +
|
"truncate: 1: MD021/no-multiple-space-closed-atx" +
|
||||||
" Multiple spaces inside hashes on closed atx style heading" +
|
" Multiple spaces inside hashes on closed atx style heading" +
|
||||||
" [Context: \"# Multiple spa...tyle heading #\"]";
|
" [Context: \"# Multiple spa...tyle heading #\"]";
|
||||||
|
@ -256,8 +255,7 @@ test("resultFormattingV2", (t) => new Promise((resolve) => {
|
||||||
"./test/first_heading_bad_atx.md"
|
"./test/first_heading_bad_atx.md"
|
||||||
],
|
],
|
||||||
"config": {
|
"config": {
|
||||||
"MD002": true,
|
"MD041": true
|
||||||
"MD041": false
|
|
||||||
},
|
},
|
||||||
"noInlineConfig": true,
|
"noInlineConfig": true,
|
||||||
"resultVersion": 2
|
"resultVersion": 2
|
||||||
|
@ -276,13 +274,6 @@ test("resultFormattingV2", (t) => new Promise((resolve) => {
|
||||||
"errorRange": [ 1, 4 ] }
|
"errorRange": [ 1, 4 ] }
|
||||||
],
|
],
|
||||||
"./test/atx_heading_spacing.md": [
|
"./test/atx_heading_spacing.md": [
|
||||||
{ "lineNumber": 3,
|
|
||||||
"ruleNames": [ "MD002", "first-heading-h1", "first-header-h1" ],
|
|
||||||
"ruleDescription": "First heading should be a top-level heading",
|
|
||||||
"ruleInformation": `${homepage}/blob/v${version}/doc/md002.md`,
|
|
||||||
"errorDetail": "Expected: h1; Actual: h2",
|
|
||||||
"errorContext": null,
|
|
||||||
"errorRange": null },
|
|
||||||
{ "lineNumber": 1,
|
{ "lineNumber": 1,
|
||||||
"ruleNames": [ "MD018", "no-missing-space-atx" ],
|
"ruleNames": [ "MD018", "no-missing-space-atx" ],
|
||||||
"ruleDescription": "No space after hash on atx style heading",
|
"ruleDescription": "No space after hash on atx style heading",
|
||||||
|
@ -303,25 +294,29 @@ test("resultFormattingV2", (t) => new Promise((resolve) => {
|
||||||
"ruleInformation": `${homepage}/blob/v${version}/doc/md019.md`,
|
"ruleInformation": `${homepage}/blob/v${version}/doc/md019.md`,
|
||||||
"errorDetail": null,
|
"errorDetail": null,
|
||||||
"errorContext": "## Heading 3 {MD019}",
|
"errorContext": "## Heading 3 {MD019}",
|
||||||
"errorRange": [ 1, 6 ] }
|
"errorRange": [ 1, 6 ] },
|
||||||
|
{ "lineNumber": 1,
|
||||||
|
"ruleNames": [ "MD041", "first-line-heading", "first-line-h1" ],
|
||||||
|
"ruleDescription": "First line in a file should be a top-level heading",
|
||||||
|
"ruleInformation": `${homepage}/blob/v${version}/doc/md041.md`,
|
||||||
|
"errorDetail": null,
|
||||||
|
"errorContext": "#Heading 1 {MD018}",
|
||||||
|
"errorRange": null }
|
||||||
],
|
],
|
||||||
"./test/first_heading_bad_atx.md": [
|
"./test/first_heading_bad_atx.md": [
|
||||||
{ "lineNumber": 1,
|
{ "lineNumber": 1,
|
||||||
"ruleNames": [ "MD002", "first-heading-h1", "first-header-h1" ],
|
"ruleNames": [ "MD041", "first-line-heading", "first-line-h1" ],
|
||||||
"ruleDescription": "First heading should be a top-level heading",
|
"ruleDescription": "First line in a file should be a top-level heading",
|
||||||
"ruleInformation": `${homepage}/blob/v${version}/doc/md002.md`,
|
"ruleInformation": `${homepage}/blob/v${version}/doc/md041.md`,
|
||||||
"errorDetail": "Expected: h1; Actual: h2",
|
"errorDetail": null,
|
||||||
"errorContext": null,
|
"errorContext": "## Heading",
|
||||||
"errorRange": null }
|
"errorRange": null }
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
t.deepEqual(actualResult, expectedResult, "Undetected issues.");
|
t.deepEqual(actualResult, expectedResult, "Undetected issues.");
|
||||||
|
// @ts-ignore
|
||||||
const actualMessage = actualResult.toString();
|
const actualMessage = actualResult.toString();
|
||||||
const expectedMessage =
|
const expectedMessage =
|
||||||
"./test/atx_heading_spacing.md: 3:" +
|
|
||||||
" MD002/first-heading-h1/first-header-h1" +
|
|
||||||
" First heading should be a top-level heading" +
|
|
||||||
" [Expected: h1; Actual: h2]\n" +
|
|
||||||
"./test/atx_heading_spacing.md: 1: MD018/no-missing-space-atx" +
|
"./test/atx_heading_spacing.md: 1: MD018/no-missing-space-atx" +
|
||||||
" No space after hash on atx style heading" +
|
" No space after hash on atx style heading" +
|
||||||
" [Context: \"#Heading 1 {MD018}\"]\n" +
|
" [Context: \"#Heading 1 {MD018}\"]\n" +
|
||||||
|
@ -331,10 +326,14 @@ test("resultFormattingV2", (t) => new Promise((resolve) => {
|
||||||
"./test/atx_heading_spacing.md: 5: MD019/no-multiple-space-atx" +
|
"./test/atx_heading_spacing.md: 5: MD019/no-multiple-space-atx" +
|
||||||
" Multiple spaces after hash on atx style heading" +
|
" Multiple spaces after hash on atx style heading" +
|
||||||
" [Context: \"## Heading 3 {MD019}\"]\n" +
|
" [Context: \"## Heading 3 {MD019}\"]\n" +
|
||||||
|
"./test/atx_heading_spacing.md: 1:" +
|
||||||
|
" MD041/first-line-heading/first-line-h1" +
|
||||||
|
" First line in a file should be a top-level heading" +
|
||||||
|
" [Context: \"#Heading 1 {MD018}\"]\n" +
|
||||||
"./test/first_heading_bad_atx.md: 1:" +
|
"./test/first_heading_bad_atx.md: 1:" +
|
||||||
" MD002/first-heading-h1/first-header-h1" +
|
" MD041/first-line-heading/first-line-h1" +
|
||||||
" First heading should be a top-level heading" +
|
" First line in a file should be a top-level heading" +
|
||||||
" [Expected: h1; Actual: h2]\n" +
|
" [Context: \"## Heading\"]\n" +
|
||||||
"truncate: 1: MD021/no-multiple-space-closed-atx" +
|
"truncate: 1: MD021/no-multiple-space-closed-atx" +
|
||||||
" Multiple spaces inside hashes on closed atx style heading" +
|
" Multiple spaces inside hashes on closed atx style heading" +
|
||||||
" [Context: \"# Multiple spa...tyle heading #\"]";
|
" [Context: \"# Multiple spa...tyle heading #\"]";
|
||||||
|
@ -442,6 +441,7 @@ test("resultFormattingV3", (t) => new Promise((resolve) => {
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
t.deepEqual(actualResult, expectedResult, "Undetected issues.");
|
t.deepEqual(actualResult, expectedResult, "Undetected issues.");
|
||||||
|
// @ts-ignore
|
||||||
const actualMessage = actualResult.toString();
|
const actualMessage = actualResult.toString();
|
||||||
const expectedMessage =
|
const expectedMessage =
|
||||||
"input: 1: MD009/no-trailing-spaces" +
|
"input: 1: MD009/no-trailing-spaces" +
|
||||||
|
|
|
@ -82,11 +82,12 @@ test("projectFiles", (t) => {
|
||||||
"schema/*.md"
|
"schema/*.md"
|
||||||
]))
|
]))
|
||||||
.then((files) => {
|
.then((files) => {
|
||||||
t.is(files.length, 59);
|
t.is(files.length, 57);
|
||||||
const options = {
|
const options = {
|
||||||
files,
|
files,
|
||||||
"config": require("../.markdownlint.json")
|
"config": require("../.markdownlint.json")
|
||||||
};
|
};
|
||||||
|
// @ts-ignore
|
||||||
return markdownlint.promises.markdownlint(options).then((actual) => {
|
return markdownlint.promises.markdownlint(options).then((actual) => {
|
||||||
const expected = {};
|
const expected = {};
|
||||||
for (const file of files) {
|
for (const file of files) {
|
||||||
|
@ -270,7 +271,7 @@ test("enableRules", (t) => new Promise((resolve) => {
|
||||||
"./test/first_heading_bad_atx.md"
|
"./test/first_heading_bad_atx.md"
|
||||||
],
|
],
|
||||||
"config": {
|
"config": {
|
||||||
"MD002": true,
|
"MD041": true,
|
||||||
"default": false,
|
"default": false,
|
||||||
"no-multiple-space-atx": true
|
"no-multiple-space-atx": true
|
||||||
},
|
},
|
||||||
|
@ -281,11 +282,11 @@ test("enableRules", (t) => new Promise((resolve) => {
|
||||||
t.falsy(err);
|
t.falsy(err);
|
||||||
const expectedResult = {
|
const expectedResult = {
|
||||||
"./test/atx_heading_spacing.md": {
|
"./test/atx_heading_spacing.md": {
|
||||||
"MD002": [ 3 ],
|
"MD019": [ 3, 5 ],
|
||||||
"MD019": [ 3, 5 ]
|
"MD041": [ 1 ]
|
||||||
},
|
},
|
||||||
"./test/first_heading_bad_atx.md": {
|
"./test/first_heading_bad_atx.md": {
|
||||||
"MD002": [ 1 ]
|
"MD041": [ 1 ]
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
|
@ -302,7 +303,7 @@ test("enableRulesMixedCase", (t) => new Promise((resolve) => {
|
||||||
"./test/first_heading_bad_atx.md"
|
"./test/first_heading_bad_atx.md"
|
||||||
],
|
],
|
||||||
"config": {
|
"config": {
|
||||||
"Md002": true,
|
"Md041": true,
|
||||||
"DeFaUlT": false,
|
"DeFaUlT": false,
|
||||||
"nO-mUlTiPlE-sPaCe-AtX": true
|
"nO-mUlTiPlE-sPaCe-AtX": true
|
||||||
},
|
},
|
||||||
|
@ -313,11 +314,11 @@ test("enableRulesMixedCase", (t) => new Promise((resolve) => {
|
||||||
t.falsy(err);
|
t.falsy(err);
|
||||||
const expectedResult = {
|
const expectedResult = {
|
||||||
"./test/atx_heading_spacing.md": {
|
"./test/atx_heading_spacing.md": {
|
||||||
"MD002": [ 3 ],
|
"MD019": [ 3, 5 ],
|
||||||
"MD019": [ 3, 5 ]
|
"MD041": [ 1 ]
|
||||||
},
|
},
|
||||||
"./test/first_heading_bad_atx.md": {
|
"./test/first_heading_bad_atx.md": {
|
||||||
"MD002": [ 1 ]
|
"MD041": [ 1 ]
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
|
@ -474,7 +475,7 @@ test("styleAll", (t) => new Promise((resolve) => {
|
||||||
"MD042": [ 81 ],
|
"MD042": [ 81 ],
|
||||||
"MD045": [ 85 ],
|
"MD045": [ 85 ],
|
||||||
"MD046": [ 49, 73, 77 ],
|
"MD046": [ 49, 73, 77 ],
|
||||||
"MD047": [ 128 ],
|
"MD047": [ 126 ],
|
||||||
"MD048": [ 77 ],
|
"MD048": [ 77 ],
|
||||||
"MD049": [ 90 ],
|
"MD049": [ 90 ],
|
||||||
"MD050": [ 94 ],
|
"MD050": [ 94 ],
|
||||||
|
@ -523,7 +524,7 @@ test("styleRelaxed", (t) => new Promise((resolve) => {
|
||||||
"MD042": [ 81 ],
|
"MD042": [ 81 ],
|
||||||
"MD045": [ 85 ],
|
"MD045": [ 85 ],
|
||||||
"MD046": [ 49, 73, 77 ],
|
"MD046": [ 49, 73, 77 ],
|
||||||
"MD047": [ 128 ],
|
"MD047": [ 126 ],
|
||||||
"MD048": [ 77 ],
|
"MD048": [ 77 ],
|
||||||
"MD049": [ 90 ],
|
"MD049": [ 90 ],
|
||||||
"MD050": [ 94 ],
|
"MD050": [ 94 ],
|
||||||
|
@ -839,7 +840,7 @@ test("customFileSystemAsync", (t) => new Promise((resolve) => {
|
||||||
}));
|
}));
|
||||||
|
|
||||||
test("readme", async(t) => {
|
test("readme", async(t) => {
|
||||||
t.plan(126);
|
t.plan(122);
|
||||||
const tagToRules = {};
|
const tagToRules = {};
|
||||||
for (const rule of rules) {
|
for (const rule of rules) {
|
||||||
for (const tag of rule.tags) {
|
for (const tag of rule.tags) {
|
||||||
|
@ -914,7 +915,7 @@ test("readme", async(t) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
test("validateJsonUsingConfigSchemaStrict", async(t) => {
|
test("validateJsonUsingConfigSchemaStrict", async(t) => {
|
||||||
t.plan(168);
|
t.plan(165);
|
||||||
const { addSchema, validate } =
|
const { addSchema, validate } =
|
||||||
await import("@hyperjump/json-schema/draft-07");
|
await import("@hyperjump/json-schema/draft-07");
|
||||||
addSchema(configSchemaStrict, configSchemaStrictUri);
|
addSchema(configSchemaStrict, configSchemaStrictUri);
|
||||||
|
@ -1042,7 +1043,7 @@ test("validateConfigExampleJson", async(t) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
test("allBuiltInRulesHaveValidUrl", (t) => {
|
test("allBuiltInRulesHaveValidUrl", (t) => {
|
||||||
t.plan(150);
|
t.plan(144);
|
||||||
for (const rule of rules) {
|
for (const rule of rules) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
t.truthy(rule.information);
|
t.truthy(rule.information);
|
||||||
|
|
|
@ -7,9 +7,6 @@ title: "First level heading"
|
||||||
## Second level heading
|
## Second level heading
|
||||||
|
|
||||||
<!-- markdownlint-configure-file {
|
<!-- markdownlint-configure-file {
|
||||||
"first-heading-h1": {
|
|
||||||
"level": 2
|
|
||||||
},
|
|
||||||
"first-line-heading": {
|
"first-line-heading": {
|
||||||
"level": 2
|
"level": 2
|
||||||
}
|
}
|
||||||
|
|
|
@ -105,20 +105,6 @@ Generated by [AVA](https://avajs.dev).
|
||||||
'header-increment',
|
'header-increment',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
|
||||||
errorContext: null,
|
|
||||||
errorDetail: 'Expected: h1; Actual: h2',
|
|
||||||
errorRange: null,
|
|
||||||
fixInfo: null,
|
|
||||||
lineNumber: 1,
|
|
||||||
ruleDescription: 'First heading should be a top-level heading',
|
|
||||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md002.md',
|
|
||||||
ruleNames: [
|
|
||||||
'MD002',
|
|
||||||
'first-heading-h1',
|
|
||||||
'first-header-h1',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
errorContext: null,
|
errorContext: null,
|
||||||
errorDetail: 'Expected: atx; Actual: atx_closed',
|
errorDetail: 'Expected: atx; Actual: atx_closed',
|
||||||
|
@ -209,42 +195,6 @@ Generated by [AVA](https://avajs.dev).
|
||||||
'list-indent',
|
'list-indent',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
|
||||||
errorContext: null,
|
|
||||||
errorDetail: 'Expected: 0; Actual: 1',
|
|
||||||
errorRange: [
|
|
||||||
1,
|
|
||||||
3,
|
|
||||||
],
|
|
||||||
fixInfo: {
|
|
||||||
deleteCount: 1,
|
|
||||||
},
|
|
||||||
lineNumber: 12,
|
|
||||||
ruleDescription: 'Consider starting bulleted lists at the beginning of the line',
|
|
||||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md006.md',
|
|
||||||
ruleNames: [
|
|
||||||
'MD006',
|
|
||||||
'ul-start-left',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
errorContext: null,
|
|
||||||
errorDetail: 'Expected: 0; Actual: 1',
|
|
||||||
errorRange: [
|
|
||||||
1,
|
|
||||||
3,
|
|
||||||
],
|
|
||||||
fixInfo: {
|
|
||||||
deleteCount: 1,
|
|
||||||
},
|
|
||||||
lineNumber: 13,
|
|
||||||
ruleDescription: 'Consider starting bulleted lists at the beginning of the line',
|
|
||||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md006.md',
|
|
||||||
ruleNames: [
|
|
||||||
'MD006',
|
|
||||||
'ul-start-left',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
errorContext: null,
|
errorContext: null,
|
||||||
errorDetail: 'Expected: 0; Actual: 1',
|
errorDetail: 'Expected: 0; Actual: 1',
|
||||||
|
@ -345,7 +295,7 @@ Generated by [AVA](https://avajs.dev).
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
fixed: `## One {MD002}␊
|
fixed: `## One␊
|
||||||
␊
|
␊
|
||||||
#### Two {MD001}␊
|
#### Two {MD001}␊
|
||||||
␊
|
␊
|
||||||
|
@ -356,8 +306,8 @@ Generated by [AVA](https://avajs.dev).
|
||||||
␊
|
␊
|
||||||
* Charlie {MD004}␊
|
* Charlie {MD004}␊
|
||||||
␊
|
␊
|
||||||
* Delta {MD006} {MD007}␊
|
* Delta {MD007}␊
|
||||||
* Echo {MD006} {MD007}␊
|
* Echo {MD007}␊
|
||||||
␊
|
␊
|
||||||
Text {MD009}␊
|
Text {MD009}␊
|
||||||
␊
|
␊
|
||||||
|
@ -377,8 +327,6 @@ Generated by [AVA](https://avajs.dev).
|
||||||
12. Twelve␊
|
12. Twelve␊
|
||||||
␊
|
␊
|
||||||
<!-- markdownlint-configure-file {␊
|
<!-- markdownlint-configure-file {␊
|
||||||
"first-heading-h1": true,␊
|
|
||||||
"ul-start-left": true,␊
|
|
||||||
"first-line-heading": false␊
|
"first-line-heading": false␊
|
||||||
} -->␊
|
} -->␊
|
||||||
`,
|
`,
|
||||||
|
@ -2642,9 +2590,6 @@ Generated by [AVA](https://avajs.dev).
|
||||||
## Another one {MD025}␊
|
## Another one {MD025}␊
|
||||||
␊
|
␊
|
||||||
<!-- markdownlint-configure-file {␊
|
<!-- markdownlint-configure-file {␊
|
||||||
"first-heading-h1": {␊
|
|
||||||
"level": 2␊
|
|
||||||
},␊
|
|
||||||
"single-title": {␊
|
"single-title": {␊
|
||||||
"level": 2␊
|
"level": 2␊
|
||||||
},␊
|
},␊
|
||||||
|
@ -3052,7 +2997,6 @@ Generated by [AVA](https://avajs.dev).
|
||||||
## Heading 10 {MD003} \\#␊
|
## Heading 10 {MD003} \\#␊
|
||||||
␊
|
␊
|
||||||
<!-- markdownlint-configure-file {␊
|
<!-- markdownlint-configure-file {␊
|
||||||
"first-heading-h1": false,␊
|
|
||||||
"first-line-heading": false␊
|
"first-line-heading": false␊
|
||||||
} -->␊
|
} -->␊
|
||||||
`,
|
`,
|
||||||
|
@ -3129,7 +3073,6 @@ Generated by [AVA](https://avajs.dev).
|
||||||
## Heading 3 {MD019}␊
|
## Heading 3 {MD019}␊
|
||||||
␊
|
␊
|
||||||
<!-- markdownlint-configure-file {␊
|
<!-- markdownlint-configure-file {␊
|
||||||
"first-heading-h1": false,␊
|
|
||||||
"first-line-heading": false␊
|
"first-line-heading": false␊
|
||||||
} -->␊
|
} -->␊
|
||||||
`,
|
`,
|
||||||
|
@ -6564,20 +6507,6 @@ Generated by [AVA](https://avajs.dev).
|
||||||
'header-increment',
|
'header-increment',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
|
||||||
errorContext: null,
|
|
||||||
errorDetail: 'Expected: h1; Actual: h2',
|
|
||||||
errorRange: null,
|
|
||||||
fixInfo: null,
|
|
||||||
lineNumber: 1,
|
|
||||||
ruleDescription: 'First heading should be a top-level heading',
|
|
||||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md002.md',
|
|
||||||
ruleNames: [
|
|
||||||
'MD002',
|
|
||||||
'first-heading-h1',
|
|
||||||
'first-header-h1',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
errorContext: null,
|
errorContext: null,
|
||||||
errorDetail: 'Expected: atx; Actual: atx_closed',
|
errorDetail: 'Expected: atx; Actual: atx_closed',
|
||||||
|
@ -6642,24 +6571,6 @@ Generated by [AVA](https://avajs.dev).
|
||||||
'list-indent',
|
'list-indent',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
|
||||||
errorContext: null,
|
|
||||||
errorDetail: 'Expected: 0; Actual: 1',
|
|
||||||
errorRange: [
|
|
||||||
1,
|
|
||||||
4,
|
|
||||||
],
|
|
||||||
fixInfo: {
|
|
||||||
deleteCount: 1,
|
|
||||||
},
|
|
||||||
lineNumber: 8,
|
|
||||||
ruleDescription: 'Consider starting bulleted lists at the beginning of the line',
|
|
||||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md006.md',
|
|
||||||
ruleNames: [
|
|
||||||
'MD006',
|
|
||||||
'ul-start-left',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
errorContext: null,
|
errorContext: null,
|
||||||
errorDetail: 'Expected: 0; Actual: 1',
|
errorDetail: 'Expected: 0; Actual: 1',
|
||||||
|
@ -7060,7 +6971,7 @@ Generated by [AVA](https://avajs.dev).
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
errorContext: '+ list {MD004} {MD006} {MD007...',
|
errorContext: '+ list {MD004} {MD007} {MD030...',
|
||||||
errorDetail: null,
|
errorDetail: null,
|
||||||
errorRange: null,
|
errorRange: null,
|
||||||
fixInfo: {
|
fixInfo: {
|
||||||
|
@ -7227,7 +7138,7 @@ Generated by [AVA](https://avajs.dev).
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
errorContext: '## Heading 1 {MD002:1} {MD041:...',
|
errorContext: '## Heading 1 {MD041:1}',
|
||||||
errorDetail: null,
|
errorDetail: null,
|
||||||
errorRange: null,
|
errorRange: null,
|
||||||
fixInfo: null,
|
fixInfo: null,
|
||||||
|
@ -7357,7 +7268,7 @@ Generated by [AVA](https://avajs.dev).
|
||||||
insertText: `␊
|
insertText: `␊
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
lineNumber: 128,
|
lineNumber: 126,
|
||||||
ruleDescription: 'Files should end with a single newline character',
|
ruleDescription: 'Files should end with a single newline character',
|
||||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md047.md',
|
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md047.md',
|
||||||
ruleNames: [
|
ruleNames: [
|
||||||
|
@ -7529,7 +7440,7 @@ Generated by [AVA](https://avajs.dev).
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
fixed: `## Heading 1 {MD002:1} {MD041:1}␊
|
fixed: `## Heading 1 {MD041:1}␊
|
||||||
␊
|
␊
|
||||||
#### Heading 2 {MD001:3}␊
|
#### Heading 2 {MD001:3}␊
|
||||||
␊
|
␊
|
||||||
|
@ -7537,7 +7448,7 @@ Generated by [AVA](https://avajs.dev).
|
||||||
␊
|
␊
|
||||||
* list {MD032}␊
|
* list {MD032}␊
|
||||||
␊
|
␊
|
||||||
* list {MD004} {MD006} {MD007} {MD030} {MD032}␊
|
* list {MD004} {MD007} {MD030} {MD032}␊
|
||||||
␊
|
␊
|
||||||
* list␊
|
* list␊
|
||||||
* list {MD007}␊
|
* list {MD007}␊
|
||||||
|
@ -7566,7 +7477,7 @@ Generated by [AVA](https://avajs.dev).
|
||||||
# Heading 8␊
|
# Heading 8␊
|
||||||
␊
|
␊
|
||||||
{MD024:35}␊
|
{MD024:35}␊
|
||||||
Note: Can not break MD025 and MD002 in the same file␊
|
Note: Can not break MD025 and MD041 in the same file␊
|
||||||
␊
|
␊
|
||||||
# Heading 9 {MD023} {MD026}␊
|
# Heading 9 {MD023} {MD026}␊
|
||||||
␊
|
␊
|
||||||
|
@ -7638,11 +7549,9 @@ Generated by [AVA](https://avajs.dev).
|
||||||
[url]: https://example.com/page␊
|
[url]: https://example.com/page␊
|
||||||
␊
|
␊
|
||||||
<!-- markdownlint-configure-file {␊
|
<!-- markdownlint-configure-file {␊
|
||||||
"first-heading-h1": true,␊
|
|
||||||
"ul-start-left": true,␊
|
|
||||||
"required-headings": {␊
|
"required-headings": {␊
|
||||||
"headings": [␊
|
"headings": [␊
|
||||||
"## Heading 1 {MD002:1} {MD041:1}",␊
|
"## Heading 1 {MD041:1}",␊
|
||||||
"#### Heading 2 {MD001:3}",␊
|
"#### Heading 2 {MD001:3}",␊
|
||||||
"# Broken"␊
|
"# Broken"␊
|
||||||
]␊
|
]␊
|
||||||
|
@ -7786,186 +7695,6 @@ Generated by [AVA](https://avajs.dev).
|
||||||
|
|
||||||
{
|
{
|
||||||
errors: [
|
errors: [
|
||||||
{
|
|
||||||
errorContext: null,
|
|
||||||
errorDetail: 'Expected: 0; Actual: 2',
|
|
||||||
errorRange: [
|
|
||||||
1,
|
|
||||||
4,
|
|
||||||
],
|
|
||||||
fixInfo: {
|
|
||||||
deleteCount: 2,
|
|
||||||
},
|
|
||||||
lineNumber: 15,
|
|
||||||
ruleDescription: 'Consider starting bulleted lists at the beginning of the line',
|
|
||||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md006.md',
|
|
||||||
ruleNames: [
|
|
||||||
'MD006',
|
|
||||||
'ul-start-left',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
errorContext: null,
|
|
||||||
errorDetail: 'Expected: 0; Actual: 2',
|
|
||||||
errorRange: [
|
|
||||||
1,
|
|
||||||
4,
|
|
||||||
],
|
|
||||||
fixInfo: {
|
|
||||||
deleteCount: 2,
|
|
||||||
},
|
|
||||||
lineNumber: 20,
|
|
||||||
ruleDescription: 'Consider starting bulleted lists at the beginning of the line',
|
|
||||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md006.md',
|
|
||||||
ruleNames: [
|
|
||||||
'MD006',
|
|
||||||
'ul-start-left',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
errorContext: null,
|
|
||||||
errorDetail: 'Expected: 0; Actual: 2',
|
|
||||||
errorRange: [
|
|
||||||
1,
|
|
||||||
4,
|
|
||||||
],
|
|
||||||
fixInfo: {
|
|
||||||
deleteCount: 2,
|
|
||||||
},
|
|
||||||
lineNumber: 21,
|
|
||||||
ruleDescription: 'Consider starting bulleted lists at the beginning of the line',
|
|
||||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md006.md',
|
|
||||||
ruleNames: [
|
|
||||||
'MD006',
|
|
||||||
'ul-start-left',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
errorContext: null,
|
|
||||||
errorDetail: 'Expected: 0; Actual: 2',
|
|
||||||
errorRange: [
|
|
||||||
1,
|
|
||||||
4,
|
|
||||||
],
|
|
||||||
fixInfo: {
|
|
||||||
deleteCount: 2,
|
|
||||||
},
|
|
||||||
lineNumber: 30,
|
|
||||||
ruleDescription: 'Consider starting bulleted lists at the beginning of the line',
|
|
||||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md006.md',
|
|
||||||
ruleNames: [
|
|
||||||
'MD006',
|
|
||||||
'ul-start-left',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
errorContext: null,
|
|
||||||
errorDetail: 'Expected: 0; Actual: 1',
|
|
||||||
errorRange: [
|
|
||||||
1,
|
|
||||||
3,
|
|
||||||
],
|
|
||||||
fixInfo: {
|
|
||||||
deleteCount: 1,
|
|
||||||
},
|
|
||||||
lineNumber: 41,
|
|
||||||
ruleDescription: 'Consider starting bulleted lists at the beginning of the line',
|
|
||||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md006.md',
|
|
||||||
ruleNames: [
|
|
||||||
'MD006',
|
|
||||||
'ul-start-left',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
errorContext: null,
|
|
||||||
errorDetail: 'Expected: 0; Actual: 1',
|
|
||||||
errorRange: [
|
|
||||||
1,
|
|
||||||
3,
|
|
||||||
],
|
|
||||||
fixInfo: {
|
|
||||||
deleteCount: 1,
|
|
||||||
},
|
|
||||||
lineNumber: 42,
|
|
||||||
ruleDescription: 'Consider starting bulleted lists at the beginning of the line',
|
|
||||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md006.md',
|
|
||||||
ruleNames: [
|
|
||||||
'MD006',
|
|
||||||
'ul-start-left',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
errorContext: null,
|
|
||||||
errorDetail: 'Expected: 0; Actual: 1',
|
|
||||||
errorRange: [
|
|
||||||
1,
|
|
||||||
3,
|
|
||||||
],
|
|
||||||
fixInfo: {
|
|
||||||
deleteCount: 1,
|
|
||||||
},
|
|
||||||
lineNumber: 43,
|
|
||||||
ruleDescription: 'Consider starting bulleted lists at the beginning of the line',
|
|
||||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md006.md',
|
|
||||||
ruleNames: [
|
|
||||||
'MD006',
|
|
||||||
'ul-start-left',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
errorContext: null,
|
|
||||||
errorDetail: 'Expected: 0; Actual: 2',
|
|
||||||
errorRange: [
|
|
||||||
1,
|
|
||||||
4,
|
|
||||||
],
|
|
||||||
fixInfo: {
|
|
||||||
deleteCount: 2,
|
|
||||||
},
|
|
||||||
lineNumber: 55,
|
|
||||||
ruleDescription: 'Consider starting bulleted lists at the beginning of the line',
|
|
||||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md006.md',
|
|
||||||
ruleNames: [
|
|
||||||
'MD006',
|
|
||||||
'ul-start-left',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
errorContext: null,
|
|
||||||
errorDetail: 'Expected: 0; Actual: 2',
|
|
||||||
errorRange: [
|
|
||||||
1,
|
|
||||||
4,
|
|
||||||
],
|
|
||||||
fixInfo: {
|
|
||||||
deleteCount: 2,
|
|
||||||
},
|
|
||||||
lineNumber: 57,
|
|
||||||
ruleDescription: 'Consider starting bulleted lists at the beginning of the line',
|
|
||||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md006.md',
|
|
||||||
ruleNames: [
|
|
||||||
'MD006',
|
|
||||||
'ul-start-left',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
errorContext: null,
|
|
||||||
errorDetail: 'Expected: 0; Actual: 2',
|
|
||||||
errorRange: [
|
|
||||||
1,
|
|
||||||
4,
|
|
||||||
],
|
|
||||||
fixInfo: {
|
|
||||||
deleteCount: 2,
|
|
||||||
},
|
|
||||||
lineNumber: 59,
|
|
||||||
ruleDescription: 'Consider starting bulleted lists at the beginning of the line',
|
|
||||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md006.md',
|
|
||||||
ruleNames: [
|
|
||||||
'MD006',
|
|
||||||
'ul-start-left',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
errorContext: null,
|
errorContext: null,
|
||||||
errorDetail: 'Expected: 0; Actual: 2',
|
errorDetail: 'Expected: 0; Actual: 2',
|
||||||
|
@ -8281,13 +8010,13 @@ Generated by [AVA](https://avajs.dev).
|
||||||
␊
|
␊
|
||||||
Text␊
|
Text␊
|
||||||
␊
|
␊
|
||||||
* Item {MD006} {MD007}␊
|
|
||||||
* Item {MD007}␊
|
* Item {MD007}␊
|
||||||
* Item {MD007}␊
|
* Item {MD007}␊
|
||||||
* Item {MD007}␊
|
* Item {MD007}␊
|
||||||
* Item {MD007}␊
|
* Item {MD007}␊
|
||||||
* Item {MD006} {MD007}␊
|
* Item {MD007}␊
|
||||||
* Item {MD006} {MD007}␊
|
* Item {MD007}␊
|
||||||
|
* Item {MD007}␊
|
||||||
␊
|
␊
|
||||||
Text␊
|
Text␊
|
||||||
␊
|
␊
|
||||||
|
@ -8296,7 +8025,7 @@ Generated by [AVA](https://avajs.dev).
|
||||||
␊
|
␊
|
||||||
Text␊
|
Text␊
|
||||||
␊
|
␊
|
||||||
* Item {MD006} {MD007}␊
|
* Item {MD007}␊
|
||||||
* Item {MD007}␊
|
* Item {MD007}␊
|
||||||
␊
|
␊
|
||||||
Text␊
|
Text␊
|
||||||
|
@ -8307,9 +8036,9 @@ Generated by [AVA](https://avajs.dev).
|
||||||
␊
|
␊
|
||||||
Text␊
|
Text␊
|
||||||
␊
|
␊
|
||||||
* Item {MD006} {MD007}␊
|
* Item {MD007}␊
|
||||||
* Item {MD006} {MD007}␊
|
* Item {MD007}␊
|
||||||
* Item {MD006} {MD007}␊
|
* Item {MD007}␊
|
||||||
␊
|
␊
|
||||||
Text␊
|
Text␊
|
||||||
␊
|
␊
|
||||||
|
@ -8321,15 +8050,11 @@ Generated by [AVA](https://avajs.dev).
|
||||||
␊
|
␊
|
||||||
Text␊
|
Text␊
|
||||||
␊
|
␊
|
||||||
* Item {MD006} {MD007}␊
|
* Item {MD007}␊
|
||||||
␊
|
␊
|
||||||
* Item {MD006} {MD007}␊
|
* Item {MD007}␊
|
||||||
␊
|
␊
|
||||||
* Item {MD006} {MD007}␊
|
* Item {MD007}␊
|
||||||
␊
|
|
||||||
<!-- markdownlint-configure-file {␊
|
|
||||||
"ul-start-left": true␊
|
|
||||||
} -->␊
|
|
||||||
`,
|
`,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13470,9 +13195,6 @@ Generated by [AVA](https://avajs.dev).
|
||||||
Front matter from [Jekyll documentation](https://jekyllrb.com/docs/posts/#a-typical-post).␊
|
Front matter from [Jekyll documentation](https://jekyllrb.com/docs/posts/#a-typical-post).␊
|
||||||
␊
|
␊
|
||||||
<!-- markdownlint-configure-file {␊
|
<!-- markdownlint-configure-file {␊
|
||||||
"first-heading-h1": {␊
|
|
||||||
"level": 2␊
|
|
||||||
},␊
|
|
||||||
"line-length": false␊
|
"line-length": false␊
|
||||||
} -->␊
|
} -->␊
|
||||||
`,
|
`,
|
||||||
|
@ -28470,7 +28192,6 @@ Generated by [AVA](https://avajs.dev).
|
||||||
* item 3 {MD007}␊
|
* item 3 {MD007}␊
|
||||||
␊
|
␊
|
||||||
<!-- markdownlint-configure-file {␊
|
<!-- markdownlint-configure-file {␊
|
||||||
"ul-start-left": false,␊
|
|
||||||
"ul-indent": {␊
|
"ul-indent": {␊
|
||||||
"indent": 3,␊
|
"indent": 3,␊
|
||||||
"start_indented": true␊
|
"start_indented": true␊
|
||||||
|
@ -29041,60 +28762,6 @@ Generated by [AVA](https://avajs.dev).
|
||||||
'list-indent',
|
'list-indent',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
|
||||||
errorContext: null,
|
|
||||||
errorDetail: 'Expected: 0; Actual: 2',
|
|
||||||
errorRange: [
|
|
||||||
1,
|
|
||||||
4,
|
|
||||||
],
|
|
||||||
fixInfo: {
|
|
||||||
deleteCount: 2,
|
|
||||||
},
|
|
||||||
lineNumber: 50,
|
|
||||||
ruleDescription: 'Consider starting bulleted lists at the beginning of the line',
|
|
||||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md006.md',
|
|
||||||
ruleNames: [
|
|
||||||
'MD006',
|
|
||||||
'ul-start-left',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
errorContext: null,
|
|
||||||
errorDetail: 'Expected: 0; Actual: 2',
|
|
||||||
errorRange: [
|
|
||||||
1,
|
|
||||||
4,
|
|
||||||
],
|
|
||||||
fixInfo: {
|
|
||||||
deleteCount: 2,
|
|
||||||
},
|
|
||||||
lineNumber: 51,
|
|
||||||
ruleDescription: 'Consider starting bulleted lists at the beginning of the line',
|
|
||||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md006.md',
|
|
||||||
ruleNames: [
|
|
||||||
'MD006',
|
|
||||||
'ul-start-left',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
errorContext: null,
|
|
||||||
errorDetail: 'Expected: 0; Actual: 2',
|
|
||||||
errorRange: [
|
|
||||||
1,
|
|
||||||
4,
|
|
||||||
],
|
|
||||||
fixInfo: {
|
|
||||||
deleteCount: 2,
|
|
||||||
},
|
|
||||||
lineNumber: 56,
|
|
||||||
ruleDescription: 'Consider starting bulleted lists at the beginning of the line',
|
|
||||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md006.md',
|
|
||||||
ruleNames: [
|
|
||||||
'MD006',
|
|
||||||
'ul-start-left',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
errorContext: null,
|
errorContext: null,
|
||||||
errorDetail: 'Expected: 2; Actual: 4',
|
errorDetail: 'Expected: 2; Actual: 4',
|
||||||
|
@ -29545,17 +29212,13 @@ Generated by [AVA](https://avajs.dev).
|
||||||
␊
|
␊
|
||||||
## Invalid Indentation - Should Start at Zero␊
|
## Invalid Indentation - Should Start at Zero␊
|
||||||
␊
|
␊
|
||||||
- item 1 {MD006} {MD007}␊
|
- item 1 {MD007}␊
|
||||||
- item 2 {MD006} {MD007}␊
|
- item 2 {MD007}␊
|
||||||
- item 2.1 {MD007}␊
|
- item 2.1 {MD007}␊
|
||||||
- item 2.2 {MD007}␊
|
- item 2.2 {MD007}␊
|
||||||
- item 2.2.1 {MD007}␊
|
- item 2.2.1 {MD007}␊
|
||||||
- item 2.3 {MD007}␊
|
- item 2.3 {MD007}␊
|
||||||
- item 3 {MD006} {MD007}␊
|
- item 3 {MD007}␊
|
||||||
␊
|
|
||||||
<!-- markdownlint-configure-file {␊
|
|
||||||
"ul-start-left": true␊
|
|
||||||
} -->␊
|
|
||||||
`,
|
`,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32772,78 +32435,6 @@ Generated by [AVA](https://avajs.dev).
|
||||||
'ul-style',
|
'ul-style',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
|
||||||
errorContext: null,
|
|
||||||
errorDetail: 'Expected: 0; Actual: 2',
|
|
||||||
errorRange: [
|
|
||||||
1,
|
|
||||||
4,
|
|
||||||
],
|
|
||||||
fixInfo: {
|
|
||||||
deleteCount: 2,
|
|
||||||
},
|
|
||||||
lineNumber: 22,
|
|
||||||
ruleDescription: 'Consider starting bulleted lists at the beginning of the line',
|
|
||||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md006.md',
|
|
||||||
ruleNames: [
|
|
||||||
'MD006',
|
|
||||||
'ul-start-left',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
errorContext: null,
|
|
||||||
errorDetail: 'Expected: 0; Actual: 1',
|
|
||||||
errorRange: [
|
|
||||||
1,
|
|
||||||
3,
|
|
||||||
],
|
|
||||||
fixInfo: {
|
|
||||||
deleteCount: 1,
|
|
||||||
},
|
|
||||||
lineNumber: 97,
|
|
||||||
ruleDescription: 'Consider starting bulleted lists at the beginning of the line',
|
|
||||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md006.md',
|
|
||||||
ruleNames: [
|
|
||||||
'MD006',
|
|
||||||
'ul-start-left',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
errorContext: null,
|
|
||||||
errorDetail: 'Expected: 0; Actual: 1',
|
|
||||||
errorRange: [
|
|
||||||
1,
|
|
||||||
3,
|
|
||||||
],
|
|
||||||
fixInfo: {
|
|
||||||
deleteCount: 1,
|
|
||||||
},
|
|
||||||
lineNumber: 98,
|
|
||||||
ruleDescription: 'Consider starting bulleted lists at the beginning of the line',
|
|
||||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md006.md',
|
|
||||||
ruleNames: [
|
|
||||||
'MD006',
|
|
||||||
'ul-start-left',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
errorContext: null,
|
|
||||||
errorDetail: 'Expected: 0; Actual: 1',
|
|
||||||
errorRange: [
|
|
||||||
1,
|
|
||||||
3,
|
|
||||||
],
|
|
||||||
fixInfo: {
|
|
||||||
deleteCount: 1,
|
|
||||||
},
|
|
||||||
lineNumber: 99,
|
|
||||||
ruleDescription: 'Consider starting bulleted lists at the beginning of the line',
|
|
||||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md006.md',
|
|
||||||
ruleNames: [
|
|
||||||
'MD006',
|
|
||||||
'ul-start-left',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
errorContext: null,
|
errorContext: null,
|
||||||
errorDetail: 'Expected: 0; Actual: 2',
|
errorDetail: 'Expected: 0; Actual: 2',
|
||||||
|
@ -33008,7 +32599,7 @@ Generated by [AVA](https://avajs.dev).
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
errorContext: '- two {MD006} {MD007} {MD032}',
|
errorContext: '- two {MD007} {MD032}',
|
||||||
errorDetail: null,
|
errorDetail: null,
|
||||||
errorRange: null,
|
errorRange: null,
|
||||||
fixInfo: {
|
fixInfo: {
|
||||||
|
@ -33024,7 +32615,7 @@ Generated by [AVA](https://avajs.dev).
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
errorContext: '- two {MD006} {MD007} {MD032}',
|
errorContext: '- two {MD007} {MD032}',
|
||||||
errorDetail: null,
|
errorDetail: null,
|
||||||
errorRange: null,
|
errorRange: null,
|
||||||
fixInfo: {
|
fixInfo: {
|
||||||
|
@ -33081,7 +32672,7 @@ Generated by [AVA](https://avajs.dev).
|
||||||
␊
|
␊
|
||||||
1. one {MD032}␊
|
1. one {MD032}␊
|
||||||
␊
|
␊
|
||||||
- two {MD006} {MD007} {MD032}␊
|
- two {MD007} {MD032}␊
|
||||||
␊
|
␊
|
||||||
1. three {MD032}␊
|
1. three {MD032}␊
|
||||||
␊
|
␊
|
||||||
|
@ -33157,13 +32748,9 @@ Generated by [AVA](https://avajs.dev).
|
||||||
1. seven␊
|
1. seven␊
|
||||||
- eight␊
|
- eight␊
|
||||||
␊
|
␊
|
||||||
- 1. Item {MD004} {MD006} {MD007}␊
|
- 1. Item {MD004} {MD007}␊
|
||||||
- 2. Item {MD004} {MD006} {MD007}␊
|
- 2. Item {MD004} {MD007}␊
|
||||||
- 3. Item {MD004} {MD006} {MD007}␊
|
- 3. Item {MD004} {MD007}␊
|
||||||
␊
|
|
||||||
<!-- markdownlint-configure-file {␊
|
|
||||||
"ul-start-left": true␊
|
|
||||||
} -->␊
|
|
||||||
`,
|
`,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36309,9 +35896,6 @@ Generated by [AVA](https://avajs.dev).
|
||||||
## Second level heading␊
|
## Second level heading␊
|
||||||
␊
|
␊
|
||||||
<!-- markdownlint-configure-file {␊
|
<!-- markdownlint-configure-file {␊
|
||||||
"first-heading-h1": {␊
|
|
||||||
"level": 2␊
|
|
||||||
},␊
|
|
||||||
"first-line-heading": {␊
|
"first-line-heading": {␊
|
||||||
"level": 2␊
|
"level": 2␊
|
||||||
}␊
|
}␊
|
||||||
|
@ -50379,9 +49963,6 @@ Generated by [AVA](https://avajs.dev).
|
||||||
Long line long line long line long line long line long line long line long line long line long line {MD013}␊
|
Long line long line long line long line long line long line long line long line long line long line {MD013}␊
|
||||||
␊
|
␊
|
||||||
<!-- markdownlint-configure-file {␊
|
<!-- markdownlint-configure-file {␊
|
||||||
"first-heading-h1": {␊
|
|
||||||
"level": "1"␊
|
|
||||||
},␊
|
|
||||||
"heading-style": {␊
|
"heading-style": {␊
|
||||||
"style": 0␊
|
"style": 0␊
|
||||||
},␊
|
},␊
|
||||||
|
|
Binary file not shown.
|
@ -3,9 +3,6 @@
|
||||||
Long line long line long line long line long line long line long line long line long line long line {MD013}
|
Long line long line long line long line long line long line long line long line long line long line {MD013}
|
||||||
|
|
||||||
<!-- markdownlint-configure-file {
|
<!-- markdownlint-configure-file {
|
||||||
"first-heading-h1": {
|
|
||||||
"level": "1"
|
|
||||||
},
|
|
||||||
"heading-style": {
|
"heading-style": {
|
||||||
"style": 0
|
"style": 0
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue