diff --git a/.github/dictionary.txt b/.github/dictionary.txt index d7b3f729..b6f938aa 100644 --- a/.github/dictionary.txt +++ b/.github/dictionary.txt @@ -33,8 +33,6 @@ ES2015 ES6 ESLint eslint-plugin-markdownlint -first-header-h1 -first-heading-h1 first-line-h1 formatter fs diff --git a/README.md b/README.md index f76bf63e..79a2c526 100644 --- a/README.md +++ b/README.md @@ -87,11 +87,9 @@ playground for learning and exploring. - **[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 - **[MD004](doc/md004.md)** *ul-style* - Unordered list style - **[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 - **[MD009](doc/md009.md)** *no-trailing-spaces* - Trailing spaces - **[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. -~~Struck through~~ rules are deprecated and provided for backward-compatibility. - > 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`). > The use of `header` is deprecated and provided for backward-compatibility. @@ -166,19 +162,18 @@ rules at once. - **`atx_closed`** - `MD020`, `MD021` - **`blank_lines`** - `MD012`, `MD022`, `MD031`, `MD032`, `MD047` - **`blockquote`** - `MD027`, `MD028` -- **`bullet`** - `MD004`, `MD005`, `MD006`, `MD007`, `MD032` +- **`bullet`** - `MD004`, `MD005`, `MD007`, `MD032` - **`code`** - `MD014`, `MD031`, `MD038`, `MD040`, `MD046`, `MD048` - **`emphasis`** - `MD036`, `MD037`, `MD049`, `MD050` - **`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` -- **`headings`** - `MD001`, `MD002`, `MD003`, `MD018`, `MD019`, `MD020`, - `MD021`, `MD022`, `MD023`, `MD024`, `MD025`, `MD026`, `MD036`, `MD041`, - `MD043` - **`hr`** - `MD035` - **`html`** - `MD033` - **`images`** - `MD045`, `MD052`, `MD053`, `MD054` -- **`indentation`** - `MD005`, `MD006`, `MD007`, `MD027` +- **`indentation`** - `MD005`, `MD007`, `MD027` - **`language`** - `MD040` - **`line_length`** - `MD013` - **`links`** - `MD011`, `MD034`, `MD039`, `MD042`, `MD051`, `MD052`, `MD053`, @@ -186,7 +181,7 @@ rules at once. - **`ol`** - `MD029`, `MD030`, `MD032` - **`spaces`** - `MD018`, `MD019`, `MD020`, `MD021`, `MD023` - **`spelling`** - `MD044` -- **`ul`** - `MD004`, `MD005`, `MD006`, `MD007`, `MD030`, `MD032` +- **`ul`** - `MD004`, `MD005`, `MD007`, `MD030`, `MD032` - **`url`** - `MD034` - **`whitespace`** - `MD009`, `MD010`, `MD012`, `MD027`, `MD028`, `MD030`, `MD037`, `MD038`, `MD039` diff --git a/demo/default.js b/demo/default.js index 99b420a9..9f859ccb 100644 --- a/demo/default.js +++ b/demo/default.js @@ -228,7 +228,6 @@ "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).", - "> ([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", diff --git a/demo/markdownlint-browser.js b/demo/markdownlint-browser.js index 9c1084d9..8c4a914b 100644 --- a/demo/markdownlint-browser.js +++ b/demo/markdownlint-browser.js @@ -1654,8 +1654,8 @@ module.exports.referenceLinkImageData = function () { -module.exports.deprecatedRuleNames = ["MD002", "MD006"]; -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.deprecatedRuleNames = []; +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.version = "0.31.1"; @@ -1694,8 +1694,7 @@ var _require = __webpack_require__(/*! node:util */ "?39e5"), promisify = _require.promisify; var markdownit = __webpack_require__(/*! markdown-it */ "markdown-it"); var micromark = __webpack_require__(/*! ../helpers/micromark.cjs */ "../helpers/micromark.cjs"); -var _require2 = __webpack_require__(/*! ./constants */ "../lib/constants.js"), - deprecatedRuleNames = _require2.deprecatedRuleNames; +// const { deprecatedRuleNames } = require("./constants"); var rules = __webpack_require__(/*! ./rules */ "../lib/rules.js"); var helpers = __webpack_require__(/*! ../helpers */ "../helpers/helpers.js"); var cache = __webpack_require__(/*! ./cache */ "../lib/cache.js"); @@ -2116,23 +2115,14 @@ function getEffectiveConfig(ruleList, config, aliasToRuleNames) { var _ruleName2 = rule.names[0].toUpperCase(); effectiveConfig[_ruleName2] = ruleDefault; } + // for (const ruleName of deprecatedRuleNames) { + // effectiveConfig[ruleName] = false; + // } } catch (err) { _iterator14.e(err); } finally { _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++) { var key = _Object$keys[_i5]; var value = config[key]; @@ -2144,17 +2134,17 @@ function getEffectiveConfig(ruleList, config, aliasToRuleNames) { value = false; } var keyUpper = key.toUpperCase(); - var _iterator16 = _createForOfIteratorHelper(aliasToRuleNames[keyUpper] || []), - _step16; + var _iterator15 = _createForOfIteratorHelper(aliasToRuleNames[keyUpper] || []), + _step15; try { - for (_iterator16.s(); !(_step16 = _iterator16.n()).done;) { - var ruleName = _step16.value; + for (_iterator15.s(); !(_step15 = _iterator15.n()).done;) { + var ruleName = _step15.value; effectiveConfig[ruleName] = value; } } catch (err) { - _iterator16.e(err); + _iterator15.e(err); } finally { - _iterator16.f(); + _iterator15.f(); } } return effectiveConfig; @@ -2215,13 +2205,13 @@ function getEnabledRulesPerLineNumber(ruleList, lines, frontMatterLines, noInlin // Helper functions // eslint-disable-next-line jsdoc/require-jsdoc function handleInlineConfig(input, forEachMatch, forEachLine) { - var _iterator17 = _createForOfIteratorHelper(input.entries()), - _step17; + var _iterator16 = _createForOfIteratorHelper(input.entries()), + _step16; try { - for (_iterator17.s(); !(_step17 = _iterator17.n()).done;) { - var _step17$value = _slicedToArray(_step17.value, 2), - lineIndex = _step17$value[0], - line = _step17$value[1]; + for (_iterator16.s(); !(_step16 = _iterator16.n()).done;) { + var _step16$value = _slicedToArray(_step16.value, 2), + lineIndex = _step16$value[0], + line = _step16$value[1]; if (!noInlineConfig) { var match = null; while (match = helpers.inlineCommentStartRe.exec(line)) { @@ -2240,9 +2230,9 @@ function getEnabledRulesPerLineNumber(ruleList, lines, frontMatterLines, noInlin } } } catch (err) { - _iterator17.e(err); + _iterator16.e(err); } finally { - _iterator17.f(); + _iterator16.f(); } } // eslint-disable-next-line jsdoc/require-jsdoc @@ -2261,28 +2251,28 @@ function getEnabledRulesPerLineNumber(ruleList, lines, frontMatterLines, noInlin var enabled = action.startsWith("ENABLE"); var trimmed = parameter && parameter.trim(); var items = trimmed ? trimmed.toUpperCase().split(/\s+/) : allRuleNames; - var _iterator18 = _createForOfIteratorHelper(items), - _step18; + var _iterator17 = _createForOfIteratorHelper(items), + _step17; try { - for (_iterator18.s(); !(_step18 = _iterator18.n()).done;) { - var nameUpper = _step18.value; - var _iterator19 = _createForOfIteratorHelper(aliasToRuleNames[nameUpper] || []), - _step19; + for (_iterator17.s(); !(_step17 = _iterator17.n()).done;) { + var nameUpper = _step17.value; + var _iterator18 = _createForOfIteratorHelper(aliasToRuleNames[nameUpper] || []), + _step18; try { - for (_iterator19.s(); !(_step19 = _iterator19.n()).done;) { - var ruleName = _step19.value; + for (_iterator18.s(); !(_step18 = _iterator18.n()).done;) { + var ruleName = _step18.value; state[ruleName] = enabled; } } catch (err) { - _iterator19.e(err); + _iterator18.e(err); } finally { - _iterator19.f(); + _iterator18.f(); } } } catch (err) { - _iterator18.e(err); + _iterator17.e(err); } finally { - _iterator18.f(); + _iterator17.f(); } return state; } @@ -2318,19 +2308,19 @@ function getEnabledRulesPerLineNumber(ruleList, lines, frontMatterLines, noInlin // Handle inline comments handleInlineConfig([lines.join("\n")], configureFile); var effectiveConfig = getEffectiveConfig(ruleList, config, aliasToRuleNames); - var _iterator20 = _createForOfIteratorHelper(ruleList), - _step20; + var _iterator19 = _createForOfIteratorHelper(ruleList), + _step19; try { - for (_iterator20.s(); !(_step20 = _iterator20.n()).done;) { - var rule = _step20.value; + for (_iterator19.s(); !(_step19 = _iterator19.n()).done;) { + var rule = _step19.value; var ruleName = rule.names[0].toUpperCase(); allRuleNames.push(ruleName); enabledRules[ruleName] = !!effectiveConfig[ruleName]; } } catch (err) { - _iterator20.e(err); + _iterator19.e(err); } finally { - _iterator20.f(); + _iterator19.f(); } capturedRules = enabledRules; handleInlineConfig(lines, enableDisableFile); @@ -2533,51 +2523,51 @@ function lintContent(ruleList, aliasToRuleNames, name, content, md, config, conf if (resultVersion === 0) { // Return a dictionary of rule->[line numbers] var dictionary = {}; - var _iterator21 = _createForOfIteratorHelper(results), - _step21; + var _iterator20 = _createForOfIteratorHelper(results), + _step20; try { - for (_iterator21.s(); !(_step21 = _iterator21.n()).done;) { - var error = _step21.value; + for (_iterator20.s(); !(_step20 = _iterator20.n()).done;) { + var error = _step20.value; var ruleLines = dictionary[error.ruleName] || []; ruleLines.push(error.lineNumber); dictionary[error.ruleName] = ruleLines; } // @ts-ignore } catch (err) { - _iterator21.e(err); + _iterator20.e(err); } finally { - _iterator21.f(); + _iterator20.f(); } results = dictionary; } else if (resultVersion === 1) { // 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), _step22; try { for (_iterator22.s(); !(_step22 = _iterator22.n()).done;) { - var _error = _step22.value; - _error.ruleAlias = _error.ruleNames[1] || _error.ruleName; - delete _error.ruleNames; + var _error2 = _step22.value; + delete _error2.ruleName; } } catch (err) { _iterator22.e(err); } finally { _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; } @@ -2693,18 +2683,18 @@ function lintInput(options, synchronous, callback) { "html": true }); var markdownItPlugins = options.markdownItPlugins || []; - var _iterator24 = _createForOfIteratorHelper(markdownItPlugins), - _step24; + var _iterator23 = _createForOfIteratorHelper(markdownItPlugins), + _step23; try { - for (_iterator24.s(); !(_step24 = _iterator24.n()).done;) { - var plugin = _step24.value; + for (_iterator23.s(); !(_step23 = _iterator23.n()).done;) { + var plugin = _step23.value; // @ts-ignore md.use.apply(md, _toConsumableArray(plugin)); } } catch (err) { - _iterator24.e(err); + _iterator23.e(err); } finally { - _iterator24.f(); + _iterator23.f(); } var fs = options.fs || __webpack_require__(/*! node:fs */ "?d0ee"); 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 ***! @@ -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 ***! @@ -6840,7 +6739,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len var _require = __webpack_require__(/*! ./constants */ "../lib/constants.js"), homepage = _require.homepage, 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 // md056: See https://github.com/markdownlint/markdownlint // md057: See https://github.com/markdownlint/markdownlint diff --git a/doc-build/heading.md b/doc-build/heading.md index 0581c8b7..384d491a 100644 --- a/doc-build/heading.md +++ b/doc-build/heading.md @@ -2,5 +2,4 @@ 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 -versions of the examples. Any rule whose heading is ~~struck through~~ is -deprecated, but still provided for backward-compatibility. +versions of the examples. diff --git a/doc-build/md002.md b/doc-build/md002.md deleted file mode 100644 index c3d6fb24..00000000 --- a/doc-build/md002.md +++ /dev/null @@ -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: . diff --git a/doc-build/md006.md b/doc-build/md006.md deleted file mode 100644 index d6ef6c0f..00000000 --- a/doc-build/md006.md +++ /dev/null @@ -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). diff --git a/doc-build/md007.md b/doc-build/md007.md index add5a93e..7e1cb208 100644 --- a/doc-build/md007.md +++ b/doc-build/md007.md @@ -20,10 +20,9 @@ unordered (otherwise, extra indentation of ordered lists interferes with the rule). 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 -MD006). The `start_indent` parameter allows the first level of lists to be -indented by a different number of spaces than the rest (ignored when -`start_indented` is not set). +the configured number of spaces rather than starting at zero. The `start_indent` +parameter allows the first level of lists to be indented by a different number +of spaces than the rest (ignored when `start_indented` is not set). 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 diff --git a/doc/Rules.md b/doc/Rules.md index 6432d698..5b75acb1 100644 --- a/doc/Rules.md +++ b/doc/Rules.md @@ -2,8 +2,7 @@ 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 -versions of the examples. Any rule whose heading is ~~struck through~~ is -deprecated, but still provided for backward-compatibility. +versions of the examples. @@ -45,46 +44,6 @@ Rationale: Headings represent the structure of a document and can be confusing when skipped - especially for accessibility scenarios. More information: . - - -## ~~`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: . - ## `MD003` - Heading style @@ -255,55 +214,6 @@ the same ending column: Rationale: Violations of this rule can lead to improperly rendered content. - - -## ~~`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). - ## `MD007` - Unordered list indentation @@ -344,10 +254,9 @@ unordered (otherwise, extra indentation of ordered lists interferes with the rule). 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 -MD006). The `start_indent` parameter allows the first level of lists to be -indented by a different number of spaces than the rest (ignored when -`start_indented` is not set). +the configured number of spaces rather than starting at zero. The `start_indent` +parameter allows the first level of lists to be indented by a different number +of spaces than the rest (ignored when `start_indented` is not set). 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 diff --git a/doc/md002.md b/doc/md002.md deleted file mode 100644 index 2de5e6b5..00000000 --- a/doc/md002.md +++ /dev/null @@ -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: . diff --git a/doc/md006.md b/doc/md006.md deleted file mode 100644 index 5549ac60..00000000 --- a/doc/md006.md +++ /dev/null @@ -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). diff --git a/doc/md007.md b/doc/md007.md index aca52080..7dd7ed71 100644 --- a/doc/md007.md +++ b/doc/md007.md @@ -36,10 +36,9 @@ unordered (otherwise, extra indentation of ordered lists interferes with the rule). 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 -MD006). The `start_indent` parameter allows the first level of lists to be -indented by a different number of spaces than the rest (ignored when -`start_indented` is not set). +the configured number of spaces rather than starting at zero. The `start_indent` +parameter allows the first level of lists to be indented by a different number +of spaces than the rest (ignored when `start_indented` is not set). 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 diff --git a/lib/configuration.d.ts b/lib/configuration.d.ts index 8c55c7c4..9427e9bc 100644 --- a/lib/configuration.d.ts +++ b/lib/configuration.d.ts @@ -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 */ "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 */ @@ -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 */ "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 */ @@ -1169,23 +1128,23 @@ export interface Configuration { 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; /** - * 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; /** - * bullet : MD004, MD005, MD006, MD007, MD032 + * bullet : MD004, MD005, MD007, MD032 */ bullet?: boolean; /** - * ul : MD004, MD005, MD006, MD007, MD030, MD032 + * ul : MD004, MD005, MD007, MD030, MD032 */ ul?: boolean; /** - * indentation : MD005, MD006, MD007, MD027 + * indentation : MD005, MD007, MD027 */ indentation?: boolean; /** diff --git a/lib/constants.js b/lib/constants.js index 946230fa..ec878b30 100644 --- a/lib/constants.js +++ b/lib/constants.js @@ -2,14 +2,13 @@ "use strict"; -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" + "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.version = "0.31.1"; diff --git a/lib/markdownlint.js b/lib/markdownlint.js index 03cd0f10..016ffbad 100644 --- a/lib/markdownlint.js +++ b/lib/markdownlint.js @@ -6,7 +6,7 @@ const path = require("node:path"); const { promisify } = require("node:util"); const markdownit = require("markdown-it"); const micromark = require("../helpers/micromark.cjs"); -const { deprecatedRuleNames } = require("./constants"); +// const { deprecatedRuleNames } = require("./constants"); const rules = require("./rules"); const helpers = require("../helpers"); const cache = require("./cache"); @@ -323,9 +323,9 @@ function getEffectiveConfig(ruleList, config, aliasToRuleNames) { const ruleName = rule.names[0].toUpperCase(); effectiveConfig[ruleName] = ruleDefault; } - for (const ruleName of deprecatedRuleNames) { - effectiveConfig[ruleName] = false; - } + // for (const ruleName of deprecatedRuleNames) { + // effectiveConfig[ruleName] = false; + // } for (const key of Object.keys(config)) { let value = config[key]; if (value) { diff --git a/lib/md002.js b/lib/md002.js deleted file mode 100644 index 2073058c..00000000 --- a/lib/md002.js +++ /dev/null @@ -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; - }); - } -}; diff --git a/lib/md006.js b/lib/md006.js deleted file mode 100644 index 8bff486a..00000000 --- a/lib/md006.js +++ /dev/null @@ -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 - }); - } - } - } - } -}; diff --git a/lib/rules.js b/lib/rules.js index 3e5ffc90..eb946277 100644 --- a/lib/rules.js +++ b/lib/rules.js @@ -6,11 +6,9 @@ const { homepage, version } = require("./constants"); const rules = [ require("./md001"), - require("./md002"), require("./md003"), require("./md004"), require("./md005"), - require("./md006"), require("./md007"), require("./md009"), require("./md010"), diff --git a/schema/.markdownlint.jsonc b/schema/.markdownlint.jsonc index 495790cc..e20a7c4d 100644 --- a/schema/.markdownlint.jsonc +++ b/schema/.markdownlint.jsonc @@ -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": 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 @@ -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": 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": { // Spaces for indent diff --git a/schema/.markdownlint.yaml b/schema/.markdownlint.yaml index 378e66d8..2c54d23d 100644 --- a/schema/.markdownlint.yaml +++ b/schema/.markdownlint.yaml @@ -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: 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 @@ -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: 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: # Spaces for indent diff --git a/schema/build-config-schema.js b/schema/build-config-schema.js index 94ee789c..972eacb4 100644 --- a/schema/build-config-schema.js +++ b/schema/build-config-schema.js @@ -58,17 +58,6 @@ for (const rule of rules) { }; let custom = true; switch (rule.names[0]) { - case "MD002": - scheme.properties = { - "level": { - "description": "Heading level", - "type": "integer", - "minimum": 1, - "maximum": 6, - "default": 1 - } - }; - break; case "MD003": scheme.properties = { "style": { diff --git a/schema/markdownlint-config-schema.json b/schema/markdownlint-config-schema.json index 85bf845d..ea72bea7 100644 --- a/schema/markdownlint-config-schema.json +++ b/schema/markdownlint-config-schema.json @@ -36,60 +36,6 @@ "type": "boolean", "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": { "description": "MD003/heading-style/header-style : Heading style : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md003.md", "type": [ @@ -218,16 +164,6 @@ "type": "boolean", "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": { "description": "MD007/ul-indent : Unordered list indentation : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md007.md", "type": [ @@ -1840,27 +1776,27 @@ "additionalProperties": false }, "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", "default": true }, "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", "default": true }, "bullet": { - "description": "bullet : MD004, MD005, MD006, MD007, MD032", + "description": "bullet : MD004, MD005, MD007, MD032", "type": "boolean", "default": true }, "ul": { - "description": "ul : MD004, MD005, MD006, MD007, MD030, MD032", + "description": "ul : MD004, MD005, MD007, MD030, MD032", "type": "boolean", "default": true }, "indentation": { - "description": "indentation : MD005, MD006, MD007, MD027", + "description": "indentation : MD005, MD007, MD027", "type": "boolean", "default": true }, diff --git a/style/relaxed.json b/style/relaxed.json index 590d9193..1070b598 100644 --- a/style/relaxed.json +++ b/style/relaxed.json @@ -4,7 +4,6 @@ "default": true, "whitespace": false, "line_length": false, - "ul-start-left": false, "ul-indent": false, "no-inline-html": false, "no-bare-urls": false, diff --git a/test/MD001-MD010.md b/test/MD001-MD010.md index ae7870e8..d9d90a86 100644 --- a/test/MD001-MD010.md +++ b/test/MD001-MD010.md @@ -1,4 +1,4 @@ -## One {MD002} +## One #### Two {MD001} @@ -9,8 +9,8 @@ - Charlie {MD004} - * Delta {MD006} {MD007} - * Echo {MD006} {MD007} + * Delta {MD007} + * Echo {MD007} Text {MD009} @@ -30,7 +30,5 @@ Text text {MD010} 12. Twelve diff --git a/test/alternate_top_level_heading.md b/test/alternate_top_level_heading.md index 3340b9b8..cc4e755d 100644 --- a/test/alternate_top_level_heading.md +++ b/test/alternate_top_level_heading.md @@ -3,9 +3,6 @@ ## Another one {MD025} diff --git a/test/atx_heading_spacing.md b/test/atx_heading_spacing.md index 8f5a1e62..cbf2aa23 100644 --- a/test/atx_heading_spacing.md +++ b/test/atx_heading_spacing.md @@ -5,6 +5,5 @@ ## Heading 3 {MD019} diff --git a/test/break-all-the-rules.md b/test/break-all-the-rules.md index 5167ce93..426b27a6 100644 --- a/test/break-all-the-rules.md +++ b/test/break-all-the-rules.md @@ -1,11 +1,11 @@ -## Heading 1 {MD002:1} {MD041:1} +## Heading 1 {MD041:1} #### Heading 2 {MD001:3} # Heading 3 {MD003} {MD043} # * list {MD032} - + list {MD004} {MD006} {MD007} {MD030} {MD032} + + list {MD004} {MD007} {MD030} {MD032} * list * list {MD007} @@ -35,7 +35,7 @@ long line long line long line long line long line long line long line long line # Heading 8 {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}. @@ -106,11 +106,9 @@ Strong **with** different style {MD050} [url]: https://example.com/page + * Item {MD007} diff --git a/test/front-matter-title-h2.md b/test/front-matter-title-h2.md index 52417d8a..77342498 100644 --- a/test/front-matter-title-h2.md +++ b/test/front-matter-title-h2.md @@ -9,8 +9,5 @@ categories: jekyll update Front matter from [Jekyll documentation](https://jekyllrb.com/docs/posts/#a-typical-post). diff --git a/test/list-indentation-start-indented-indent.md b/test/list-indentation-start-indented-indent.md index d00e9814..17e5c6cd 100644 --- a/test/list-indentation-start-indented-indent.md +++ b/test/list-indentation-start-indented-indent.md @@ -39,7 +39,6 @@ * item 3 {MD007} + - item 3 {MD007} diff --git a/test/lists-with-nesting.md b/test/lists-with-nesting.md index 5e1f0967..7ccc0154 100644 --- a/test/lists-with-nesting.md +++ b/test/lists-with-nesting.md @@ -19,7 +19,7 @@ - three {MD032} 1. one {MD032} - - two {MD006} {MD007} {MD032} + - two {MD007} {MD032} 1. three {MD032} ## Correct nesting, same type @@ -94,10 +94,6 @@ 1. seven - eight - * 1. Item {MD004} {MD006} {MD007} - * 2. Item {MD004} {MD006} {MD007} - * 3. Item {MD004} {MD006} {MD007} - - + * 1. Item {MD004} {MD007} + * 2. Item {MD004} {MD007} + * 3. Item {MD004} {MD007} diff --git a/test/markdownlint-test-config.js b/test/markdownlint-test-config.js index 2646ab58..123f165f 100644 --- a/test/markdownlint-test-config.js +++ b/test/markdownlint-test-config.js @@ -90,7 +90,7 @@ test("configCustomFileSystem", (t) => new Promise((resolve) => { }; const extendedContent = { "MD001": true, - "MD002": true + "MD041": true }; const fsApi = { "access": (p, m, cb) => { @@ -403,7 +403,7 @@ test("configCustomFileSystemSync", (t) => { }; const extendedContent = { "MD001": true, - "MD002": true + "MD041": true }; const fsApi = { "accessSync": (p) => { @@ -465,7 +465,7 @@ test("configCustomFileSystemPromise", (t) => new Promise((resolve) => { }; const extendedContent = { "MD001": true, - "MD002": true + "MD041": true }; const fsApi = { "access": (p, m, cb) => { @@ -534,7 +534,7 @@ test("extendCustomFileSystemPromise", (t) => new Promise((resolve) => { }; const extendedContent = { "MD001": true, - "MD002": true + "MD041": true }; const fsApi = { "access": (p, m, cb) => { diff --git a/test/markdownlint-test-result-object.js b/test/markdownlint-test-result-object.js index af319884..2192faf2 100644 --- a/test/markdownlint-test-result-object.js +++ b/test/markdownlint-test-result-object.js @@ -33,8 +33,7 @@ test("resultFormattingV0", (t) => new Promise((resolve) => { "./test/first_heading_bad_atx.md" ], "config": { - "MD002": true, - "MD041": false + "MD041": true }, "noInlineConfig": true, "resultVersion": 0 @@ -43,43 +42,44 @@ test("resultFormattingV0", (t) => new Promise((resolve) => { t.falsy(err); const expectedResult = { "./test/atx_heading_spacing.md": { - "MD002": [ 3 ], "MD018": [ 1 ], - "MD019": [ 3, 5 ] + "MD019": [ 3, 5 ], + "MD041": [ 1 ] }, "./test/first_heading_bad_atx.md": { - "MD002": [ 1 ] + "MD041": [ 1 ] } }; // @ts-ignore t.deepEqual(actualResult, expectedResult, "Undetected issues."); + // @ts-ignore let actualMessage = actualResult.toString(); 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" + " No space after hash on atx style heading\n" + "./test/atx_heading_spacing.md: 3: MD019" + " Multiple spaces after hash on atx style heading\n" + "./test/atx_heading_spacing.md: 5: MD019" + " Multiple spaces after hash on atx style heading\n" + - "./test/first_heading_bad_atx.md: 1: MD002" + - " First heading should be a top-level heading"; - t.is(actualMessage, expectedMessage, "Incorrect message (name)."); + "./test/atx_heading_spacing.md: 1: MD041" + + " 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)."); // @ts-ignore actualMessage = actualResult.toString(true); 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" + " No space after hash on atx style heading\n" + "./test/atx_heading_spacing.md: 3: no-multiple-space-atx" + " Multiple spaces after hash on atx style heading\n" + "./test/atx_heading_spacing.md: 5: no-multiple-space-atx" + " Multiple spaces after hash on atx style heading\n" + - "./test/first_heading_bad_atx.md: 1: first-heading-h1" + - " First heading should be a top-level heading"; - t.is(actualMessage, expectedMessage, "Incorrect message (alias)."); + "./test/atx_heading_spacing.md: 1: first-line-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)."); resolve(); }); })); @@ -92,8 +92,7 @@ test("resultFormattingSyncV0", (t) => { "./test/first_heading_bad_atx.md" ], "config": { - "MD002": true, - "MD041": false + "MD041": true }, "noInlineConfig": true, "resultVersion": 0 @@ -101,42 +100,42 @@ test("resultFormattingSyncV0", (t) => { const actualResult = markdownlint.sync(options); const expectedResult = { "./test/atx_heading_spacing.md": { - "MD002": [ 3 ], "MD018": [ 1 ], - "MD019": [ 3, 5 ] + "MD019": [ 3, 5 ], + "MD041": [ 1 ] }, "./test/first_heading_bad_atx.md": { - "MD002": [ 1 ] + "MD041": [ 1 ] } }; // @ts-ignore t.deepEqual(actualResult, expectedResult, "Undetected issues."); let actualMessage = actualResult.toString(); 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" + " No space after hash on atx style heading\n" + "./test/atx_heading_spacing.md: 3: MD019" + " Multiple spaces after hash on atx style heading\n" + "./test/atx_heading_spacing.md: 5: MD019" + " Multiple spaces after hash on atx style heading\n" + - "./test/first_heading_bad_atx.md: 1: MD002" + - " First heading should be a top-level heading"; + "./test/atx_heading_spacing.md: 1: MD041" + + " 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)."); // @ts-ignore actualMessage = actualResult.toString(true); 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" + " No space after hash on atx style heading\n" + "./test/atx_heading_spacing.md: 3: no-multiple-space-atx" + " Multiple spaces after hash on atx style heading\n" + "./test/atx_heading_spacing.md: 5: no-multiple-space-atx" + " Multiple spaces after hash on atx style heading\n" + - "./test/first_heading_bad_atx.md: 1: first-heading-h1" + - " First heading should be a top-level heading"; + "./test/atx_heading_spacing.md: 1: first-line-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)."); }); @@ -152,8 +151,7 @@ test("resultFormattingV1", (t) => new Promise((resolve) => { "./test/first_heading_bad_atx.md" ], "config": { - "MD002": true, - "MD041": false + "MD041": true }, "noInlineConfig": true, "resultVersion": 1 @@ -173,14 +171,6 @@ test("resultFormattingV1", (t) => new Promise((resolve) => { "errorRange": [ 1, 4 ] } ], "./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, "ruleName": "MD018", "ruleAlias": "no-missing-space-atx", @@ -204,26 +194,32 @@ test("resultFormattingV1", (t) => new Promise((resolve) => { "ruleInformation": `${homepage}/blob/v${version}/doc/md019.md`, "errorDetail": null, "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": [ { "lineNumber": 1, - "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, + "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", "errorRange": null } ] }; // @ts-ignore t.deepEqual(actualResult, expectedResult, "Undetected issues."); + // @ts-ignore const actualMessage = actualResult.toString(); 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" + " No space after hash on atx style heading" + " [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" + " Multiple spaces after hash on atx style heading" + " [Context: \"## Heading 3 {MD019}\"]\n" + - "./test/first_heading_bad_atx.md: 1: MD002/first-heading-h1" + - " First heading should be a top-level heading" + - " [Expected: h1; Actual: h2]\n" + + "./test/atx_heading_spacing.md: 1: MD041/first-line-heading" + + " First line in a file should be a top-level heading" + + " [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" + " Multiple spaces inside hashes on closed atx style heading" + " [Context: \"# Multiple spa...tyle heading #\"]"; @@ -256,8 +255,7 @@ test("resultFormattingV2", (t) => new Promise((resolve) => { "./test/first_heading_bad_atx.md" ], "config": { - "MD002": true, - "MD041": false + "MD041": true }, "noInlineConfig": true, "resultVersion": 2 @@ -276,13 +274,6 @@ test("resultFormattingV2", (t) => new Promise((resolve) => { "errorRange": [ 1, 4 ] } ], "./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, "ruleNames": [ "MD018", "no-missing-space-atx" ], "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`, "errorDetail": null, "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": [ { "lineNumber": 1, - "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, + "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", "errorRange": null } ] }; t.deepEqual(actualResult, expectedResult, "Undetected issues."); + // @ts-ignore const actualMessage = actualResult.toString(); 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" + " No space after hash on atx style heading" + " [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" + " Multiple spaces after hash on atx style heading" + " [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:" + - " MD002/first-heading-h1/first-header-h1" + - " First heading should be a top-level heading" + - " [Expected: h1; Actual: h2]\n" + + " MD041/first-line-heading/first-line-h1" + + " First line in a file should be a top-level heading" + + " [Context: \"## Heading\"]\n" + "truncate: 1: MD021/no-multiple-space-closed-atx" + " Multiple spaces inside hashes on closed atx style heading" + " [Context: \"# Multiple spa...tyle heading #\"]"; @@ -442,6 +441,7 @@ test("resultFormattingV3", (t) => new Promise((resolve) => { ] }; t.deepEqual(actualResult, expectedResult, "Undetected issues."); + // @ts-ignore const actualMessage = actualResult.toString(); const expectedMessage = "input: 1: MD009/no-trailing-spaces" + diff --git a/test/markdownlint-test.js b/test/markdownlint-test.js index f34c373e..866e6f1a 100644 --- a/test/markdownlint-test.js +++ b/test/markdownlint-test.js @@ -82,11 +82,12 @@ test("projectFiles", (t) => { "schema/*.md" ])) .then((files) => { - t.is(files.length, 59); + t.is(files.length, 57); const options = { files, "config": require("../.markdownlint.json") }; + // @ts-ignore return markdownlint.promises.markdownlint(options).then((actual) => { const expected = {}; for (const file of files) { @@ -270,7 +271,7 @@ test("enableRules", (t) => new Promise((resolve) => { "./test/first_heading_bad_atx.md" ], "config": { - "MD002": true, + "MD041": true, "default": false, "no-multiple-space-atx": true }, @@ -281,11 +282,11 @@ test("enableRules", (t) => new Promise((resolve) => { t.falsy(err); const expectedResult = { "./test/atx_heading_spacing.md": { - "MD002": [ 3 ], - "MD019": [ 3, 5 ] + "MD019": [ 3, 5 ], + "MD041": [ 1 ] }, "./test/first_heading_bad_atx.md": { - "MD002": [ 1 ] + "MD041": [ 1 ] } }; // @ts-ignore @@ -302,7 +303,7 @@ test("enableRulesMixedCase", (t) => new Promise((resolve) => { "./test/first_heading_bad_atx.md" ], "config": { - "Md002": true, + "Md041": true, "DeFaUlT": false, "nO-mUlTiPlE-sPaCe-AtX": true }, @@ -313,11 +314,11 @@ test("enableRulesMixedCase", (t) => new Promise((resolve) => { t.falsy(err); const expectedResult = { "./test/atx_heading_spacing.md": { - "MD002": [ 3 ], - "MD019": [ 3, 5 ] + "MD019": [ 3, 5 ], + "MD041": [ 1 ] }, "./test/first_heading_bad_atx.md": { - "MD002": [ 1 ] + "MD041": [ 1 ] } }; // @ts-ignore @@ -474,7 +475,7 @@ test("styleAll", (t) => new Promise((resolve) => { "MD042": [ 81 ], "MD045": [ 85 ], "MD046": [ 49, 73, 77 ], - "MD047": [ 128 ], + "MD047": [ 126 ], "MD048": [ 77 ], "MD049": [ 90 ], "MD050": [ 94 ], @@ -523,7 +524,7 @@ test("styleRelaxed", (t) => new Promise((resolve) => { "MD042": [ 81 ], "MD045": [ 85 ], "MD046": [ 49, 73, 77 ], - "MD047": [ 128 ], + "MD047": [ 126 ], "MD048": [ 77 ], "MD049": [ 90 ], "MD050": [ 94 ], @@ -839,7 +840,7 @@ test("customFileSystemAsync", (t) => new Promise((resolve) => { })); test("readme", async(t) => { - t.plan(126); + t.plan(122); const tagToRules = {}; for (const rule of rules) { for (const tag of rule.tags) { @@ -914,7 +915,7 @@ test("readme", async(t) => { }); test("validateJsonUsingConfigSchemaStrict", async(t) => { - t.plan(168); + t.plan(165); const { addSchema, validate } = await import("@hyperjump/json-schema/draft-07"); addSchema(configSchemaStrict, configSchemaStrictUri); @@ -1042,7 +1043,7 @@ test("validateConfigExampleJson", async(t) => { }); test("allBuiltInRulesHaveValidUrl", (t) => { - t.plan(150); + t.plan(144); for (const rule of rules) { // @ts-ignore t.truthy(rule.information); diff --git a/test/md041-yaml-title-and-first-line-heading.md b/test/md041-yaml-title-and-first-line-heading.md index 59318ff9..4ebe67b4 100644 --- a/test/md041-yaml-title-and-first-line-heading.md +++ b/test/md041-yaml-title-and-first-line-heading.md @@ -7,9 +7,6 @@ title: "First level heading" ## Second level heading ␊ `, @@ -2642,9 +2590,6 @@ Generated by [AVA](https://avajs.dev). ## Another one {MD025}␊ ␊ ␊ `, @@ -3129,7 +3073,6 @@ Generated by [AVA](https://avajs.dev). ## Heading 3 {MD019}␊ ␊ ␊ `, @@ -6564,20 +6507,6 @@ Generated by [AVA](https://avajs.dev). '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, errorDetail: 'Expected: atx; Actual: atx_closed', @@ -6642,24 +6571,6 @@ Generated by [AVA](https://avajs.dev). '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, 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, errorRange: null, fixInfo: { @@ -7227,7 +7138,7 @@ Generated by [AVA](https://avajs.dev). ], }, { - errorContext: '## Heading 1 {MD002:1} {MD041:...', + errorContext: '## Heading 1 {MD041:1}', errorDetail: null, errorRange: null, fixInfo: null, @@ -7357,7 +7268,7 @@ Generated by [AVA](https://avajs.dev). insertText: `␊ `, }, - lineNumber: 128, + lineNumber: 126, ruleDescription: 'Files should end with a single newline character', ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md047.md', 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}␊ ␊ @@ -7537,7 +7448,7 @@ Generated by [AVA](https://avajs.dev). ␊ * list {MD032}␊ ␊ - * list {MD004} {MD006} {MD007} {MD030} {MD032}␊ + * list {MD004} {MD007} {MD030} {MD032}␊ ␊ * list␊ * list {MD007}␊ @@ -7566,7 +7477,7 @@ Generated by [AVA](https://avajs.dev). # Heading 8␊ ␊ {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}␊ ␊ @@ -7638,11 +7549,9 @@ Generated by [AVA](https://avajs.dev). [url]: https://example.com/page␊ ␊ ␊ + * Item {MD007}␊ `, } @@ -13470,9 +13195,6 @@ Generated by [AVA](https://avajs.dev). Front matter from [Jekyll documentation](https://jekyllrb.com/docs/posts/#a-typical-post).␊ ␊ ␊ `, @@ -28470,7 +28192,6 @@ Generated by [AVA](https://avajs.dev). * item 3 {MD007}␊ ␊ ␊ + - item 3 {MD007}␊ `, } @@ -32772,78 +32435,6 @@ Generated by [AVA](https://avajs.dev). '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, 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, errorRange: null, fixInfo: { @@ -33024,7 +32615,7 @@ Generated by [AVA](https://avajs.dev). ], }, { - errorContext: '- two {MD006} {MD007} {MD032}', + errorContext: '- two {MD007} {MD032}', errorDetail: null, errorRange: null, fixInfo: { @@ -33081,7 +32672,7 @@ Generated by [AVA](https://avajs.dev). ␊ 1. one {MD032}␊ ␊ - - two {MD006} {MD007} {MD032}␊ + - two {MD007} {MD032}␊ ␊ 1. three {MD032}␊ ␊ @@ -33157,13 +32748,9 @@ Generated by [AVA](https://avajs.dev). 1. seven␊ - eight␊ ␊ - - 1. Item {MD004} {MD006} {MD007}␊ - - 2. Item {MD004} {MD006} {MD007}␊ - - 3. Item {MD004} {MD006} {MD007}␊ - ␊ - ␊ + - 1. Item {MD004} {MD007}␊ + - 2. Item {MD004} {MD007}␊ + - 3. Item {MD004} {MD007}␊ `, } @@ -36309,9 +35896,6 @@ Generated by [AVA](https://avajs.dev). ## Second level heading␊ ␊