@alexlit/lint-kit 110.1.0 → 110.2.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-commitlint/package.json +2 -2
- 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 +2 -2
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
const { addErrorDetailIf, filterTokens } = require("../helpers");
|
|
6
|
+
|
|
7
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
8
|
+
/** @type import("./markdownlint").Rule */
|
|
9
|
+
module.exports = {
|
|
10
|
+
"names": [ "MD001", "heading-increment" ],
|
|
11
|
+
"description": "Heading levels should only increment by one level at a time",
|
|
12
|
+
"tags": [ "headings" ],
|
|
13
|
+
"parser": "markdownit",
|
|
14
|
+
"function": function MD001(params, onError) {
|
|
15
|
+
let prevLevel = 0;
|
|
16
|
+
filterTokens(params, "heading_open", function forToken(token) {
|
|
17
|
+
const level = Number.parseInt(token.tag.slice(1), 10);
|
|
18
|
+
if (prevLevel && (level > prevLevel)) {
|
|
19
|
+
addErrorDetailIf(onError, token.lineNumber,
|
|
20
|
+
"h" + (prevLevel + 1), "h" + level);
|
|
21
|
+
}
|
|
22
|
+
prevLevel = level;
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
const { addErrorDetailIf, filterTokens, headingStyleFor } =
|
|
6
|
+
require("../helpers");
|
|
7
|
+
|
|
8
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
9
|
+
/** @type import("./markdownlint").Rule */
|
|
10
|
+
module.exports = {
|
|
11
|
+
"names": [ "MD003", "heading-style" ],
|
|
12
|
+
"description": "Heading style",
|
|
13
|
+
"tags": [ "headings" ],
|
|
14
|
+
"parser": "markdownit",
|
|
15
|
+
"function": function MD003(params, onError) {
|
|
16
|
+
let style = String(params.config.style || "consistent");
|
|
17
|
+
filterTokens(params, "heading_open", function forToken(token) {
|
|
18
|
+
const styleForToken = headingStyleFor(token);
|
|
19
|
+
if (style === "consistent") {
|
|
20
|
+
style = styleForToken;
|
|
21
|
+
}
|
|
22
|
+
if (styleForToken !== style) {
|
|
23
|
+
const h12 = /h[12]/.test(token.tag);
|
|
24
|
+
const setextWithAtx =
|
|
25
|
+
(style === "setext_with_atx") &&
|
|
26
|
+
((h12 && (styleForToken === "setext")) ||
|
|
27
|
+
(!h12 && (styleForToken === "atx")));
|
|
28
|
+
const setextWithAtxClosed =
|
|
29
|
+
(style === "setext_with_atx_closed") &&
|
|
30
|
+
((h12 && (styleForToken === "setext")) ||
|
|
31
|
+
(!h12 && (styleForToken === "atx_closed")));
|
|
32
|
+
if (!setextWithAtx && !setextWithAtxClosed) {
|
|
33
|
+
let expected = style;
|
|
34
|
+
if (style === "setext_with_atx") {
|
|
35
|
+
expected = h12 ? "setext" : "atx";
|
|
36
|
+
} else if (style === "setext_with_atx_closed") {
|
|
37
|
+
expected = h12 ? "setext" : "atx_closed";
|
|
38
|
+
}
|
|
39
|
+
addErrorDetailIf(onError, token.lineNumber,
|
|
40
|
+
expected, styleForToken);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
const { addErrorDetailIf, listItemMarkerRe, unorderedListStyleFor } =
|
|
6
|
+
require("../helpers");
|
|
7
|
+
const { flattenedLists } = require("./cache");
|
|
8
|
+
|
|
9
|
+
const expectedStyleToMarker = {
|
|
10
|
+
"dash": "-",
|
|
11
|
+
"plus": "+",
|
|
12
|
+
"asterisk": "*"
|
|
13
|
+
};
|
|
14
|
+
const differentItemStyle = {
|
|
15
|
+
"dash": "plus",
|
|
16
|
+
"plus": "asterisk",
|
|
17
|
+
"asterisk": "dash"
|
|
18
|
+
};
|
|
19
|
+
const validStyles = Object.keys(expectedStyleToMarker);
|
|
20
|
+
|
|
21
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
22
|
+
/** @type import("./markdownlint").Rule */
|
|
23
|
+
module.exports = {
|
|
24
|
+
"names": [ "MD004", "ul-style" ],
|
|
25
|
+
"description": "Unordered list style",
|
|
26
|
+
"tags": [ "bullet", "ul" ],
|
|
27
|
+
"parser": "none",
|
|
28
|
+
"function": function MD004(params, onError) {
|
|
29
|
+
const style = String(params.config.style || "consistent");
|
|
30
|
+
let expectedStyle = style;
|
|
31
|
+
const nestingStyles = [];
|
|
32
|
+
for (const list of flattenedLists()) {
|
|
33
|
+
if (list.unordered) {
|
|
34
|
+
if (expectedStyle === "consistent") {
|
|
35
|
+
expectedStyle = unorderedListStyleFor(list.items[0]);
|
|
36
|
+
}
|
|
37
|
+
for (const item of list.items) {
|
|
38
|
+
const itemStyle = unorderedListStyleFor(item);
|
|
39
|
+
if (style === "sublist") {
|
|
40
|
+
const nesting = list.nesting;
|
|
41
|
+
if (!nestingStyles[nesting]) {
|
|
42
|
+
nestingStyles[nesting] =
|
|
43
|
+
(itemStyle === nestingStyles[nesting - 1]) ?
|
|
44
|
+
differentItemStyle[itemStyle] :
|
|
45
|
+
itemStyle;
|
|
46
|
+
}
|
|
47
|
+
expectedStyle = nestingStyles[nesting];
|
|
48
|
+
}
|
|
49
|
+
if (!validStyles.includes(expectedStyle)) {
|
|
50
|
+
expectedStyle = validStyles[0];
|
|
51
|
+
}
|
|
52
|
+
let range = null;
|
|
53
|
+
let fixInfo = null;
|
|
54
|
+
const match = item.line.match(listItemMarkerRe);
|
|
55
|
+
if (match) {
|
|
56
|
+
const column = match.index + 1;
|
|
57
|
+
const length = match[0].length;
|
|
58
|
+
range = [ column, length ];
|
|
59
|
+
fixInfo = {
|
|
60
|
+
"editColumn": match[1].length + 1,
|
|
61
|
+
"deleteCount": 1,
|
|
62
|
+
"insertText": expectedStyleToMarker[expectedStyle]
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
addErrorDetailIf(
|
|
66
|
+
onError,
|
|
67
|
+
item.lineNumber,
|
|
68
|
+
expectedStyle,
|
|
69
|
+
itemStyle,
|
|
70
|
+
null,
|
|
71
|
+
null,
|
|
72
|
+
range,
|
|
73
|
+
fixInfo
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
const { addError, addErrorDetailIf } = require("../helpers");
|
|
6
|
+
const { filterByTypes, inHtmlFlow } = require("../helpers/micromark.cjs");
|
|
7
|
+
|
|
8
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
9
|
+
/** @type import("./markdownlint").Rule */
|
|
10
|
+
module.exports = {
|
|
11
|
+
"names": [ "MD005", "list-indent" ],
|
|
12
|
+
"description": "Inconsistent indentation for list items at the same level",
|
|
13
|
+
"tags": [ "bullet", "ul", "indentation" ],
|
|
14
|
+
"parser": "micromark",
|
|
15
|
+
"function": function MD005(params, onError) {
|
|
16
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
17
|
+
/** @type import("../helpers/micromark.cjs").Token[] */
|
|
18
|
+
const micromarkTokens =
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
params.parsers.micromark.tokens;
|
|
21
|
+
const lists = filterByTypes(
|
|
22
|
+
micromarkTokens,
|
|
23
|
+
[ "listOrdered", "listUnordered" ]
|
|
24
|
+
).filter((list) => !inHtmlFlow(list));
|
|
25
|
+
for (const list of lists) {
|
|
26
|
+
const expectedIndent = list.startColumn - 1;
|
|
27
|
+
let expectedEnd = 0;
|
|
28
|
+
let endMatching = false;
|
|
29
|
+
const listItemPrefixes =
|
|
30
|
+
list.children.filter((token) => (token.type === "listItemPrefix"));
|
|
31
|
+
for (const listItemPrefix of listItemPrefixes) {
|
|
32
|
+
const lineNumber = listItemPrefix.startLine;
|
|
33
|
+
const actualIndent = listItemPrefix.startColumn - 1;
|
|
34
|
+
const range = [ 1, listItemPrefix.endColumn - 1 ];
|
|
35
|
+
if (list.type === "listUnordered") {
|
|
36
|
+
addErrorDetailIf(
|
|
37
|
+
onError,
|
|
38
|
+
lineNumber,
|
|
39
|
+
expectedIndent,
|
|
40
|
+
actualIndent,
|
|
41
|
+
null,
|
|
42
|
+
null,
|
|
43
|
+
range
|
|
44
|
+
// No fixInfo; MD007 handles this scenario better
|
|
45
|
+
);
|
|
46
|
+
} else {
|
|
47
|
+
const markerLength = listItemPrefix.text.trim().length;
|
|
48
|
+
const actualEnd = listItemPrefix.startColumn + markerLength - 1;
|
|
49
|
+
expectedEnd = expectedEnd || actualEnd;
|
|
50
|
+
if ((expectedIndent !== actualIndent) || endMatching) {
|
|
51
|
+
if (expectedEnd === actualEnd) {
|
|
52
|
+
endMatching = true;
|
|
53
|
+
} else {
|
|
54
|
+
const detail = endMatching ?
|
|
55
|
+
`Expected: (${expectedEnd}); Actual: (${actualEnd})` :
|
|
56
|
+
`Expected: ${expectedIndent}; Actual: ${actualIndent}`;
|
|
57
|
+
const expected = endMatching ?
|
|
58
|
+
expectedEnd - markerLength :
|
|
59
|
+
expectedIndent;
|
|
60
|
+
const actual = endMatching ?
|
|
61
|
+
actualEnd - markerLength :
|
|
62
|
+
actualIndent;
|
|
63
|
+
addError(
|
|
64
|
+
onError,
|
|
65
|
+
lineNumber,
|
|
66
|
+
detail,
|
|
67
|
+
undefined,
|
|
68
|
+
range,
|
|
69
|
+
{
|
|
70
|
+
"editColumn": Math.min(actual, expected) + 1,
|
|
71
|
+
"deleteCount": Math.max(actual - expected, 0),
|
|
72
|
+
"insertText": "".padEnd(Math.max(expected - actual, 0))
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
const { addErrorDetailIf } = require("../helpers");
|
|
6
|
+
const { filterByTypes, getTokenParentOfType, inHtmlFlow } =
|
|
7
|
+
require("../helpers/micromark.cjs");
|
|
8
|
+
|
|
9
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
10
|
+
/** @type import("markdownlint-micromark").TokenType[] */
|
|
11
|
+
const unorderedListTypes =
|
|
12
|
+
[ "blockQuotePrefix", "listItemPrefix", "listUnordered" ];
|
|
13
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
14
|
+
/** @type import("markdownlint-micromark").TokenType[] */
|
|
15
|
+
const unorderedParentTypes =
|
|
16
|
+
[ "blockQuote", "listOrdered", "listUnordered" ];
|
|
17
|
+
|
|
18
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
19
|
+
/** @type import("./markdownlint").Rule */
|
|
20
|
+
module.exports = {
|
|
21
|
+
"names": [ "MD007", "ul-indent" ],
|
|
22
|
+
"description": "Unordered list indentation",
|
|
23
|
+
"tags": [ "bullet", "ul", "indentation" ],
|
|
24
|
+
"parser": "micromark",
|
|
25
|
+
"function": function MD007(params, onError) {
|
|
26
|
+
const indent = Number(params.config.indent || 2);
|
|
27
|
+
const startIndented = !!params.config.start_indented;
|
|
28
|
+
const startIndent = Number(params.config.start_indent || indent);
|
|
29
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
30
|
+
/** @type import("../helpers/micromark.cjs").Token[] */
|
|
31
|
+
const micromarkTokens =
|
|
32
|
+
// @ts-ignore
|
|
33
|
+
params.parsers.micromark.tokens;
|
|
34
|
+
const unorderedListNesting = new Map();
|
|
35
|
+
let lastBlockQuotePrefix = null;
|
|
36
|
+
const tokens = filterByTypes(micromarkTokens, unorderedListTypes);
|
|
37
|
+
for (const token of tokens) {
|
|
38
|
+
const { endColumn, parent, startColumn, startLine, type } = token;
|
|
39
|
+
if (type === "blockQuotePrefix") {
|
|
40
|
+
lastBlockQuotePrefix = token;
|
|
41
|
+
} else if (type === "listUnordered") {
|
|
42
|
+
let nesting = 0;
|
|
43
|
+
/** @type {import("../helpers/micromark.cjs").Token | null} */
|
|
44
|
+
let current = token;
|
|
45
|
+
while (
|
|
46
|
+
(current = getTokenParentOfType(current, unorderedParentTypes))
|
|
47
|
+
) {
|
|
48
|
+
if (current.type === "listUnordered") {
|
|
49
|
+
nesting++;
|
|
50
|
+
// eslint-disable-next-line no-continue
|
|
51
|
+
continue;
|
|
52
|
+
} else if (current.type === "listOrdered") {
|
|
53
|
+
nesting = -1;
|
|
54
|
+
}
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
if (nesting >= 0) {
|
|
58
|
+
unorderedListNesting.set(token, nesting);
|
|
59
|
+
}
|
|
60
|
+
} else if (!inHtmlFlow(token)) {
|
|
61
|
+
// listItemPrefix
|
|
62
|
+
const nesting = unorderedListNesting.get(parent);
|
|
63
|
+
if (nesting !== undefined) {
|
|
64
|
+
// listItemPrefix for listUnordered
|
|
65
|
+
const expectedIndent =
|
|
66
|
+
(startIndented ? startIndent : 0) + (nesting * indent);
|
|
67
|
+
const blockQuoteAdjustment =
|
|
68
|
+
(lastBlockQuotePrefix?.endLine === startLine) ?
|
|
69
|
+
(lastBlockQuotePrefix.endColumn - 1) :
|
|
70
|
+
0;
|
|
71
|
+
const actualIndent = startColumn - 1 - blockQuoteAdjustment;
|
|
72
|
+
const range = [ 1, endColumn - 1 ];
|
|
73
|
+
const fixInfo = {
|
|
74
|
+
"editColumn": startColumn - actualIndent,
|
|
75
|
+
"deleteCount": Math.max(actualIndent - expectedIndent, 0),
|
|
76
|
+
"insertText": "".padEnd(Math.max(expectedIndent - actualIndent, 0))
|
|
77
|
+
};
|
|
78
|
+
addErrorDetailIf(
|
|
79
|
+
onError,
|
|
80
|
+
startLine,
|
|
81
|
+
expectedIndent,
|
|
82
|
+
actualIndent,
|
|
83
|
+
undefined,
|
|
84
|
+
undefined,
|
|
85
|
+
range,
|
|
86
|
+
fixInfo
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
const { addError, filterTokens, forEachLine, includesSorted,
|
|
6
|
+
numericSortAscending } = require("../helpers");
|
|
7
|
+
const { lineMetadata } = require("./cache");
|
|
8
|
+
|
|
9
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
10
|
+
/** @type import("./markdownlint").Rule */
|
|
11
|
+
module.exports = {
|
|
12
|
+
"names": [ "MD009", "no-trailing-spaces" ],
|
|
13
|
+
"description": "Trailing spaces",
|
|
14
|
+
"tags": [ "whitespace" ],
|
|
15
|
+
"parser": "markdownit",
|
|
16
|
+
"function": function MD009(params, onError) {
|
|
17
|
+
let brSpaces = params.config.br_spaces;
|
|
18
|
+
brSpaces = Number((brSpaces === undefined) ? 2 : brSpaces);
|
|
19
|
+
const listItemEmptyLines = !!params.config.list_item_empty_lines;
|
|
20
|
+
const strict = !!params.config.strict;
|
|
21
|
+
const listItemLineNumbers = [];
|
|
22
|
+
if (listItemEmptyLines) {
|
|
23
|
+
filterTokens(params, "list_item_open", (token) => {
|
|
24
|
+
for (let i = token.map[0]; i < token.map[1]; i++) {
|
|
25
|
+
listItemLineNumbers.push(i + 1);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
listItemLineNumbers.sort(numericSortAscending);
|
|
29
|
+
}
|
|
30
|
+
const paragraphLineNumbers = [];
|
|
31
|
+
const codeInlineLineNumbers = [];
|
|
32
|
+
if (strict) {
|
|
33
|
+
filterTokens(params, "paragraph_open", (token) => {
|
|
34
|
+
for (let i = token.map[0]; i < token.map[1] - 1; i++) {
|
|
35
|
+
paragraphLineNumbers.push(i + 1);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
const addLineNumberRange = (start, end) => {
|
|
39
|
+
for (let i = start; i < end; i++) {
|
|
40
|
+
codeInlineLineNumbers.push(i);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
filterTokens(params, "inline", (token) => {
|
|
44
|
+
let start = 0;
|
|
45
|
+
for (const child of token.children) {
|
|
46
|
+
if (start > 0) {
|
|
47
|
+
addLineNumberRange(start, child.lineNumber);
|
|
48
|
+
start = 0;
|
|
49
|
+
}
|
|
50
|
+
if (child.type === "code_inline") {
|
|
51
|
+
start = child.lineNumber;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
if (start > 0) {
|
|
55
|
+
addLineNumberRange(start, token.map[1]);
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
const expected = (brSpaces < 2) ? 0 : brSpaces;
|
|
60
|
+
forEachLine(lineMetadata(), (line, lineIndex, inCode) => {
|
|
61
|
+
const lineNumber = lineIndex + 1;
|
|
62
|
+
const trailingSpaces = line.length - line.trimEnd().length;
|
|
63
|
+
if (
|
|
64
|
+
trailingSpaces &&
|
|
65
|
+
!inCode &&
|
|
66
|
+
!includesSorted(listItemLineNumbers, lineNumber) &&
|
|
67
|
+
(
|
|
68
|
+
(expected !== trailingSpaces) ||
|
|
69
|
+
(strict &&
|
|
70
|
+
(!includesSorted(paragraphLineNumbers, lineNumber) ||
|
|
71
|
+
includesSorted(codeInlineLineNumbers, lineNumber)))
|
|
72
|
+
)
|
|
73
|
+
) {
|
|
74
|
+
const column = line.length - trailingSpaces + 1;
|
|
75
|
+
addError(
|
|
76
|
+
onError,
|
|
77
|
+
lineNumber,
|
|
78
|
+
"Expected: " + (expected === 0 ? "" : "0 or ") +
|
|
79
|
+
expected + "; Actual: " + trailingSpaces,
|
|
80
|
+
undefined,
|
|
81
|
+
[ column, trailingSpaces ],
|
|
82
|
+
{
|
|
83
|
+
"editColumn": column,
|
|
84
|
+
"deleteCount": trailingSpaces
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
const { addError, filterTokens, forEachLine, withinAnyRange } =
|
|
6
|
+
require("../helpers");
|
|
7
|
+
const { codeBlockAndSpanRanges, lineMetadata } = require("./cache");
|
|
8
|
+
|
|
9
|
+
const tabRe = /\t+/g;
|
|
10
|
+
|
|
11
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
12
|
+
/** @type import("./markdownlint").Rule */
|
|
13
|
+
module.exports = {
|
|
14
|
+
"names": [ "MD010", "no-hard-tabs" ],
|
|
15
|
+
"description": "Hard tabs",
|
|
16
|
+
"tags": [ "whitespace", "hard_tab" ],
|
|
17
|
+
"parser": "markdownit",
|
|
18
|
+
"function": function MD010(params, onError) {
|
|
19
|
+
const codeBlocks = params.config.code_blocks;
|
|
20
|
+
const includeCode = (codeBlocks === undefined) ? true : !!codeBlocks;
|
|
21
|
+
const ignoreCodeLanguages = new Set(
|
|
22
|
+
(params.config.ignore_code_languages || [])
|
|
23
|
+
.map((language) => language.toLowerCase())
|
|
24
|
+
);
|
|
25
|
+
const spacesPerTab = params.config.spaces_per_tab;
|
|
26
|
+
const spaceMultiplier = (spacesPerTab === undefined) ?
|
|
27
|
+
1 :
|
|
28
|
+
Math.max(0, Number(spacesPerTab));
|
|
29
|
+
const exclusions = includeCode ? [] : codeBlockAndSpanRanges();
|
|
30
|
+
filterTokens(params, "fence", (token) => {
|
|
31
|
+
const language = token.info.trim().toLowerCase();
|
|
32
|
+
if (ignoreCodeLanguages.has(language)) {
|
|
33
|
+
for (let i = token.map[0] + 1; i < token.map[1] - 1; i++) {
|
|
34
|
+
exclusions.push([ i, 0, params.lines[i].length ]);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
forEachLine(lineMetadata(), (line, lineIndex, inCode) => {
|
|
39
|
+
if (includeCode || !inCode) {
|
|
40
|
+
let match = null;
|
|
41
|
+
while ((match = tabRe.exec(line)) !== null) {
|
|
42
|
+
const { index } = match;
|
|
43
|
+
const column = index + 1;
|
|
44
|
+
const length = match[0].length;
|
|
45
|
+
if (!withinAnyRange(exclusions, lineIndex, index, length)) {
|
|
46
|
+
addError(
|
|
47
|
+
onError,
|
|
48
|
+
lineIndex + 1,
|
|
49
|
+
"Column: " + column,
|
|
50
|
+
undefined,
|
|
51
|
+
[ column, length ],
|
|
52
|
+
{
|
|
53
|
+
"editColumn": column,
|
|
54
|
+
"deleteCount": length,
|
|
55
|
+
"insertText": "".padEnd(length * spaceMultiplier)
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
const { addError, forEachLine, withinAnyRange } = require("../helpers");
|
|
6
|
+
const { codeBlockAndSpanRanges, lineMetadata } = require("./cache");
|
|
7
|
+
|
|
8
|
+
const reversedLinkRe =
|
|
9
|
+
/(^|[^\\])\(([^()]+)\)\[([^\]^][^\]]*)\](?!\()/g;
|
|
10
|
+
|
|
11
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
12
|
+
/** @type import("./markdownlint").Rule */
|
|
13
|
+
module.exports = {
|
|
14
|
+
"names": [ "MD011", "no-reversed-links" ],
|
|
15
|
+
"description": "Reversed link syntax",
|
|
16
|
+
"tags": [ "links" ],
|
|
17
|
+
"parser": "none",
|
|
18
|
+
"function": function MD011(params, onError) {
|
|
19
|
+
const exclusions = codeBlockAndSpanRanges();
|
|
20
|
+
forEachLine(lineMetadata(), (line, lineIndex, inCode, onFence) => {
|
|
21
|
+
if (!inCode && !onFence) {
|
|
22
|
+
let match = null;
|
|
23
|
+
while ((match = reversedLinkRe.exec(line)) !== null) {
|
|
24
|
+
const [ reversedLink, preChar, linkText, linkDestination ] = match;
|
|
25
|
+
const index = match.index + preChar.length;
|
|
26
|
+
const length = match[0].length - preChar.length;
|
|
27
|
+
if (
|
|
28
|
+
!linkText.endsWith("\\") &&
|
|
29
|
+
!linkDestination.endsWith("\\") &&
|
|
30
|
+
!withinAnyRange(exclusions, lineIndex, index, length)
|
|
31
|
+
) {
|
|
32
|
+
addError(
|
|
33
|
+
onError,
|
|
34
|
+
lineIndex + 1,
|
|
35
|
+
reversedLink.slice(preChar.length),
|
|
36
|
+
undefined,
|
|
37
|
+
[ index + 1, length ],
|
|
38
|
+
{
|
|
39
|
+
"editColumn": index + 1,
|
|
40
|
+
"deleteCount": length,
|
|
41
|
+
"insertText": `[${linkText}](${linkDestination})`
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
const { addErrorDetailIf, forEachLine } = require("../helpers");
|
|
6
|
+
const { lineMetadata } = require("./cache");
|
|
7
|
+
|
|
8
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
9
|
+
/** @type import("./markdownlint").Rule */
|
|
10
|
+
module.exports = {
|
|
11
|
+
"names": [ "MD012", "no-multiple-blanks" ],
|
|
12
|
+
"description": "Multiple consecutive blank lines",
|
|
13
|
+
"tags": [ "whitespace", "blank_lines" ],
|
|
14
|
+
"parser": "none",
|
|
15
|
+
"function": function MD012(params, onError) {
|
|
16
|
+
const maximum = Number(params.config.maximum || 1);
|
|
17
|
+
let count = 0;
|
|
18
|
+
forEachLine(lineMetadata(), (line, lineIndex, inCode) => {
|
|
19
|
+
count = (inCode || (line.trim().length > 0)) ? 0 : count + 1;
|
|
20
|
+
if (maximum < count) {
|
|
21
|
+
addErrorDetailIf(
|
|
22
|
+
onError,
|
|
23
|
+
lineIndex + 1,
|
|
24
|
+
maximum,
|
|
25
|
+
count,
|
|
26
|
+
null,
|
|
27
|
+
null,
|
|
28
|
+
null,
|
|
29
|
+
{
|
|
30
|
+
"deleteCount": -1
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
const { addErrorDetailIf, filterTokens, forEachHeading, forEachLine,
|
|
6
|
+
includesSorted } = require("../helpers");
|
|
7
|
+
const { lineMetadata, referenceLinkImageData } = require("./cache");
|
|
8
|
+
|
|
9
|
+
const longLineRePrefix = "^.{";
|
|
10
|
+
const longLineRePostfixRelaxed = "}.*\\s.*$";
|
|
11
|
+
const longLineRePostfixStrict = "}.+$";
|
|
12
|
+
const linkOrImageOnlyLineRe = /^[es]*(?:lT?L|I)[ES]*$/;
|
|
13
|
+
const sternModeRe = /^(?:[#>\s]*\s)?\S*$/;
|
|
14
|
+
const tokenTypeMap = {
|
|
15
|
+
"em_open": "e",
|
|
16
|
+
"em_close": "E",
|
|
17
|
+
"image": "I",
|
|
18
|
+
"link_open": "l",
|
|
19
|
+
"link_close": "L",
|
|
20
|
+
"strong_open": "s",
|
|
21
|
+
"strong_close": "S",
|
|
22
|
+
"text": "T"
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
26
|
+
/** @type import("./markdownlint").Rule */
|
|
27
|
+
module.exports = {
|
|
28
|
+
"names": [ "MD013", "line-length" ],
|
|
29
|
+
"description": "Line length",
|
|
30
|
+
"tags": [ "line_length" ],
|
|
31
|
+
"parser": "markdownit",
|
|
32
|
+
"function": function MD013(params, onError) {
|
|
33
|
+
const lineLength = Number(params.config.line_length || 80);
|
|
34
|
+
const headingLineLength =
|
|
35
|
+
Number(params.config.heading_line_length || lineLength);
|
|
36
|
+
const codeLineLength =
|
|
37
|
+
Number(params.config.code_block_line_length || lineLength);
|
|
38
|
+
const strict = !!params.config.strict;
|
|
39
|
+
const stern = !!params.config.stern;
|
|
40
|
+
const longLineRePostfix =
|
|
41
|
+
(strict || stern) ? longLineRePostfixStrict : longLineRePostfixRelaxed;
|
|
42
|
+
const longLineRe =
|
|
43
|
+
new RegExp(longLineRePrefix + lineLength + longLineRePostfix);
|
|
44
|
+
const longHeadingLineRe =
|
|
45
|
+
new RegExp(longLineRePrefix + headingLineLength + longLineRePostfix);
|
|
46
|
+
const longCodeLineRe =
|
|
47
|
+
new RegExp(longLineRePrefix + codeLineLength + longLineRePostfix);
|
|
48
|
+
const codeBlocks = params.config.code_blocks;
|
|
49
|
+
const includeCodeBlocks = (codeBlocks === undefined) ? true : !!codeBlocks;
|
|
50
|
+
const tables = params.config.tables;
|
|
51
|
+
const includeTables = (tables === undefined) ? true : !!tables;
|
|
52
|
+
const headings = params.config.headings;
|
|
53
|
+
const includeHeadings = (headings === undefined) ? true : !!headings;
|
|
54
|
+
const headingLineNumbers = [];
|
|
55
|
+
forEachHeading(params, (heading) => {
|
|
56
|
+
headingLineNumbers.push(heading.lineNumber);
|
|
57
|
+
});
|
|
58
|
+
const linkOnlyLineNumbers = [];
|
|
59
|
+
filterTokens(params, "inline", (token) => {
|
|
60
|
+
let childTokenTypes = "";
|
|
61
|
+
for (const child of token.children) {
|
|
62
|
+
if (child.type !== "text" || child.content !== "") {
|
|
63
|
+
childTokenTypes += tokenTypeMap[child.type] || "x";
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
if (linkOrImageOnlyLineRe.test(childTokenTypes)) {
|
|
67
|
+
linkOnlyLineNumbers.push(token.lineNumber);
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
const { definitionLineIndices } = referenceLinkImageData();
|
|
71
|
+
forEachLine(lineMetadata(), (line, lineIndex, inCode, onFence, inTable) => {
|
|
72
|
+
const lineNumber = lineIndex + 1;
|
|
73
|
+
const isHeading = includesSorted(headingLineNumbers, lineNumber);
|
|
74
|
+
const length = inCode ?
|
|
75
|
+
codeLineLength :
|
|
76
|
+
(isHeading ? headingLineLength : lineLength);
|
|
77
|
+
const lengthRe = inCode ?
|
|
78
|
+
longCodeLineRe :
|
|
79
|
+
(isHeading ? longHeadingLineRe : longLineRe);
|
|
80
|
+
if ((includeCodeBlocks || !inCode) &&
|
|
81
|
+
(includeTables || !inTable) &&
|
|
82
|
+
(includeHeadings || !isHeading) &&
|
|
83
|
+
!includesSorted(definitionLineIndices, lineIndex) &&
|
|
84
|
+
(strict ||
|
|
85
|
+
(!(stern && sternModeRe.test(line)) &&
|
|
86
|
+
!includesSorted(linkOnlyLineNumbers, lineNumber))) &&
|
|
87
|
+
lengthRe.test(line)) {
|
|
88
|
+
addErrorDetailIf(
|
|
89
|
+
onError,
|
|
90
|
+
lineNumber,
|
|
91
|
+
length,
|
|
92
|
+
line.length,
|
|
93
|
+
null,
|
|
94
|
+
null,
|
|
95
|
+
[ length + 1, line.length - length ]);
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
};
|