Commit graph

251 commits

Author SHA1 Message Date
David Anson
8b26129d55 Convert types.d.mts from ambient module declaration to module augmentation which enables VS Code to handle @type {import("markdownlint").Rule} (https://www.typescriptlang.org/docs/handbook/modules/reference.html#ambient-modules), fix broken markdownlint @typedefs in helpers/*.cjs. 2024-12-10 21:47:06 -08:00
David Anson
015b34ff09 Update helpers to version 0.28.0. 2024-12-07 18:23:52 -08:00
David Anson
62073a8fde Update to version 0.37.0. 2024-12-07 18:12:13 -08:00
David Anson
8da43dd246 Update to use named exports via / /async /promise /sync, simplify references via self-referencing, refine examples. 2024-12-03 19:58:47 -08:00
David Anson
3599f694ba Move micromark-parse.mjs from helpers to library, remove all dependencies from helpers. 2024-11-30 20:42:14 -08:00
David Anson
1e71f6f44e Convert markdownlint library to an ECMAScript module, replace markdownlint-micromark with micromark, stop publishing (large) markdownlint-browser.js, see https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c for guidance. 2024-11-29 18:29:21 -08:00
David Anson
368cb1be5f Update to version 0.36.1. 2024-10-27 22:10:33 -07:00
David Anson
e708143a28 Update to version 0.36.0. 2024-10-25 19:59:23 -07:00
David Anson
16512bba25 Reorder operations in getDescendantsByType helper for ~1% runtime reduction. 2024-10-23 22:05:44 -07:00
David Anson
e6e799d145 Reorder checks in filterByTypes helper predicate for ~2% runtime reduction. 2024-10-23 21:44:36 -07:00
David Anson
d94b78e6bf Refactor getEvents slightly to avoid modifying the MicromarkParseOptions object. 2024-10-22 22:03:05 -07:00
David Anson
38b4ec0c2f Refactor use of micromark so token stream is authentic by shimming undefined link reference handling, remove no-longer-necessary parse operation in MD034. 2024-10-21 20:56:22 -07:00
David Anson
effab8d513 Internal type-only rename for clarity. 2024-10-19 15:28:05 -07:00
David Anson
5e1b269fa5 Refactor to freeze parser tokens only when custom rules are present (negligable performance improvement). 2024-10-11 22:18:51 -07:00
David Anson
d22c1f19ef Refactor various code to do shallow/constrained search instead of deep search for better performance, make cache key for filterByTypesCached unique. 2024-10-09 22:42:36 -07:00
David Anson
c5d4a3297f Move single use, not explicitly tested helpers into the file that uses them. 2024-10-06 20:59:28 -07:00
David Anson
4e30462216 Promote applyFix and applyFixes helpers into core library. 2024-10-06 17:24:44 -07:00
David Anson
e0219411c6 Refactor RegExps to avoid the possibility of polynomial backtracking (fixes #657). 2024-10-05 18:07:45 -07:00
David Anson
9b1840a5a4 Improve type-correctness of some helpers. 2024-10-04 23:05:34 -07:00
David Anson
5182911acc Refactor to remove helpers addErrorContextForLine and blockquotePrefixRe, add micromark helper getBlockQuotePrefixText. 2024-10-04 22:41:46 -07:00
David Anson
5cc40c54b7 Enable custom rules to use the micromark parser, export micromark helpers for reuse. 2024-10-01 22:53:46 -07:00
David Anson
33631a5984 Split micromark.cjs into separate -parse and -helpers files. 2024-09-28 16:26:38 -07:00
David Anson
5701d0bf52 Prepare to split micromark.cjs into separate -parse and -helpers files. 2024-09-28 15:57:25 -07:00
David Anson
97effd921e Refactor helpers slightly for consistency. 2024-09-28 15:55:26 -07:00
David Anson
124b7e2276 Refactor to remove helper withinAnyRange. 2024-09-28 15:41:40 -07:00
David Anson
5e568d0da9 Refactor to remove micromark helper getExclusionsForToken. 2024-09-27 23:58:49 -07:00
David Anson
8cbbed8e79 Refactor to remove micromark helper getTokenTextByType, update getDescendantsByType to allow sub-arrays. 2024-09-24 22:48:14 -07:00
David Anson
87daa5b06c Refactor to remove micromark helper matchAndGetTokensByType. 2024-09-18 21:02:59 -07:00
David Anson
2ea3f95fd1 Refactor micromark helper getTokenTextByType to be more efficient, remove tokenIfType helper for being redundant. 2024-09-16 20:50:54 -07:00
David Anson
98ff66209d Move markdown-it token manipulation code into a separate file which is only require()-ed if/when needed. 2024-09-14 17:33:46 -07:00
David Anson
fe02674ce0 Update to version 0.35.0. 2024-08-28 20:41:14 -07:00
David Anson
7aac5b0553 Refactor to remove flattenedLists, indentFor, listItemMarkerRe, orderedListItemMarkerRe, rangeFromRegExp, and unorderedListStyleFor helpers, reimplement MD004/MD029 using micromark tokens. 2024-08-20 21:36:17 -07:00
David Anson
55729cfcf7 Remove filterTokens helper (now used only by tests). 2024-08-18 15:34:26 -07:00
David Anson
c8fd9eb4b3 Refactor to remove forEachLine and getLineMetadata helpers, reimplement MD012/MD018/MD020/MD031 using micromark tokens. 2024-08-17 17:58:16 -07:00
David Anson
7efc2605b1 Refactor to remove codeBlockAndSpanRanges helper. 2024-08-15 21:34:27 -07:00
David Anson
3b581a7f6d Reimplement MD013/line-length using micromark tokens. 2024-08-13 20:57:00 -07:00
David Anson
4072cf7417 Reimplement MD009/no-trailing-spaces using micromark tokens. 2024-08-12 23:24:46 -07:00
Fu Yuchen
6c8d0fdef8
Update MD018/no-missing-space-atx and MD020/no-missing-space-closed-atx to ignore the content of HTML blocks (fixes #1268). 2024-07-20 14:38:45 +09:00
David Anson
964e4c80ab Reimplement MD042/no-empty-links using micromark tokens. 2024-06-30 16:10:48 -07:00
David Anson
96354678dc Reimplement MD024/no-duplicate-heading using micromark tokens. 2024-06-19 21:05:50 -07:00
David Anson
0b165c1566 Reimplement MD021/no-multiple-space-closed-atx using micromark tokens. 2024-06-15 15:45:31 -07:00
David Anson
106ca0bc90 Make inHtmlFlow more efficient and simplify filterByTypes implementation. 2024-06-10 22:16:20 -07:00
David Anson
12502f6571 Exclude htmlFlow content by default for filterByTypes, opt in as needed. 2024-06-09 17:09:03 -07:00
David Anson
6daaa43410 Reimplement MD003/heading-style using micromark tokens. 2024-06-08 14:44:49 -07:00
David Anson
26466108e9 Add new rule MD058/blanks-around-tables (fixes #132). 2024-06-03 21:16:45 -07:00
David Anson
0f55b9aec8 Remove outdated ESLint suppression. 2024-04-22 20:58:54 -07:00
David Anson
b2305efafb Update to version 0.34.0. 2024-03-20 20:44:38 -07:00
David Anson
82441faa91 Reimplement MD036/no-emphasis-as-heading using micromark tokens. 2024-03-19 21:20:53 -07:00
David Anson
a83e2d8a09 Reimplement MD041/first-line-heading/first-line-h1 using micromark tokens. 2024-03-18 20:48:32 -07:00
David Anson
d5994ae4de Add Rule.parser property for custom rules to specify which Markdown parser output they use, honor it strictly, and add full type support. 2024-03-13 20:55:57 -07:00