@alexlit/lint-kit 112.3.4 → 113.0.0
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 +7 -7
- 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,108 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
const { addError, emphasisOrStrongStyleFor } = require("../helpers");
|
|
6
|
+
const { filterByPredicate, tokenIfType } = require("../helpers/micromark.cjs");
|
|
7
|
+
|
|
8
|
+
const intrawordRe = /^\w$/;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @param {import("./markdownlint").RuleParams} params Rule parameters.
|
|
12
|
+
* @param {import("./markdownlint").RuleOnError} onError Error-reporting callback.
|
|
13
|
+
* @param {import("markdownlint-micromark").TokenType} type Token type.
|
|
14
|
+
* @param {import("markdownlint-micromark").TokenType} typeSequence Token sequence type.
|
|
15
|
+
* @param {"*" | "**"} asterisk Asterisk kind.
|
|
16
|
+
* @param {"_" | "__"} underline Underline kind.
|
|
17
|
+
* @param {"asterisk" | "consistent" | "underscore"} style Style string.
|
|
18
|
+
*/
|
|
19
|
+
const impl =
|
|
20
|
+
(params, onError, type, typeSequence, asterisk, underline, style = "consistent") => {
|
|
21
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
22
|
+
/** @type import("../helpers/micromark.cjs").Token[] */
|
|
23
|
+
const micromarkTokens =
|
|
24
|
+
// @ts-ignore
|
|
25
|
+
params.parsers.micromark.tokens;
|
|
26
|
+
const { lines } = params;
|
|
27
|
+
const emphasisTokens = filterByPredicate(
|
|
28
|
+
micromarkTokens,
|
|
29
|
+
(token) => token.type === type,
|
|
30
|
+
(token) => ((token.type === "htmlFlow") ? [] : token.children)
|
|
31
|
+
);
|
|
32
|
+
for (const token of emphasisTokens) {
|
|
33
|
+
const { children } = token;
|
|
34
|
+
const startSequence = tokenIfType(children[0], typeSequence);
|
|
35
|
+
const endSequence = tokenIfType(children[children.length - 1], typeSequence);
|
|
36
|
+
if (startSequence && endSequence) {
|
|
37
|
+
const markupStyle = emphasisOrStrongStyleFor(startSequence.text);
|
|
38
|
+
if (style === "consistent") {
|
|
39
|
+
style = markupStyle;
|
|
40
|
+
}
|
|
41
|
+
if (style !== markupStyle) {
|
|
42
|
+
const underscoreIntraword = (style === "underscore") && (
|
|
43
|
+
intrawordRe.test(
|
|
44
|
+
lines[startSequence.startLine - 1][startSequence.startColumn - 2]
|
|
45
|
+
) ||
|
|
46
|
+
intrawordRe.test(
|
|
47
|
+
lines[endSequence.endLine - 1][endSequence.endColumn - 1]
|
|
48
|
+
)
|
|
49
|
+
);
|
|
50
|
+
if (!underscoreIntraword) {
|
|
51
|
+
for (const sequence of [ startSequence, endSequence ]) {
|
|
52
|
+
addError(
|
|
53
|
+
onError,
|
|
54
|
+
sequence.startLine,
|
|
55
|
+
`Expected: ${style}; Actual: ${markupStyle}`,
|
|
56
|
+
undefined,
|
|
57
|
+
[ sequence.startColumn, sequence.text.length ],
|
|
58
|
+
{
|
|
59
|
+
"editColumn": sequence.startColumn,
|
|
60
|
+
"deleteCount": sequence.text.length,
|
|
61
|
+
"insertText": (style === "asterisk") ? asterisk : underline
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
72
|
+
/** @type import("./markdownlint").Rule[] */
|
|
73
|
+
module.exports = [
|
|
74
|
+
{
|
|
75
|
+
"names": [ "MD049", "emphasis-style" ],
|
|
76
|
+
"description": "Emphasis style",
|
|
77
|
+
"tags": [ "emphasis" ],
|
|
78
|
+
"parser": "micromark",
|
|
79
|
+
"function": function MD049(params, onError) {
|
|
80
|
+
return impl(
|
|
81
|
+
params,
|
|
82
|
+
onError,
|
|
83
|
+
"emphasis",
|
|
84
|
+
"emphasisSequence",
|
|
85
|
+
"*",
|
|
86
|
+
"_",
|
|
87
|
+
params.config.style || undefined
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"names": [ "MD050", "strong-style" ],
|
|
93
|
+
"description": "Strong style",
|
|
94
|
+
"tags": [ "emphasis" ],
|
|
95
|
+
"parser": "micromark",
|
|
96
|
+
"function": function MD050(params, onError) {
|
|
97
|
+
return impl(
|
|
98
|
+
params,
|
|
99
|
+
onError,
|
|
100
|
+
"strong",
|
|
101
|
+
"strongSequence",
|
|
102
|
+
"**",
|
|
103
|
+
"__",
|
|
104
|
+
params.config.style || undefined
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
];
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
const { addError, addErrorDetailIf, getHtmlAttributeRe } =
|
|
6
|
+
require("../helpers");
|
|
7
|
+
const { filterByPredicate, filterByTypes, getHtmlTagInfo } =
|
|
8
|
+
require("../helpers/micromark.cjs");
|
|
9
|
+
|
|
10
|
+
// Regular expression for identifying HTML anchor names
|
|
11
|
+
const idRe = getHtmlAttributeRe("id");
|
|
12
|
+
const nameRe = getHtmlAttributeRe("name");
|
|
13
|
+
const anchorRe = /\{(#[a-z\d]+(?:[-_][a-z\d]+)*)\}/gu;
|
|
14
|
+
const lineFragmentRe = /^#(?:L\d+(?:C\d+)?-L\d+(?:C\d+)?|L\d+)$/;
|
|
15
|
+
|
|
16
|
+
// Sets for filtering heading tokens during conversion
|
|
17
|
+
const childrenExclude = new Set([ "image", "reference", "resource" ]);
|
|
18
|
+
const tokensInclude = new Set(
|
|
19
|
+
[ "characterEscapeValue", "codeTextData", "data", "mathTextData" ]
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Converts a Markdown heading into an HTML fragment according to the rules
|
|
24
|
+
* used by GitHub.
|
|
25
|
+
*
|
|
26
|
+
* @param {import("../helpers/micromark.cjs").Token} headingText Heading text token.
|
|
27
|
+
* @returns {string} Fragment string for heading.
|
|
28
|
+
*/
|
|
29
|
+
function convertHeadingToHTMLFragment(headingText) {
|
|
30
|
+
const inlineText =
|
|
31
|
+
filterByPredicate(
|
|
32
|
+
headingText.children,
|
|
33
|
+
(token) => tokensInclude.has(token.type),
|
|
34
|
+
(token) => (childrenExclude.has(token.type) ? [] : token.children)
|
|
35
|
+
)
|
|
36
|
+
.map((token) => token.text)
|
|
37
|
+
.join("");
|
|
38
|
+
return "#" + encodeURIComponent(
|
|
39
|
+
inlineText
|
|
40
|
+
.toLowerCase()
|
|
41
|
+
// RegExp source with Ruby's \p{Word} expanded into its General Categories
|
|
42
|
+
// https://github.com/gjtorikian/html-pipeline/blob/main/lib/html/pipeline/toc_filter.rb
|
|
43
|
+
// https://ruby-doc.org/core-3.0.2/Regexp.html
|
|
44
|
+
.replace(
|
|
45
|
+
/[^\p{Letter}\p{Mark}\p{Number}\p{Connector_Punctuation}\- ]/gu,
|
|
46
|
+
""
|
|
47
|
+
)
|
|
48
|
+
.replace(/ /gu, "-")
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Unescapes the text of a String-type micromark Token.
|
|
54
|
+
*
|
|
55
|
+
* @param {import("../helpers/micromark.cjs").Token} token String-type micromark Token.
|
|
56
|
+
* @returns {string} Unescaped token text.
|
|
57
|
+
*/
|
|
58
|
+
function unescapeStringTokenText(token) {
|
|
59
|
+
return filterByTypes(token.children, [ "characterEscapeValue", "data" ])
|
|
60
|
+
.map((child) => child.text)
|
|
61
|
+
.join("");
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
65
|
+
/** @type import("./markdownlint").Rule */
|
|
66
|
+
module.exports = {
|
|
67
|
+
"names": [ "MD051", "link-fragments" ],
|
|
68
|
+
"description": "Link fragments should be valid",
|
|
69
|
+
"tags": [ "links" ],
|
|
70
|
+
"parser": "micromark",
|
|
71
|
+
"function": function MD051(params, onError) {
|
|
72
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
73
|
+
/** @type import("../helpers/micromark.cjs").Token[] */
|
|
74
|
+
const micromarkTokens =
|
|
75
|
+
// @ts-ignore
|
|
76
|
+
params.parsers.micromark.tokens;
|
|
77
|
+
const fragments = new Map();
|
|
78
|
+
|
|
79
|
+
// Process headings
|
|
80
|
+
const headingTexts = filterByTypes(micromarkTokens, [ "atxHeadingText", "setextHeadingText" ]);
|
|
81
|
+
for (const headingText of headingTexts) {
|
|
82
|
+
const fragment = convertHeadingToHTMLFragment(headingText);
|
|
83
|
+
if (fragment !== "#") {
|
|
84
|
+
const count = fragments.get(fragment) || 0;
|
|
85
|
+
if (count) {
|
|
86
|
+
fragments.set(`${fragment}-${count}`, 0);
|
|
87
|
+
}
|
|
88
|
+
fragments.set(fragment, count + 1);
|
|
89
|
+
let match = null;
|
|
90
|
+
while ((match = anchorRe.exec(headingText.text)) !== null) {
|
|
91
|
+
const [ , anchor ] = match;
|
|
92
|
+
if (!fragments.has(anchor)) {
|
|
93
|
+
fragments.set(anchor, 1);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// Process HTML anchors
|
|
100
|
+
for (const token of filterByTypes(micromarkTokens, [ "htmlText" ])) {
|
|
101
|
+
const htmlTagInfo = getHtmlTagInfo(token);
|
|
102
|
+
if (htmlTagInfo && !htmlTagInfo.close) {
|
|
103
|
+
const anchorMatch = idRe.exec(token.text) ||
|
|
104
|
+
(htmlTagInfo.name.toLowerCase() === "a" && nameRe.exec(token.text));
|
|
105
|
+
if (anchorMatch && anchorMatch.length > 0) {
|
|
106
|
+
fragments.set(`#${anchorMatch[1]}`, 0);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// Process link and definition fragments
|
|
112
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
113
|
+
/** @type import("../helpers/micromark.cjs").TokenType[][] */
|
|
114
|
+
const parentChilds = [
|
|
115
|
+
[ "link", "resourceDestinationString" ],
|
|
116
|
+
[ "definition", "definitionDestinationString" ]
|
|
117
|
+
];
|
|
118
|
+
for (const [ parentType, definitionType ] of parentChilds) {
|
|
119
|
+
const links = filterByTypes(micromarkTokens, [ parentType ]);
|
|
120
|
+
for (const link of links) {
|
|
121
|
+
const definitions = filterByTypes(link.children, [ definitionType ]);
|
|
122
|
+
for (const definition of definitions) {
|
|
123
|
+
const { endColumn, startColumn } = definition;
|
|
124
|
+
const text = unescapeStringTokenText(definition);
|
|
125
|
+
const encodedText = `#${encodeURIComponent(text.slice(1))}`;
|
|
126
|
+
if (
|
|
127
|
+
(text.length > 1) &&
|
|
128
|
+
text.startsWith("#") &&
|
|
129
|
+
!fragments.has(encodedText) &&
|
|
130
|
+
!lineFragmentRe.test(encodedText)
|
|
131
|
+
) {
|
|
132
|
+
// eslint-disable-next-line no-undef-init
|
|
133
|
+
let context = undefined;
|
|
134
|
+
// eslint-disable-next-line no-undef-init
|
|
135
|
+
let range = undefined;
|
|
136
|
+
// eslint-disable-next-line no-undef-init
|
|
137
|
+
let fixInfo = undefined;
|
|
138
|
+
if (link.startLine === link.endLine) {
|
|
139
|
+
context = link.text;
|
|
140
|
+
range = [ link.startColumn, link.endColumn - link.startColumn ];
|
|
141
|
+
fixInfo = {
|
|
142
|
+
"editColumn": startColumn,
|
|
143
|
+
"deleteCount": endColumn - startColumn
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
const textLower = text.toLowerCase();
|
|
147
|
+
const mixedCaseKey = [ ...fragments.keys() ]
|
|
148
|
+
.find((key) => textLower === key.toLowerCase());
|
|
149
|
+
if (mixedCaseKey) {
|
|
150
|
+
// @ts-ignore
|
|
151
|
+
(fixInfo || {}).insertText = mixedCaseKey;
|
|
152
|
+
addErrorDetailIf(
|
|
153
|
+
onError,
|
|
154
|
+
link.startLine,
|
|
155
|
+
mixedCaseKey,
|
|
156
|
+
text,
|
|
157
|
+
undefined,
|
|
158
|
+
context,
|
|
159
|
+
range,
|
|
160
|
+
fixInfo
|
|
161
|
+
);
|
|
162
|
+
} else {
|
|
163
|
+
addError(
|
|
164
|
+
onError,
|
|
165
|
+
link.startLine,
|
|
166
|
+
undefined,
|
|
167
|
+
context,
|
|
168
|
+
range
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
const { addError } = require("../helpers");
|
|
6
|
+
const { referenceLinkImageData } = require("./cache");
|
|
7
|
+
|
|
8
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
9
|
+
/** @type import("./markdownlint").Rule */
|
|
10
|
+
module.exports = {
|
|
11
|
+
"names": [ "MD052", "reference-links-images" ],
|
|
12
|
+
"description":
|
|
13
|
+
"Reference links and images should use a label that is defined",
|
|
14
|
+
"tags": [ "images", "links" ],
|
|
15
|
+
"parser": "none",
|
|
16
|
+
"function": function MD052(params, onError) {
|
|
17
|
+
const { config, lines } = params;
|
|
18
|
+
const shortcutSyntax = config.shortcut_syntax || false;
|
|
19
|
+
const { definitions, references, shortcuts } = referenceLinkImageData();
|
|
20
|
+
const entries = shortcutSyntax ?
|
|
21
|
+
[ ...references.entries(), ...shortcuts.entries() ] :
|
|
22
|
+
references.entries();
|
|
23
|
+
// Look for links/images that use an undefined link reference
|
|
24
|
+
for (const reference of entries) {
|
|
25
|
+
const [ label, datas ] = reference;
|
|
26
|
+
if (!definitions.has(label)) {
|
|
27
|
+
for (const data of datas) {
|
|
28
|
+
const [ lineIndex, index, length ] = data;
|
|
29
|
+
// Context will be incomplete if reporting for a multi-line link
|
|
30
|
+
const context = lines[lineIndex].slice(index, index + length);
|
|
31
|
+
addError(
|
|
32
|
+
onError,
|
|
33
|
+
lineIndex + 1,
|
|
34
|
+
`Missing link or image reference definition: "${label}"`,
|
|
35
|
+
context,
|
|
36
|
+
[ index + 1, context.length ]
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
const { addError, ellipsify, linkReferenceDefinitionRe } =
|
|
6
|
+
require("../helpers");
|
|
7
|
+
const { referenceLinkImageData } = require("./cache");
|
|
8
|
+
|
|
9
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
10
|
+
/** @type import("./markdownlint").Rule */
|
|
11
|
+
module.exports = {
|
|
12
|
+
"names": [ "MD053", "link-image-reference-definitions" ],
|
|
13
|
+
"description": "Link and image reference definitions should be needed",
|
|
14
|
+
"tags": [ "images", "links" ],
|
|
15
|
+
"parser": "none",
|
|
16
|
+
"function": function MD053(params, onError) {
|
|
17
|
+
const ignored = new Set(params.config.ignored_definitions || [ "//" ]);
|
|
18
|
+
const lines = params.lines;
|
|
19
|
+
const { references, shortcuts, definitions, duplicateDefinitions } =
|
|
20
|
+
referenceLinkImageData();
|
|
21
|
+
const singleLineDefinition = (line) => (
|
|
22
|
+
line.replace(linkReferenceDefinitionRe, "").trim().length > 0
|
|
23
|
+
);
|
|
24
|
+
const deleteFixInfo = {
|
|
25
|
+
"deleteCount": -1
|
|
26
|
+
};
|
|
27
|
+
// Look for unused link references (unreferenced by any link/image)
|
|
28
|
+
for (const definition of definitions.entries()) {
|
|
29
|
+
const [ label, [ lineIndex ] ] = definition;
|
|
30
|
+
if (
|
|
31
|
+
!ignored.has(label) &&
|
|
32
|
+
!references.has(label) &&
|
|
33
|
+
!shortcuts.has(label)
|
|
34
|
+
) {
|
|
35
|
+
const line = lines[lineIndex];
|
|
36
|
+
addError(
|
|
37
|
+
onError,
|
|
38
|
+
lineIndex + 1,
|
|
39
|
+
`Unused link or image reference definition: "${label}"`,
|
|
40
|
+
ellipsify(line),
|
|
41
|
+
[ 1, line.length ],
|
|
42
|
+
singleLineDefinition(line) ? deleteFixInfo : 0
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
// Look for duplicate link references (defined more than once)
|
|
47
|
+
for (const duplicateDefinition of duplicateDefinitions) {
|
|
48
|
+
const [ label, lineIndex ] = duplicateDefinition;
|
|
49
|
+
if (!ignored.has(label)) {
|
|
50
|
+
const line = lines[lineIndex];
|
|
51
|
+
addError(
|
|
52
|
+
onError,
|
|
53
|
+
lineIndex + 1,
|
|
54
|
+
`Duplicate link or image reference definition: "${label}"`,
|
|
55
|
+
ellipsify(line),
|
|
56
|
+
[ 1, line.length ],
|
|
57
|
+
singleLineDefinition(line) ? deleteFixInfo : 0
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
};
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
const { addErrorContext, nextLinesRe } = require("../helpers");
|
|
6
|
+
const { filterByTypes, filterByPredicate, getTokenTextByType } =
|
|
7
|
+
require("../helpers/micromark.cjs");
|
|
8
|
+
const { referenceLinkImageData } = require("./cache");
|
|
9
|
+
|
|
10
|
+
const backslashEscapeRe = /\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g;
|
|
11
|
+
const removeBackslashEscapes = (text) => text.replace(backslashEscapeRe, "$1");
|
|
12
|
+
const autolinkDisallowedRe = /[ <>]/;
|
|
13
|
+
const autolinkAble = (destination) => {
|
|
14
|
+
try {
|
|
15
|
+
// eslint-disable-next-line no-new
|
|
16
|
+
new URL(destination);
|
|
17
|
+
} catch {
|
|
18
|
+
// Not an absolute URL
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
return !autolinkDisallowedRe.test(destination);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
25
|
+
/** @type import("./markdownlint").Rule */
|
|
26
|
+
module.exports = {
|
|
27
|
+
"names": [ "MD054", "link-image-style" ],
|
|
28
|
+
"description": "Link and image style",
|
|
29
|
+
"tags": [ "images", "links" ],
|
|
30
|
+
"parser": "micromark",
|
|
31
|
+
"function": (params, onError) => {
|
|
32
|
+
const config = params.config;
|
|
33
|
+
const autolink = (config.autolink === undefined) || !!config.autolink;
|
|
34
|
+
const inline = (config.inline === undefined) || !!config.inline;
|
|
35
|
+
const full = (config.full === undefined) || !!config.full;
|
|
36
|
+
const collapsed = (config.collapsed === undefined) || !!config.collapsed;
|
|
37
|
+
const shortcut = (config.shortcut === undefined) || !!config.shortcut;
|
|
38
|
+
const urlInline = (config.url_inline === undefined) || !!config.url_inline;
|
|
39
|
+
if (autolink && inline && full && collapsed && shortcut && urlInline) {
|
|
40
|
+
// Everything allowed, nothing to check
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
44
|
+
/** @type import("../helpers/micromark.cjs").Token[] */
|
|
45
|
+
const micromarkTokens =
|
|
46
|
+
// @ts-ignore
|
|
47
|
+
params.parsers.micromark.tokens;
|
|
48
|
+
const { definitions } = referenceLinkImageData();
|
|
49
|
+
const links = filterByTypes(micromarkTokens, [ "autolink", "image", "link" ]);
|
|
50
|
+
for (const link of links) {
|
|
51
|
+
let label = null;
|
|
52
|
+
let destination = null;
|
|
53
|
+
const {
|
|
54
|
+
children, endColumn, endLine, startColumn, startLine, text, type
|
|
55
|
+
} = link;
|
|
56
|
+
const image = (type === "image");
|
|
57
|
+
let isError = false;
|
|
58
|
+
if (type === "autolink") {
|
|
59
|
+
// link kind is an autolink
|
|
60
|
+
destination = getTokenTextByType(children, "autolinkProtocol");
|
|
61
|
+
label = destination;
|
|
62
|
+
isError = !autolink;
|
|
63
|
+
} else {
|
|
64
|
+
// link type is "image" or "link"
|
|
65
|
+
const descendents = filterByPredicate(children);
|
|
66
|
+
label = getTokenTextByType(descendents, "labelText");
|
|
67
|
+
destination =
|
|
68
|
+
getTokenTextByType(descendents, "resourceDestinationString");
|
|
69
|
+
if (destination) {
|
|
70
|
+
// link kind is an inline link
|
|
71
|
+
const title = getTokenTextByType(descendents, "resourceTitleString");
|
|
72
|
+
isError = !inline || (
|
|
73
|
+
!urlInline &&
|
|
74
|
+
autolink &&
|
|
75
|
+
!image &&
|
|
76
|
+
!title &&
|
|
77
|
+
(label === destination) &&
|
|
78
|
+
autolinkAble(destination)
|
|
79
|
+
);
|
|
80
|
+
} else {
|
|
81
|
+
// link kind is a full/collapsed/shortcut reference link
|
|
82
|
+
const isShortcut = !children.some((t) => t.type === "reference");
|
|
83
|
+
const referenceString = getTokenTextByType(descendents, "referenceString");
|
|
84
|
+
const isCollapsed = (referenceString === null);
|
|
85
|
+
const definition = definitions.get(referenceString || label);
|
|
86
|
+
destination = definition && definition[1];
|
|
87
|
+
isError = destination &&
|
|
88
|
+
(isShortcut ? !shortcut : (isCollapsed ? !collapsed : !full));
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
if (isError) {
|
|
92
|
+
let range = null;
|
|
93
|
+
let fixInfo = null;
|
|
94
|
+
if (startLine === endLine) {
|
|
95
|
+
range = [ startColumn, endColumn - startColumn ];
|
|
96
|
+
let insertText = null;
|
|
97
|
+
const canInline = (inline && label);
|
|
98
|
+
const canAutolink = (autolink && !image && autolinkAble(destination));
|
|
99
|
+
if (canInline && (urlInline || !canAutolink)) {
|
|
100
|
+
// Most useful form
|
|
101
|
+
const prefix = (image ? "!" : "");
|
|
102
|
+
// @ts-ignore
|
|
103
|
+
const escapedLabel = label.replace(/[[\]]/g, "\\$&");
|
|
104
|
+
const escapedDestination = destination.replace(/[()]/g, "\\$&");
|
|
105
|
+
insertText = `${prefix}[${escapedLabel}](${escapedDestination})`;
|
|
106
|
+
} else if (canAutolink) {
|
|
107
|
+
// Simplest form
|
|
108
|
+
insertText = `<${removeBackslashEscapes(destination)}>`;
|
|
109
|
+
}
|
|
110
|
+
if (insertText) {
|
|
111
|
+
fixInfo = {
|
|
112
|
+
"editColumn": range[0],
|
|
113
|
+
insertText,
|
|
114
|
+
"deleteCount": range[1]
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
addErrorContext(
|
|
119
|
+
onError,
|
|
120
|
+
startLine,
|
|
121
|
+
text.replace(nextLinesRe, ""),
|
|
122
|
+
null,
|
|
123
|
+
null,
|
|
124
|
+
range,
|
|
125
|
+
fixInfo
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
const { addErrorDetailIf } = require("../helpers");
|
|
6
|
+
const { filterByTypes } = require("../helpers/micromark.cjs");
|
|
7
|
+
|
|
8
|
+
const whitespaceTypes = new Set([ "linePrefix", "whitespace" ]);
|
|
9
|
+
const ignoreWhitespace = (tokens) => tokens.filter(
|
|
10
|
+
(token) => !whitespaceTypes.has(token.type)
|
|
11
|
+
);
|
|
12
|
+
const firstOrNothing = (items) => items[0];
|
|
13
|
+
const lastOrNothing = (items) => items[items.length - 1];
|
|
14
|
+
const makeRange = (start, end) => [ start, end - start + 1 ];
|
|
15
|
+
|
|
16
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
17
|
+
/** @type import("./markdownlint").Rule */
|
|
18
|
+
module.exports = {
|
|
19
|
+
"names": [ "MD055", "table-pipe-style" ],
|
|
20
|
+
"description": "Table pipe style",
|
|
21
|
+
"tags": [ "table" ],
|
|
22
|
+
"parser": "micromark",
|
|
23
|
+
"function": function MD055(params, onError) {
|
|
24
|
+
const style = String(params.config.style || "consistent");
|
|
25
|
+
let expectedStyle = style;
|
|
26
|
+
let expectedLeadingPipe =
|
|
27
|
+
((expectedStyle !== "no_leading_or_trailing") && (expectedStyle !== "trailing_only"));
|
|
28
|
+
let expectedTrailingPipe =
|
|
29
|
+
((expectedStyle !== "no_leading_or_trailing") && (expectedStyle !== "leading_only"));
|
|
30
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
31
|
+
/** @type import("../helpers/micromark.cjs").Token[] */
|
|
32
|
+
const micromarkTokens =
|
|
33
|
+
// @ts-ignore
|
|
34
|
+
params.parsers.micromark.tokens;
|
|
35
|
+
const tables = filterByTypes(micromarkTokens, [ "table" ]);
|
|
36
|
+
for (const table of tables) {
|
|
37
|
+
const rows = filterByTypes(table.children, [ "tableDelimiterRow", "tableRow" ]);
|
|
38
|
+
for (const row of rows) {
|
|
39
|
+
// The following uses of first/lastOrNothing lack fallback handling
|
|
40
|
+
// because it seems not to be possible (i.e., 0% coverage)
|
|
41
|
+
const firstCell = firstOrNothing(row.children);
|
|
42
|
+
const leadingToken = firstOrNothing(ignoreWhitespace(firstCell.children));
|
|
43
|
+
const actualLeadingPipe = (leadingToken.type === "tableCellDivider");
|
|
44
|
+
const lastCell = lastOrNothing(row.children);
|
|
45
|
+
const trailingToken = lastOrNothing(ignoreWhitespace(lastCell.children));
|
|
46
|
+
const actualTrailingPipe = (trailingToken.type === "tableCellDivider");
|
|
47
|
+
const actualStyle = actualLeadingPipe ?
|
|
48
|
+
(actualTrailingPipe ? "leading_and_trailing" : "leading_only") :
|
|
49
|
+
(actualTrailingPipe ? "trailing_only" : "no_leading_or_trailing");
|
|
50
|
+
if (expectedStyle === "consistent") {
|
|
51
|
+
expectedStyle = actualStyle;
|
|
52
|
+
expectedLeadingPipe = actualLeadingPipe;
|
|
53
|
+
expectedTrailingPipe = actualTrailingPipe;
|
|
54
|
+
}
|
|
55
|
+
if (actualLeadingPipe !== expectedLeadingPipe) {
|
|
56
|
+
addErrorDetailIf(
|
|
57
|
+
onError,
|
|
58
|
+
firstCell.startLine,
|
|
59
|
+
expectedStyle,
|
|
60
|
+
actualStyle,
|
|
61
|
+
`${expectedLeadingPipe ? "Missing" : "Unexpected"} leading pipe`,
|
|
62
|
+
undefined,
|
|
63
|
+
makeRange(row.startColumn, firstCell.startColumn)
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
if (actualTrailingPipe !== expectedTrailingPipe) {
|
|
67
|
+
addErrorDetailIf(
|
|
68
|
+
onError,
|
|
69
|
+
lastCell.endLine,
|
|
70
|
+
expectedStyle,
|
|
71
|
+
actualStyle,
|
|
72
|
+
`${expectedTrailingPipe ? "Missing" : "Unexpected"} trailing pipe`,
|
|
73
|
+
undefined,
|
|
74
|
+
makeRange(lastCell.endColumn - 1, row.endColumn - 1)
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
const { addErrorDetailIf } = require("../helpers");
|
|
6
|
+
const { filterByTypes } = require("../helpers/micromark.cjs");
|
|
7
|
+
|
|
8
|
+
const makeRange = (start, end) => [ start, end - start + 1 ];
|
|
9
|
+
|
|
10
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
11
|
+
/** @type import("./markdownlint").Rule */
|
|
12
|
+
module.exports = {
|
|
13
|
+
"names": [ "MD056", "table-column-count" ],
|
|
14
|
+
"description": "Table column count",
|
|
15
|
+
"tags": [ "table" ],
|
|
16
|
+
"parser": "micromark",
|
|
17
|
+
"function": function MD056(params, onError) {
|
|
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 tables = filterByTypes(micromarkTokens, [ "table" ]);
|
|
24
|
+
for (const table of tables) {
|
|
25
|
+
const rows = filterByTypes(table.children, [ "tableDelimiterRow", "tableRow" ]);
|
|
26
|
+
let expectedCount = 0;
|
|
27
|
+
for (const row of rows) {
|
|
28
|
+
const cells = filterByTypes(row.children, [ "tableData", "tableDelimiter", "tableHeader" ]);
|
|
29
|
+
const actualCount = cells.length;
|
|
30
|
+
expectedCount ||= actualCount;
|
|
31
|
+
let detail = null;
|
|
32
|
+
let range = null;
|
|
33
|
+
if (actualCount < expectedCount) {
|
|
34
|
+
detail = "Too few cells, row will be missing data";
|
|
35
|
+
range = [ row.endColumn - 1, 1 ];
|
|
36
|
+
} else if (expectedCount < actualCount) {
|
|
37
|
+
detail = "Too many cells, extra data will be missing";
|
|
38
|
+
range = makeRange(cells[expectedCount].startColumn, row.endColumn - 1);
|
|
39
|
+
}
|
|
40
|
+
addErrorDetailIf(
|
|
41
|
+
onError,
|
|
42
|
+
row.endLine,
|
|
43
|
+
expectedCount,
|
|
44
|
+
actualCount,
|
|
45
|
+
detail,
|
|
46
|
+
null,
|
|
47
|
+
range
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|