Commit graph

269 commits

Author SHA1 Message Date
David Anson
a1785270fa Add error/warning severity property to LintError object. 2025-09-13 17:03:00 -07:00
David Anson
480958352e Update string format output by formatLintResults to match markdownlint-cli2 (and markdownlint-cli).
Some checks are pending
Checkers / linkcheck (push) Waiting to run
Checkers / spellcheck (push) Waiting to run
CI / build (20, macos-latest) (push) Waiting to run
CI / build (20, ubuntu-latest) (push) Waiting to run
CI / build (20, windows-latest) (push) Waiting to run
CI / build (22, macos-latest) (push) Waiting to run
CI / build (22, ubuntu-latest) (push) Waiting to run
CI / build (22, windows-latest) (push) Waiting to run
CI / build (24, macos-latest) (push) Waiting to run
CI / build (24, ubuntu-latest) (push) Waiting to run
CI / build (24, windows-latest) (push) Waiting to run
CI / pnpm (push) Waiting to run
CodeQL / Analyze (push) Waiting to run
TestRepos / build (latest, ubuntu-latest) (push) Waiting to run
UpdateTestRepos / update (push) Waiting to run
2025-09-09 21:07:24 -07:00
David Anson
616c3f2c22 Deprecate LintResults.toString() (at edit time; continue to support at run time), provide helper function formatLintResults, remove outdated grunt/gulp samples, improve typing.
Some checks failed
Checkers / linkcheck (push) Has been cancelled
Checkers / spellcheck (push) Has been cancelled
CI / build (20, macos-latest) (push) Has been cancelled
CI / build (20, ubuntu-latest) (push) Has been cancelled
CI / build (20, windows-latest) (push) Has been cancelled
CI / build (22, macos-latest) (push) Has been cancelled
CI / build (22, ubuntu-latest) (push) Has been cancelled
CI / build (22, windows-latest) (push) Has been cancelled
CI / build (24, macos-latest) (push) Has been cancelled
CI / build (24, ubuntu-latest) (push) Has been cancelled
CI / build (24, windows-latest) (push) Has been cancelled
CI / pnpm (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
TestRepos / build (latest, ubuntu-latest) (push) Has been cancelled
UpdateTestRepos / update (push) Has been cancelled
2025-09-08 21:13:50 -07:00
David Anson
bfd89b77de Deprecate options.resultVersion via typing, continue to support at run-time, provide format converters in markdownlint/helpers for migration.
Some checks failed
Checkers / linkcheck (push) Has been cancelled
Checkers / spellcheck (push) Has been cancelled
CI / build (20, macos-latest) (push) Has been cancelled
CI / build (20, ubuntu-latest) (push) Has been cancelled
CI / build (20, windows-latest) (push) Has been cancelled
CI / build (22, macos-latest) (push) Has been cancelled
CI / build (22, ubuntu-latest) (push) Has been cancelled
CI / build (22, windows-latest) (push) Has been cancelled
CI / build (24, macos-latest) (push) Has been cancelled
CI / build (24, ubuntu-latest) (push) Has been cancelled
CI / build (24, windows-latest) (push) Has been cancelled
CI / pnpm (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
TestRepos / build (latest, ubuntu-latest) (push) Has been cancelled
UpdateTestRepos / update (push) Has been cancelled
2025-08-28 22:08:32 -07:00
David Anson
442afe4466 Update MD007/ul-indent to account for 4-space base indent within footnote definitions (fixes #1679). 2025-08-03 15:38:25 -07:00
David Anson
4ecbf9d945 Normalize newline characters so Linux and Windows trim error context consistently. 2025-05-04 23:41:36 -07:00
David Anson
cdfa934d8d Centralize handling of newlines in error detail/context to always replace (consecutive) newlines with a single space. 2025-05-04 23:28:43 -07:00
David Anson
224987d727 Update to version 0.38.0. 2025-05-02 20:22:08 -07:00
David Anson
6adfaf68b5 Update MD025/single-title and MD051/link-fragments to ignore headings that exactly match Docfx tab syntax (fixes #1099) (fixes #1101). 2025-05-01 22:09:36 -07:00
David Anson
d5cb5c8546 Update getHeadingText helper to exclude HTML comments from returned heading text (fixes #1411). 2025-03-04 21:04:33 -08:00
David Anson
d02090db2c Remove outdated use of "@ts-expect-error https://github.com/microsoft/TypeScript/issues/52529". 2025-03-03 22:57:01 -08:00
David Anson
571c2353ea Update new rule MD059/descriptive-link-text for project-level consistency. 2025-02-13 22:11:42 -08:00
David Anson
3cbe1cb6c5 Refactor micromark parse code to stop using micromark's TokenizeContext.sliceSerialize (less well supported) in favor of Token.start/end.offset. 2025-02-08 14:43:38 -08:00
David Anson
a4c553a45a Update to version 0.37.4. 2025-01-14 23:39:35 -08:00
David Anson
74b1c195e3 Update to version 0.37.3. 2024-12-30 19:48:55 -08:00
David Anson
5fad452106 Update to version 0.37.2. 2024-12-18 21:31:43 -08:00
David Anson
8ad4698536 Update MD032/blanks-around-lists to ignore (end-appended) undefined reference tokens when determining the last line of a list (fixes #1453). 2024-12-16 20:54:37 -08:00
David Anson
af086995ed Update to version 0.37.1. 2024-12-14 20:16:59 -08:00
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