@alexlit/lint-kit 112.3.4 → 112.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/packages/config-eslint/package.json +3 -3
- package/packages/config-markdownlint/node_modules/entities/LICENSE +11 -0
- package/packages/config-markdownlint/node_modules/entities/lib/decode.d.ts +211 -0
- package/packages/config-markdownlint/node_modules/entities/lib/decode.d.ts.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/decode.js +536 -0
- package/packages/config-markdownlint/node_modules/entities/lib/decode.js.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/decode_codepoint.d.ts +19 -0
- package/packages/config-markdownlint/node_modules/entities/lib/decode_codepoint.d.ts.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/decode_codepoint.js +76 -0
- package/packages/config-markdownlint/node_modules/entities/lib/decode_codepoint.js.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/encode.d.ts +22 -0
- package/packages/config-markdownlint/node_modules/entities/lib/encode.d.ts.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/encode.js +77 -0
- package/packages/config-markdownlint/node_modules/entities/lib/encode.js.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/escape.d.ts +43 -0
- package/packages/config-markdownlint/node_modules/entities/lib/escape.d.ts.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/escape.js +122 -0
- package/packages/config-markdownlint/node_modules/entities/lib/escape.js.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/decode.d.ts +211 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/decode.d.ts.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/decode.js +496 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/decode.js.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/decode_codepoint.d.ts +19 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/decode_codepoint.d.ts.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/decode_codepoint.js +71 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/decode_codepoint.js.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/encode.d.ts +22 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/encode.d.ts.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/encode.js +69 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/encode.js.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/escape.d.ts +43 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/escape.d.ts.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/escape.js +116 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/escape.js.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/generated/decode-data-html.d.ts +3 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/generated/decode-data-html.d.ts.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/generated/decode-data-html.js +7 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/generated/decode-data-html.js.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/generated/decode-data-xml.d.ts +3 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/generated/decode-data-xml.d.ts.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/generated/decode-data-xml.js +7 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/generated/decode-data-xml.js.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/generated/encode-html.d.ts +8 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/generated/encode-html.d.ts.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/generated/encode-html.js +10 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/generated/encode-html.js.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/index.d.ts +96 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/index.d.ts.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/index.js +99 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/index.js.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/esm/package.json +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/generated/decode-data-html.d.ts +3 -0
- package/packages/config-markdownlint/node_modules/entities/lib/generated/decode-data-html.d.ts.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/generated/decode-data-html.js +9 -0
- package/packages/config-markdownlint/node_modules/entities/lib/generated/decode-data-html.js.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/generated/decode-data-xml.d.ts +3 -0
- package/packages/config-markdownlint/node_modules/entities/lib/generated/decode-data-xml.d.ts.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/generated/decode-data-xml.js +9 -0
- package/packages/config-markdownlint/node_modules/entities/lib/generated/decode-data-xml.js.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/generated/encode-html.d.ts +8 -0
- package/packages/config-markdownlint/node_modules/entities/lib/generated/encode-html.d.ts.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/generated/encode-html.js +12 -0
- package/packages/config-markdownlint/node_modules/entities/lib/generated/encode-html.js.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/index.d.ts +96 -0
- package/packages/config-markdownlint/node_modules/entities/lib/index.d.ts.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/lib/index.js +126 -0
- package/packages/config-markdownlint/node_modules/entities/lib/index.js.map +1 -0
- package/packages/config-markdownlint/node_modules/entities/package.json +90 -0
- package/packages/config-markdownlint/node_modules/entities/readme.md +122 -0
- package/packages/config-markdownlint/node_modules/markdown-it/LICENSE +22 -0
- package/packages/config-markdownlint/node_modules/markdown-it/README.md +324 -0
- package/packages/config-markdownlint/node_modules/markdown-it/bin/markdown-it.mjs +107 -0
- package/packages/config-markdownlint/node_modules/markdown-it/dist/index.cjs.js +5540 -0
- package/packages/config-markdownlint/node_modules/markdown-it/dist/markdown-it.js +6963 -0
- package/packages/config-markdownlint/node_modules/markdown-it/dist/markdown-it.min.js +2 -0
- package/packages/config-markdownlint/node_modules/markdown-it/index.mjs +1 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/common/html_blocks.mjs +67 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/common/html_re.mjs +25 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/common/utils.mjs +304 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/helpers/index.mjs +11 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/helpers/parse_link_destination.mjs +77 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/helpers/parse_link_label.mjs +49 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/helpers/parse_link_title.mjs +66 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/index.mjs +565 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/parser_block.mjs +134 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/parser_core.mjs +62 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/parser_inline.mjs +197 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/presets/commonmark.mjs +88 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/presets/default.mjs +47 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/presets/zero.mjs +70 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/renderer.mjs +322 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/ruler.mjs +340 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_block/blockquote.mjs +209 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_block/code.mjs +30 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_block/fence.mjs +94 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_block/heading.mjs +51 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_block/hr.mjs +40 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_block/html_block.mjs +69 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_block/lheading.mjs +82 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_block/list.mjs +331 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_block/paragraph.mjs +46 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_block/reference.mjs +212 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_block/state_block.mjs +220 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_block/table.mjs +228 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_core/block.mjs +13 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_core/inline.mjs +11 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_core/linkify.mjs +134 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_core/normalize.mjs +17 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_core/replacements.mjs +101 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_core/smartquotes.mjs +193 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_core/state_core.mjs +17 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_core/text_join.mjs +43 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/autolink.mjs +72 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/backticks.mjs +60 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/balance_pairs.mjs +124 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/emphasis.mjs +123 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/entity.mjs +51 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/escape.mjs +69 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/fragments_join.mjs +38 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/html_inline.mjs +50 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/image.mjs +138 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/link.mjs +139 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/linkify.mjs +56 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/newline.mjs +42 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/state_inline.mjs +123 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/strikethrough.mjs +127 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/text.mjs +86 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/token.mjs +191 -0
- package/packages/config-markdownlint/node_modules/markdown-it/package.json +92 -0
- package/packages/config-markdownlint/node_modules/markdownlint/CHANGELOG.md +446 -0
- package/packages/config-markdownlint/node_modules/markdownlint/CONTRIBUTING.md +93 -0
- package/packages/config-markdownlint/node_modules/markdownlint/LICENSE +21 -0
- package/packages/config-markdownlint/node_modules/markdownlint/README.md +1032 -0
- package/packages/config-markdownlint/node_modules/markdownlint/demo/markdownlint-browser.js +7116 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/CustomRules.md +383 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/Prettier.md +27 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/ReleaseProcess.md +20 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/Rules.md +2462 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md001.md +37 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md003.md +59 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md004.md +49 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md005.md +53 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md007.md +52 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md009.md +51 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md010.md +56 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md011.md +30 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md012.md +38 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md013.md +58 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md014.md +54 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md018.md +27 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md019.md +28 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md020.md +29 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md021.md +31 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md022.md +52 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md023.md +33 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md024.md +44 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md025.md +49 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md026.md +40 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md027.md +24 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md028.md +40 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md029.md +98 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md030.md +82 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md031.md +50 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md032.md +55 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md033.md +27 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md034.md +50 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md035.md +42 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md036.md +45 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md037.md +37 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md038.md +40 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md039.md +21 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md040.md +52 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md041.md +49 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md042.md +32 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md043.md +69 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md044.md +35 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md045.md +40 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md046.md +40 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md047.md +34 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md048.md +41 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md049.md +35 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md050.md +35 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md051.md +87 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md052.md +40 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md053.md +38 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md054.md +100 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md055.md +54 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md056.md +37 -0
- package/packages/config-markdownlint/node_modules/markdownlint/helpers/LICENSE +21 -0
- package/packages/config-markdownlint/node_modules/markdownlint/helpers/README.md +72 -0
- package/packages/config-markdownlint/node_modules/markdownlint/helpers/helpers.js +1025 -0
- package/packages/config-markdownlint/node_modules/markdownlint/helpers/micromark.cjs +445 -0
- package/packages/config-markdownlint/node_modules/markdownlint/helpers/package.json +26 -0
- package/packages/config-markdownlint/node_modules/markdownlint/helpers/shared.js +10 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/cache.js +21 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/configuration.d.ts +1178 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/constants.js +14 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/markdownlint.d.ts +479 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/markdownlint.js +1550 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md001.js +25 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md003.js +45 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md004.js +79 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md005.js +81 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md007.js +92 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md009.js +89 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md010.js +63 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md011.js +49 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md012.js +35 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md013.js +99 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md014.js +57 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md018.js +38 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md019.js +42 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md020.js +65 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md021.js +65 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md022.js +116 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md023.js +41 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md024.js +45 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md025.js +35 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md026.js +54 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md027.js +42 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md028.js +47 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md029.js +70 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md030.js +66 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md031.js +43 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md032.js +76 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md033.js +46 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md034.js +105 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md035.js +31 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md036.js +50 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md037.js +99 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md038.js +106 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md039.js +71 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md040.js +42 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md041.js +37 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md042.js +53 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md043.js +67 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md044.js +115 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md045.js +67 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md046.js +40 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md047.js +31 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md048.js +43 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md049-md050.js +108 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md051.js +176 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md052.js +42 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md053.js +62 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md054.js +130 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md055.js +80 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md056.js +52 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/rules.js +67 -0
- package/packages/config-markdownlint/node_modules/markdownlint/package.json +103 -0
- package/packages/config-markdownlint/node_modules/markdownlint/schema/.markdownlint.jsonc +304 -0
- package/packages/config-markdownlint/node_modules/markdownlint/schema/.markdownlint.yaml +272 -0
- package/packages/config-markdownlint/node_modules/markdownlint/schema/ValidatingConfiguration.md +28 -0
- package/packages/config-markdownlint/node_modules/markdownlint/schema/markdownlint-config-schema.json +1814 -0
- package/packages/config-markdownlint/node_modules/markdownlint/style/all.json +5 -0
- package/packages/config-markdownlint/node_modules/markdownlint/style/cirosantilli.json +22 -0
- package/packages/config-markdownlint/node_modules/markdownlint/style/prettier.json +26 -0
- package/packages/config-markdownlint/node_modules/markdownlint/style/relaxed.json +12 -0
- package/packages/config-markdownlint/node_modules/markdownlint-micromark/LICENSE +21 -0
- package/packages/config-markdownlint/node_modules/markdownlint-micromark/README.md +10 -0
- package/packages/config-markdownlint/node_modules/markdownlint-micromark/micromark-browser.js +2 -0
- package/packages/config-markdownlint/node_modules/markdownlint-micromark/micromark-html-browser.js +2 -0
- package/packages/config-markdownlint/node_modules/markdownlint-micromark/micromark.cjs +1 -0
- package/packages/config-markdownlint/node_modules/markdownlint-micromark/micromark.d.ts +1751 -0
- package/packages/config-markdownlint/node_modules/markdownlint-micromark/package.json +46 -0
- package/packages/config-markdownlint/package.json +2 -2
- package/packages/config-stylelint/package.json +3 -3
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
const { addErrorDetailIf, listItemMarkerRe, orderedListItemMarkerRe,
|
|
6
|
+
rangeFromRegExp } = require("../helpers");
|
|
7
|
+
const { flattenedLists } = require("./cache");
|
|
8
|
+
|
|
9
|
+
const listStyleExamples = {
|
|
10
|
+
"one": "1/1/1",
|
|
11
|
+
"ordered": "1/2/3",
|
|
12
|
+
"zero": "0/0/0"
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
16
|
+
/** @type import("./markdownlint").Rule */
|
|
17
|
+
module.exports = {
|
|
18
|
+
"names": [ "MD029", "ol-prefix" ],
|
|
19
|
+
"description": "Ordered list item prefix",
|
|
20
|
+
"tags": [ "ol" ],
|
|
21
|
+
"parser": "none",
|
|
22
|
+
"function": function MD029(params, onError) {
|
|
23
|
+
const style = String(params.config.style || "one_or_ordered");
|
|
24
|
+
const filteredLists = flattenedLists().filter((list) => !list.unordered);
|
|
25
|
+
for (const list of filteredLists) {
|
|
26
|
+
const { items } = list;
|
|
27
|
+
let current = 1;
|
|
28
|
+
let incrementing = false;
|
|
29
|
+
// Check for incrementing number pattern 1/2/3 or 0/1/2
|
|
30
|
+
if (items.length >= 2) {
|
|
31
|
+
const first = orderedListItemMarkerRe.exec(items[0].line);
|
|
32
|
+
const second = orderedListItemMarkerRe.exec(items[1].line);
|
|
33
|
+
if (first && second) {
|
|
34
|
+
const [ , firstNumber ] = first;
|
|
35
|
+
const [ , secondNumber ] = second;
|
|
36
|
+
if ((secondNumber !== "1") || (firstNumber === "0")) {
|
|
37
|
+
incrementing = true;
|
|
38
|
+
if (firstNumber === "0") {
|
|
39
|
+
current = 0;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
// Determine effective style
|
|
45
|
+
let listStyle = style;
|
|
46
|
+
if (listStyle === "one_or_ordered") {
|
|
47
|
+
listStyle = incrementing ? "ordered" : "one";
|
|
48
|
+
}
|
|
49
|
+
// Force expected value for 0/0/0 and 1/1/1 patterns
|
|
50
|
+
if (listStyle === "zero") {
|
|
51
|
+
current = 0;
|
|
52
|
+
} else if (listStyle === "one") {
|
|
53
|
+
current = 1;
|
|
54
|
+
}
|
|
55
|
+
// Validate each list item marker
|
|
56
|
+
for (const item of items) {
|
|
57
|
+
const match = orderedListItemMarkerRe.exec(item.line);
|
|
58
|
+
if (match) {
|
|
59
|
+
addErrorDetailIf(onError, item.lineNumber,
|
|
60
|
+
String(current), match[1],
|
|
61
|
+
"Style: " + listStyleExamples[listStyle], null,
|
|
62
|
+
rangeFromRegExp(item.line, listItemMarkerRe));
|
|
63
|
+
if (listStyle === "ordered") {
|
|
64
|
+
current++;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
const { addErrorDetailIf } = require("../helpers");
|
|
6
|
+
const { filterByTypes } = require("../helpers/micromark.cjs");
|
|
7
|
+
|
|
8
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
9
|
+
/** @type import("./markdownlint").Rule */
|
|
10
|
+
module.exports = {
|
|
11
|
+
"names": [ "MD030", "list-marker-space" ],
|
|
12
|
+
"description": "Spaces after list markers",
|
|
13
|
+
"tags": [ "ol", "ul", "whitespace" ],
|
|
14
|
+
"parser": "micromark",
|
|
15
|
+
"function": function MD030(params, onError) {
|
|
16
|
+
const ulSingle = Number(params.config.ul_single || 1);
|
|
17
|
+
const olSingle = Number(params.config.ol_single || 1);
|
|
18
|
+
const ulMulti = Number(params.config.ul_multi || 1);
|
|
19
|
+
const olMulti = Number(params.config.ol_multi || 1);
|
|
20
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
21
|
+
/** @type import("../helpers/micromark.cjs").Token[] */
|
|
22
|
+
const micromarkTokens =
|
|
23
|
+
// @ts-ignore
|
|
24
|
+
params.parsers.micromark.tokens;
|
|
25
|
+
const lists = filterByTypes(micromarkTokens, [ "listOrdered", "listUnordered" ]);
|
|
26
|
+
for (const list of lists) {
|
|
27
|
+
const ordered = (list.type === "listOrdered");
|
|
28
|
+
const listItemPrefixes =
|
|
29
|
+
list.children.filter((token) => (token.type === "listItemPrefix"));
|
|
30
|
+
const allSingleLine =
|
|
31
|
+
(list.endLine - list.startLine + 1) === listItemPrefixes.length;
|
|
32
|
+
const expectedSpaces = ordered ?
|
|
33
|
+
(allSingleLine ? olSingle : olMulti) :
|
|
34
|
+
(allSingleLine ? ulSingle : ulMulti);
|
|
35
|
+
for (const listItemPrefix of listItemPrefixes) {
|
|
36
|
+
const range = [
|
|
37
|
+
listItemPrefix.startColumn,
|
|
38
|
+
listItemPrefix.endColumn - listItemPrefix.startColumn
|
|
39
|
+
];
|
|
40
|
+
const listItemPrefixWhitespaces = listItemPrefix.children.filter(
|
|
41
|
+
(token) => (token.type === "listItemPrefixWhitespace")
|
|
42
|
+
);
|
|
43
|
+
for (const listItemPrefixWhitespace of listItemPrefixWhitespaces) {
|
|
44
|
+
const { endColumn, startColumn, startLine } =
|
|
45
|
+
listItemPrefixWhitespace;
|
|
46
|
+
const actualSpaces = endColumn - startColumn;
|
|
47
|
+
const fixInfo = {
|
|
48
|
+
"editColumn": startColumn,
|
|
49
|
+
"deleteCount": actualSpaces,
|
|
50
|
+
"insertText": "".padEnd(expectedSpaces)
|
|
51
|
+
};
|
|
52
|
+
addErrorDetailIf(
|
|
53
|
+
onError,
|
|
54
|
+
startLine,
|
|
55
|
+
expectedSpaces,
|
|
56
|
+
actualSpaces,
|
|
57
|
+
null,
|
|
58
|
+
null,
|
|
59
|
+
range,
|
|
60
|
+
fixInfo
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
const { addErrorContext, forEachLine, isBlankLine } = require("../helpers");
|
|
6
|
+
const { lineMetadata } = require("./cache");
|
|
7
|
+
|
|
8
|
+
const codeFencePrefixRe = /^(.*?)[`~]/;
|
|
9
|
+
|
|
10
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
11
|
+
/** @type import("./markdownlint").Rule */
|
|
12
|
+
module.exports = {
|
|
13
|
+
"names": [ "MD031", "blanks-around-fences" ],
|
|
14
|
+
"description": "Fenced code blocks should be surrounded by blank lines",
|
|
15
|
+
"tags": [ "code", "blank_lines" ],
|
|
16
|
+
"parser": "none",
|
|
17
|
+
"function": function MD031(params, onError) {
|
|
18
|
+
const listItems = params.config.list_items;
|
|
19
|
+
const includeListItems = (listItems === undefined) ? true : !!listItems;
|
|
20
|
+
const { lines } = params;
|
|
21
|
+
forEachLine(lineMetadata(), (line, i, inCode, onFence, inTable, inItem) => {
|
|
22
|
+
const onTopFence = (onFence > 0);
|
|
23
|
+
const onBottomFence = (onFence < 0);
|
|
24
|
+
if ((includeListItems || !inItem) &&
|
|
25
|
+
((onTopFence && !isBlankLine(lines[i - 1])) ||
|
|
26
|
+
(onBottomFence && !isBlankLine(lines[i + 1])))) {
|
|
27
|
+
const [ , prefix ] = line.match(codeFencePrefixRe) || [];
|
|
28
|
+
const fixInfo = (prefix === undefined) ? null : {
|
|
29
|
+
"lineNumber": i + (onTopFence ? 1 : 2),
|
|
30
|
+
"insertText": `${prefix.replace(/[^>]/g, " ").trim()}\n`
|
|
31
|
+
};
|
|
32
|
+
addErrorContext(
|
|
33
|
+
onError,
|
|
34
|
+
i + 1,
|
|
35
|
+
lines[i].trim(),
|
|
36
|
+
null,
|
|
37
|
+
null,
|
|
38
|
+
null,
|
|
39
|
+
fixInfo);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
const { addErrorContext, blockquotePrefixRe, isBlankLine } = require("../helpers");
|
|
6
|
+
const { filterByPredicate, nonContentTokens } = require("../helpers/micromark.cjs");
|
|
7
|
+
|
|
8
|
+
const isList = (token) => (
|
|
9
|
+
(token.type === "listOrdered") || (token.type === "listUnordered")
|
|
10
|
+
);
|
|
11
|
+
const addBlankLineError = (onError, lines, lineIndex, lineNumber) => {
|
|
12
|
+
const line = lines[lineIndex];
|
|
13
|
+
const quotePrefix = line.match(blockquotePrefixRe)[0].trimEnd();
|
|
14
|
+
addErrorContext(
|
|
15
|
+
onError,
|
|
16
|
+
lineIndex + 1,
|
|
17
|
+
line.trim(),
|
|
18
|
+
null,
|
|
19
|
+
null,
|
|
20
|
+
null,
|
|
21
|
+
{
|
|
22
|
+
lineNumber,
|
|
23
|
+
"insertText": `${quotePrefix}\n`
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
29
|
+
/** @type import("./markdownlint").Rule */
|
|
30
|
+
module.exports = {
|
|
31
|
+
"names": [ "MD032", "blanks-around-lists" ],
|
|
32
|
+
"description": "Lists should be surrounded by blank lines",
|
|
33
|
+
"tags": [ "bullet", "ul", "ol", "blank_lines" ],
|
|
34
|
+
"parser": "micromark",
|
|
35
|
+
"function": function MD032(params, onError) {
|
|
36
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
37
|
+
/** @type import("../helpers/micromark.cjs").Token[] */
|
|
38
|
+
const micromarkTokens =
|
|
39
|
+
// @ts-ignore
|
|
40
|
+
params.parsers.micromark.tokens;
|
|
41
|
+
const { lines } = params;
|
|
42
|
+
|
|
43
|
+
// For every top-level list...
|
|
44
|
+
const topLevelLists = filterByPredicate(
|
|
45
|
+
micromarkTokens,
|
|
46
|
+
isList,
|
|
47
|
+
(token) => (
|
|
48
|
+
(isList(token) || (token.type === "htmlFlow")) ? [] : token.children
|
|
49
|
+
)
|
|
50
|
+
);
|
|
51
|
+
for (const list of topLevelLists) {
|
|
52
|
+
|
|
53
|
+
// Look for a blank line above the list
|
|
54
|
+
const firstIndex = list.startLine - 1;
|
|
55
|
+
if (!isBlankLine(lines[firstIndex - 1])) {
|
|
56
|
+
addBlankLineError(onError, lines, firstIndex);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Find the "visual" end of the list
|
|
60
|
+
let endLine = list.endLine;
|
|
61
|
+
const flattenedChildren = filterByPredicate(list.children);
|
|
62
|
+
for (const child of flattenedChildren.reverse()) {
|
|
63
|
+
if (!nonContentTokens.has(child.type)) {
|
|
64
|
+
endLine = child.endLine;
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Look for a blank line below the list
|
|
70
|
+
const lastIndex = endLine - 1;
|
|
71
|
+
if (!isBlankLine(lines[lastIndex + 1])) {
|
|
72
|
+
addBlankLineError(onError, lines, lastIndex, lastIndex + 2);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
const { addError, nextLinesRe } = require("../helpers");
|
|
6
|
+
const { filterByTypes, getHtmlTagInfo } =
|
|
7
|
+
require("../helpers/micromark.cjs");
|
|
8
|
+
|
|
9
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
10
|
+
/** @type import("./markdownlint").Rule */
|
|
11
|
+
module.exports = {
|
|
12
|
+
"names": [ "MD033", "no-inline-html" ],
|
|
13
|
+
"description": "Inline HTML",
|
|
14
|
+
"tags": [ "html" ],
|
|
15
|
+
"parser": "micromark",
|
|
16
|
+
"function": function MD033(params, onError) {
|
|
17
|
+
let allowedElements = params.config.allowed_elements;
|
|
18
|
+
allowedElements = Array.isArray(allowedElements) ? allowedElements : [];
|
|
19
|
+
allowedElements = allowedElements.map((element) => element.toLowerCase());
|
|
20
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
21
|
+
/** @type import("../helpers/micromark.cjs").Token[] */
|
|
22
|
+
const micromarkTokens =
|
|
23
|
+
// @ts-ignore
|
|
24
|
+
params.parsers.micromark.tokens;
|
|
25
|
+
for (const token of filterByTypes(micromarkTokens, [ "htmlText" ])) {
|
|
26
|
+
const htmlTagInfo = getHtmlTagInfo(token);
|
|
27
|
+
if (
|
|
28
|
+
htmlTagInfo &&
|
|
29
|
+
!htmlTagInfo.close &&
|
|
30
|
+
!allowedElements.includes(htmlTagInfo.name.toLowerCase())
|
|
31
|
+
) {
|
|
32
|
+
const range = [
|
|
33
|
+
token.startColumn,
|
|
34
|
+
token.text.replace(nextLinesRe, "").length
|
|
35
|
+
];
|
|
36
|
+
addError(
|
|
37
|
+
onError,
|
|
38
|
+
token.startLine,
|
|
39
|
+
"Element: " + htmlTagInfo.name,
|
|
40
|
+
undefined,
|
|
41
|
+
range
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
const { addErrorContext } = require("../helpers");
|
|
6
|
+
const { filterByPredicate, filterByTypes, getHtmlTagInfo, inHtmlFlow, parse } =
|
|
7
|
+
require("../helpers/micromark.cjs");
|
|
8
|
+
|
|
9
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
10
|
+
/** @type import("./markdownlint").Rule */
|
|
11
|
+
module.exports = {
|
|
12
|
+
"names": [ "MD034", "no-bare-urls" ],
|
|
13
|
+
"description": "Bare URL used",
|
|
14
|
+
"tags": [ "links", "url" ],
|
|
15
|
+
"parser": "micromark",
|
|
16
|
+
"function": function MD034(params, onError) {
|
|
17
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
18
|
+
/** @type import("../helpers/micromark.cjs").Token[] */
|
|
19
|
+
const micromarkTokens =
|
|
20
|
+
// @ts-ignore
|
|
21
|
+
params.parsers.micromark.tokens;
|
|
22
|
+
const literalAutolinks = (tokens) => (
|
|
23
|
+
filterByPredicate(
|
|
24
|
+
tokens,
|
|
25
|
+
(token) => {
|
|
26
|
+
if ((token.type === "literalAutolink") && !inHtmlFlow(token)) {
|
|
27
|
+
// Detect and ignore https://github.com/micromark/micromark/issues/164
|
|
28
|
+
const siblings = token.parent?.children;
|
|
29
|
+
// Commented-out due to not being able to exercise in test/code coverage
|
|
30
|
+
// || micromarkTokens;
|
|
31
|
+
const index = siblings?.indexOf(token);
|
|
32
|
+
// @ts-ignore
|
|
33
|
+
const prev = siblings?.at(index - 1);
|
|
34
|
+
// @ts-ignore
|
|
35
|
+
const next = siblings?.at(index + 1);
|
|
36
|
+
return !(
|
|
37
|
+
prev &&
|
|
38
|
+
next &&
|
|
39
|
+
(prev.type === "data") &&
|
|
40
|
+
(next.type === "data") &&
|
|
41
|
+
prev.text.endsWith("<") &&
|
|
42
|
+
next.text.startsWith(">")
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
return false;
|
|
46
|
+
},
|
|
47
|
+
(token) => {
|
|
48
|
+
const { children } = token;
|
|
49
|
+
const result = [];
|
|
50
|
+
for (let i = 0; i < children.length; i++) {
|
|
51
|
+
const current = children[i];
|
|
52
|
+
const openTagInfo = getHtmlTagInfo(current);
|
|
53
|
+
if (openTagInfo && !openTagInfo.close) {
|
|
54
|
+
let count = 1;
|
|
55
|
+
for (let j = i + 1; j < children.length; j++) {
|
|
56
|
+
const candidate = children[j];
|
|
57
|
+
const closeTagInfo = getHtmlTagInfo(candidate);
|
|
58
|
+
if (closeTagInfo && (openTagInfo.name === closeTagInfo.name)) {
|
|
59
|
+
if (closeTagInfo.close) {
|
|
60
|
+
count--;
|
|
61
|
+
if (count === 0) {
|
|
62
|
+
i = j;
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
65
|
+
} else {
|
|
66
|
+
count++;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
} else {
|
|
71
|
+
result.push(current);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return result;
|
|
75
|
+
}
|
|
76
|
+
)
|
|
77
|
+
);
|
|
78
|
+
const autoLinks = filterByTypes(micromarkTokens, [ "literalAutolink" ]);
|
|
79
|
+
if (autoLinks.length > 0) {
|
|
80
|
+
// Re-parse with correct link/image reference definition handling
|
|
81
|
+
const document = params.lines.join("\n");
|
|
82
|
+
const tokens = parse(document, undefined, false);
|
|
83
|
+
for (const token of literalAutolinks(tokens)) {
|
|
84
|
+
const range = [
|
|
85
|
+
token.startColumn,
|
|
86
|
+
token.endColumn - token.startColumn
|
|
87
|
+
];
|
|
88
|
+
const fixInfo = {
|
|
89
|
+
"editColumn": range[0],
|
|
90
|
+
"deleteCount": range[1],
|
|
91
|
+
"insertText": `<${token.text}>`
|
|
92
|
+
};
|
|
93
|
+
addErrorContext(
|
|
94
|
+
onError,
|
|
95
|
+
token.startLine,
|
|
96
|
+
token.text,
|
|
97
|
+
null,
|
|
98
|
+
null,
|
|
99
|
+
range,
|
|
100
|
+
fixInfo
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
const { addErrorDetailIf } = require("../helpers");
|
|
6
|
+
const { filterByTypes } = require("../helpers/micromark.cjs");
|
|
7
|
+
|
|
8
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
9
|
+
/** @type import("./markdownlint").Rule */
|
|
10
|
+
module.exports = {
|
|
11
|
+
"names": [ "MD035", "hr-style" ],
|
|
12
|
+
"description": "Horizontal rule style",
|
|
13
|
+
"tags": [ "hr" ],
|
|
14
|
+
"parser": "micromark",
|
|
15
|
+
"function": function MD035(params, onError) {
|
|
16
|
+
let style = String(params.config.style || "consistent").trim();
|
|
17
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
18
|
+
/** @type import("../helpers/micromark.cjs").Token[] */
|
|
19
|
+
const micromarkTokens =
|
|
20
|
+
// @ts-ignore
|
|
21
|
+
params.parsers.micromark.tokens;
|
|
22
|
+
const thematicBreaks = filterByTypes(micromarkTokens, [ "thematicBreak" ]);
|
|
23
|
+
for (const token of thematicBreaks) {
|
|
24
|
+
const { startLine, text } = token;
|
|
25
|
+
if (style === "consistent") {
|
|
26
|
+
style = text;
|
|
27
|
+
}
|
|
28
|
+
addErrorDetailIf(onError, startLine, style, text);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
const { addErrorContext, allPunctuation } = require("../helpers");
|
|
6
|
+
const { filterByTypes, matchAndGetTokensByType } = require("../helpers/micromark.cjs");
|
|
7
|
+
|
|
8
|
+
/** @typedef {import("../helpers/micromark.cjs").TokenType} TokenType */
|
|
9
|
+
/** @type {Map<TokenType, TokenType[]>} */
|
|
10
|
+
const emphasisAndChildrenTypes = new Map([
|
|
11
|
+
[ "emphasis", [ "emphasisSequence", "emphasisText", "emphasisSequence" ] ],
|
|
12
|
+
[ "strong", [ "strongSequence", "strongText", "strongSequence" ] ]
|
|
13
|
+
]);
|
|
14
|
+
|
|
15
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
16
|
+
/** @type import("./markdownlint").Rule */
|
|
17
|
+
module.exports = {
|
|
18
|
+
"names": [ "MD036", "no-emphasis-as-heading" ],
|
|
19
|
+
"description": "Emphasis used instead of a heading",
|
|
20
|
+
"tags": [ "headings", "emphasis" ],
|
|
21
|
+
"parser": "micromark",
|
|
22
|
+
"function": function MD036(params, onError) {
|
|
23
|
+
let punctuation = params.config.punctuation;
|
|
24
|
+
punctuation = String((punctuation === undefined) ? allPunctuation : punctuation);
|
|
25
|
+
const punctuationRe = new RegExp("[" + punctuation + "]$");
|
|
26
|
+
const paragraphTokens =
|
|
27
|
+
filterByTypes(params.parsers.micromark.tokens, [ "paragraph" ]).
|
|
28
|
+
filter((token) =>
|
|
29
|
+
(token.parent?.type === "content") && !token.parent?.parent && (token.children.length === 1)
|
|
30
|
+
);
|
|
31
|
+
for (const paragraphToken of paragraphTokens) {
|
|
32
|
+
const childToken = paragraphToken.children[0];
|
|
33
|
+
for (const [ emphasisType, emphasisChildrenTypes ] of emphasisAndChildrenTypes) {
|
|
34
|
+
if (childToken.type === emphasisType) {
|
|
35
|
+
const matchingTokens = matchAndGetTokensByType(childToken.children, emphasisChildrenTypes);
|
|
36
|
+
if (matchingTokens) {
|
|
37
|
+
const textToken = matchingTokens[1];
|
|
38
|
+
if (
|
|
39
|
+
(textToken.children.length === 1) &&
|
|
40
|
+
(textToken.children[0].type === "data") &&
|
|
41
|
+
!punctuationRe.test(textToken.text)
|
|
42
|
+
) {
|
|
43
|
+
addErrorContext(onError, textToken.startLine, textToken.text);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
const { addError } = require("../helpers");
|
|
6
|
+
const { filterByPredicate, inHtmlFlow } = require("../helpers/micromark.cjs");
|
|
7
|
+
|
|
8
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
9
|
+
/** @type import("./markdownlint").Rule */
|
|
10
|
+
module.exports = {
|
|
11
|
+
"names": [ "MD037", "no-space-in-emphasis" ],
|
|
12
|
+
"description": "Spaces inside emphasis markers",
|
|
13
|
+
"tags": [ "whitespace", "emphasis" ],
|
|
14
|
+
"parser": "micromark",
|
|
15
|
+
"function": function MD037(params, onError) {
|
|
16
|
+
|
|
17
|
+
// Initialize variables
|
|
18
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
19
|
+
/** @type import("../helpers/micromark.cjs").Token[] */
|
|
20
|
+
const micromarkTokens =
|
|
21
|
+
// @ts-ignore
|
|
22
|
+
params.parsers.micromark.tokens;
|
|
23
|
+
const { lines } = params;
|
|
24
|
+
const emphasisTokensByMarker = new Map();
|
|
25
|
+
for (const marker of [ "_", "__", "___", "*", "**", "***" ]) {
|
|
26
|
+
emphasisTokensByMarker.set(marker, []);
|
|
27
|
+
}
|
|
28
|
+
const tokens = filterByPredicate(
|
|
29
|
+
micromarkTokens,
|
|
30
|
+
(token) => token.children.some((child) => child.type === "data")
|
|
31
|
+
);
|
|
32
|
+
for (const token of tokens) {
|
|
33
|
+
|
|
34
|
+
// Build lists of bare tokens for each emphasis marker type
|
|
35
|
+
for (const emphasisTokens of emphasisTokensByMarker.values()) {
|
|
36
|
+
emphasisTokens.length = 0;
|
|
37
|
+
}
|
|
38
|
+
for (const child of token.children) {
|
|
39
|
+
const { text, type } = child;
|
|
40
|
+
if ((type === "data") && (text.length <= 3)) {
|
|
41
|
+
const emphasisTokens = emphasisTokensByMarker.get(text);
|
|
42
|
+
if (emphasisTokens && !inHtmlFlow(child)) {
|
|
43
|
+
emphasisTokens.push(child);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Process bare tokens for each emphasis marker type
|
|
49
|
+
for (const entry of emphasisTokensByMarker.entries()) {
|
|
50
|
+
const [ marker, emphasisTokens ] = entry;
|
|
51
|
+
for (let i = 0; i + 1 < emphasisTokens.length; i += 2) {
|
|
52
|
+
|
|
53
|
+
// Process start token of start/end pair
|
|
54
|
+
const startToken = emphasisTokens[i];
|
|
55
|
+
const startLine = lines[startToken.startLine - 1];
|
|
56
|
+
const startSlice = startLine.slice(startToken.endColumn - 1);
|
|
57
|
+
const startMatch = startSlice.match(/^\s+\S/);
|
|
58
|
+
if (startMatch) {
|
|
59
|
+
const [ startSpaceCharacter ] = startMatch;
|
|
60
|
+
const startContext = `${marker}${startSpaceCharacter}`;
|
|
61
|
+
addError(
|
|
62
|
+
onError,
|
|
63
|
+
startToken.startLine,
|
|
64
|
+
undefined,
|
|
65
|
+
startContext,
|
|
66
|
+
[ startToken.startColumn, startContext.length ],
|
|
67
|
+
{
|
|
68
|
+
"editColumn": startToken.endColumn,
|
|
69
|
+
"deleteCount": startSpaceCharacter.length - 1
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Process end token of start/end pair
|
|
75
|
+
const endToken = emphasisTokens[i + 1];
|
|
76
|
+
const endLine = lines[endToken.startLine - 1];
|
|
77
|
+
const endSlice = endLine.slice(0, endToken.startColumn - 1);
|
|
78
|
+
const endMatch = endSlice.match(/\S\s+$/);
|
|
79
|
+
if (endMatch) {
|
|
80
|
+
const [ endSpaceCharacter ] = endMatch;
|
|
81
|
+
const endContext = `${endSpaceCharacter}${marker}`;
|
|
82
|
+
addError(
|
|
83
|
+
onError,
|
|
84
|
+
endToken.startLine,
|
|
85
|
+
undefined,
|
|
86
|
+
endContext,
|
|
87
|
+
[ endToken.endColumn - endContext.length, endContext.length ],
|
|
88
|
+
{
|
|
89
|
+
"editColumn":
|
|
90
|
+
endToken.startColumn - (endSpaceCharacter.length - 1),
|
|
91
|
+
"deleteCount": endSpaceCharacter.length - 1
|
|
92
|
+
}
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
};
|