Commit graph

159 commits

Author SHA1 Message Date
David Anson
14a7529ce7 Snapshot custom rule definitions to prevent them from changing dynamically. 2023-07-11 22:17:53 -07:00
David Anson
c699b8e22b Allow a custom rule's onError implementation to override that rule's information URL for each error. 2023-07-11 21:45:00 -07:00
David Anson
2ab546bec0 Implement (undocumented, promise-only) extendConfig API for readConfig-like behavior when the Configuration object is already available (i.e., to implement "extends" consistently). 2023-04-03 22:59:06 -07:00
David Anson
e8a85c91f2 Move call to mapAliasToRuleNames higher in the stack to avoid re-computing multiple times for the same input. 2023-03-12 20:50:17 -07:00
David Anson
4b27bac79b Update all references to "params.tokens" to "params.parsers.markdownit.tokens" for clarity. 2023-02-25 15:50:57 -08:00
David Anson
64159fa456 Address new @ts-check warnings in markdownlint-test.js. 2023-02-25 15:50:57 -08:00
David Anson
97f99befb8 Reimplement getReferenceLinkImageData using micromark tokens. 2023-02-25 15:50:57 -08:00
David Anson
c1df46f607 Convert params.parsers.name to params.parsers.name.tokens for clarity/flexibility. 2023-02-25 15:50:56 -08:00
David Anson
08b31da0aa Move micromark.cjs helpers from lib to helpers so it can be used by code in both locations. 2023-02-25 15:50:56 -08:00
David Anson
1461ad6272 Add content parsing via micromark, publish frozen micromark tokens alongside markdown-it tokens, remove assert from micromark wrapper. 2023-02-25 15:50:56 -08:00
David Anson
4c00ffa2f0 Fix new violations from eslint-plugin-unicorn update. 2022-08-15 21:20:27 -07:00
David Anson
5544ea54d7 Remove workaround for markdown-it-texmath issue fixed in @1.0.0. 2022-08-01 18:29:18 -07:00
David Anson
e8cdb5619c Update token annotation to call helpers.forEachInlineCodeSpan only when necessary for ~11% time reduction measured via profile-fixture.mjs on GitHub Codespaces. 2022-06-17 05:29:12 +00:00
David Anson
a14df5aa5f Remove unused parameter to helpers.getReferenceLinkImageData. 2022-06-12 18:39:28 -07:00
David Anson
312f4b8c6d Address new TypeScript warnings from VS Code. 2022-06-11 22:40:45 -07:00
David Anson
936c876810 Remove helpers.deepFreeze and call Object.freeze only on things that need it for ~11% time reduction measured via profile-fixture.mjs on Apple Silicon M1. 2022-06-09 23:56:44 -07:00
David Anson
b6471fba31 Enable ESLint rule unicorn/no-array-for-each, auto-fix all violations, manually address new issues for ~4% time reduction measured via profile-fixture.mjs on Apple Silicon M1. 2022-06-08 22:10:27 -07:00
David Anson
00082ee8a5 Add "configParsers" option so custom parsers can be used to handle the content of markdownlint-configure-file inline comments (fixes #528). 2022-06-05 22:32:22 -07:00
David Anson
bbec8c5c1e Hide the content of inline configuration HTML comments from the linting process to avoid false positives. 2022-06-04 22:59:19 -07:00
David Anson
36c689388f Refactor cache.js to simplify use. 2022-06-02 21:33:31 -07:00
David Anson
c5ca661b96 Add MD052/reference-links-images and MD053/link-image-reference-definitions for reporting issues with link and image references (fixes #144, fixes #390, fixes #425, fixes #456). 2022-06-01 20:26:01 -07:00
David Anson
ffc4d56918 Support tilde paths ("~" prefix) in readConfig/Sync APIs (for "file" parameter and "extends" keys). 2022-05-17 21:38:36 -07:00
David Anson
3792613d2d Implement markdownlint-disable-line inline comment (behaves like markdownlint-disable-next-line, but for the current line) (fixes #524). 2022-05-15 15:59:11 -07:00
David Anson
0f845e9ba1 Update MD044/proper-names to add html_elements parameter (fixes #435). 2022-04-25 21:50:33 -07:00
David Anson
9310713da1 Make resultVersion 3 (report multiple errors per line, include fixInfo) the default. 2022-04-21 21:30:56 -07:00
David Anson
62f5c85238 Stop sharing params object across rules because doing so is unstable for asynchronous rules (fixes #510). 2022-03-20 12:59:35 -07:00
David Anson
f46ee0732f Update helpers.inlineCommentRe to fix an instance of "Polynomial regular expression used on uncontrolled data". 2022-02-12 22:02:08 -08:00
David Anson
5f0040679d Deep freeze name/tokens/lines/frontMatterLines properties of params object before passing to (custom) rules for shared access. 2021-12-23 04:34:25 +00:00
Adithya Balaji
5253669495 Fix array indexing for markdownlint-disable-next-line when front matter is present. 2021-12-22 19:27:19 -08:00
David Anson
ff8f4ea9fc Reduce execution time by ~50% by updating getEnabledRulesPerLineNumber to make enabledRules immutable and copy only when changed (also, simplify handleInlineConfig slightly). 2021-12-21 21:31:47 -08:00
David Anson
13e375b281 Disable ESLint rule func-style. 2021-12-11 21:48:00 -08:00
David Anson
2056d81682 Add support for asynchronous custom rules (ex: to read a file or make a network request). 2021-12-11 21:44:25 -08:00
David Anson
109e0d8cb6 Refactor custom rule exception tests for smaller size and better coverage. 2021-12-10 21:33:20 -08:00
David Anson
e7662b11b5 Simplify lintContent by removing errors array and processing errors in onError so nothing needs to be done after invoking a rule. 2021-12-04 22:09:20 -08:00
David Anson
d3c56d3ab8 Refactor lintContent to do less processing of errors for each rule and instead handle all errors at the end. 2021-12-04 17:02:11 -08:00
David Anson
e531bd6359 Refactor lintInput to share code between sync/async, support an async path for strings, and process files first for better concurrency. 2021-12-03 22:43:58 -08:00
David Anson
7330ea4946 Add information about parser/index to error messages when parsing configuration file content. 2021-11-30 21:28:59 -08:00
David Anson
11806dc5cb Tokens inside tables that lack a map should get it from the surrounding table row (which is more scoped than the table body) (fixes #463). 2021-11-26 04:26:15 +00:00
David Anson
1e82f76596 Reimplement inlineCodeSpanRanges as codeBlockAndSpanRanges to fix an issue with unterminated code spans (and for flexibility). 2021-11-23 04:51:20 +00:00
David Anson
573ebe7462 Move two instances of deprecatedRuleNames into constants.js. 2021-11-11 22:37:16 -08:00
David Anson
c5345f45eb Replace require("package.json") with constants.js to simplify and remove that file from markdownlint-browser.js. 2021-11-10 21:48:15 -08:00
David Anson
a5bfaa8a7d Correct typo-ed references to RuleOnErrorInfo.details to detail. 2021-09-25 16:23:37 -07:00
David Anson
a8228ecd80 Update dependencies: c8 to 7.8.0, eslint to 7.32.0, eslint-plugin-jsdoc to 36.0.7, eslint-plugin-unicorn to 35.0.0, globby to 11.0.4, markdown-it-texmath to 0.9.1, ts-loader to 9.2.5, typescript to 4.3.5, webpack to 5.51.1, webpack-cli to 4.8.0. 2021-08-22 18:03:26 -07:00
David Anson
709e314836 Update readConfig to use fs.access so the async path is fully async. 2021-08-12 20:43:18 -07:00
David Anson
211f09afbc Allow custom file system implementation to be passed when linting or reading configuration. 2021-08-12 19:38:03 -07:00
David Anson
b10147f16b Remove helpers.utf8Encoding because it annoys the latest TypeScript compiler. 2021-08-05 22:01:29 -07:00
David Anson
7d40926367 Cache results of inlineCodeSpanRanges for use by MD011/MD044. 2021-06-17 22:01:27 -07:00
David Anson
02240fac98 Add missing lineNumber property to FixInfo type (fixes #405). 2021-06-14 22:30:35 -07:00
David Anson
fb5f647368 Update dependencies: c8 to 7.7.2, eslint to 7.28.0, eslint-plugin-jsdoc to 35.1.3, eslint-plugin-unicorn to 33.0.1, globby to 11.0.3, js-yaml to 4.1.0, markdown-it-texmath to 0.9.0, markdownlint-rule-helpers to 0.14.0, ts-loader to 9.2.3, typescript to 4.3.2, webpack to 5.38.1, webpack-cli to 4.7.2. 2021-06-08 22:20:13 -07:00
David Anson
a79e7843f2 Work around lack of webpack support for dynamic calls to require (.resolve). 2021-02-11 22:16:07 -08:00