@alexlit/lint-kit 110.1.0 → 111.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/.eslintrc.cjs +2 -8
- package/package.json +1 -1
- package/packages/config-commitlint/package.json +2 -2
- package/packages/config-eslint/README.md +22 -46
- package/packages/config-eslint/index.js +344 -213
- package/packages/config-eslint/package.json +6 -4
- package/packages/config-eslint/plugins/array-func.js +0 -1
- package/packages/config-eslint/plugins/compat.js +0 -1
- package/packages/config-eslint/plugins/decorator-position.js +0 -1
- package/packages/config-eslint/plugins/eslint-comments.js +0 -1
- package/packages/config-eslint/plugins/etc.js +0 -1
- package/packages/config-eslint/plugins/ext.js +0 -1
- package/packages/config-eslint/plugins/filenames.js +0 -1
- package/packages/config-eslint/plugins/import.js +0 -4
- package/packages/config-eslint/plugins/jsdoc.js +0 -1
- package/packages/config-eslint/plugins/jsx-a11y.js +0 -1
- package/packages/config-eslint/plugins/lit-a11y.js +0 -1
- package/packages/config-eslint/plugins/lit.js +0 -1
- package/packages/config-eslint/plugins/more.js +0 -1
- package/packages/config-eslint/plugins/no-await-in-promise.js +0 -1
- package/packages/config-eslint/plugins/no-constructor-bind.js +0 -1
- package/packages/config-eslint/plugins/no-explicit-type-exports.js +0 -1
- package/packages/config-eslint/plugins/no-loops.js +0 -1
- package/packages/config-eslint/plugins/no-secrets.js +0 -1
- package/packages/config-eslint/plugins/no-use-extend-native.js +0 -1
- package/packages/config-eslint/plugins/{optional/node.js → node.js} +0 -1
- package/packages/config-eslint/plugins/prettier.js +0 -1
- package/packages/config-eslint/plugins/promise.js +0 -1
- package/packages/config-eslint/plugins/regexp.js +0 -1
- package/packages/config-eslint/plugins/{optional/security.js → security.js} +0 -1
- package/packages/config-eslint/plugins/simple-import-sort.js +0 -1
- package/packages/config-eslint/plugins/sonar.js +0 -1
- package/packages/config-eslint/plugins/sort-class-members.js +0 -1
- package/packages/config-eslint/plugins/sort-destructure-keys.js +0 -1
- package/packages/config-eslint/plugins/sort-keys-fix.js +0 -1
- package/packages/config-eslint/plugins/spellcheck.js +2 -12
- package/packages/config-eslint/plugins/sql.js +0 -1
- package/packages/config-eslint/plugins/tanstack-query.js +0 -1
- package/packages/config-eslint/plugins/testing-library.js +0 -1
- package/packages/config-eslint/plugins/typescript-sort-keys.js +0 -1
- package/packages/config-eslint/plugins/{typescript/index.js → typescript.js} +3 -4
- package/packages/config-eslint/plugins/unicorn.js +0 -1
- package/packages/config-eslint/plugins/unused-imports.js +0 -1
- package/packages/config-eslint/plugins/vitest.js +0 -1
- package/packages/config-eslint/plugins/vue-i18n.js +0 -1
- package/packages/config-eslint/plugins/vue.js +1 -10
- package/packages/config-eslint/plugins/vuejs-accessibility.js +0 -1
- package/packages/config-eslint/plugins/wc.js +0 -1
- package/packages/config-eslint/plugins/write-good-comments.js +0 -2
- package/packages/config-eslint/utils/extend-spell-checker.js +23 -0
- 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/README.md +1 -1
- package/packages/config-stylelint/index.js +2 -2
- package/packages/config-stylelint/package.json +2 -2
- package/packages/config-eslint/plugins/no-inferred-method-name.js +0 -8
- package/packages/config-eslint/plugins/nuxt.js +0 -10
- package/packages/config-eslint/plugins/quasar.js +0 -6
- /package/packages/config-eslint/{plugins/typescript/allow-boolean-property-list.const.js → constants/allow-boolean-property-list.js} +0 -0
- /package/packages/config-eslint/{plugins/typescript/boolean-prefixes.const.js → constants/boolean-prefixes.js} +0 -0
- /package/packages/config-eslint/{plugins/typescript/english-verbs.const.js → constants/english-verbs.js} +0 -0
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
const { addErrorContext } = require("../helpers");
|
|
6
|
+
const { filterByTypes, inHtmlFlow, tokenIfType } =
|
|
7
|
+
require("../helpers/micromark.cjs");
|
|
8
|
+
|
|
9
|
+
const leftSpaceRe = /^\s(?:[^`]|$)/;
|
|
10
|
+
const rightSpaceRe = /[^`]\s$/;
|
|
11
|
+
const trimCodeText = (text, start, end) => {
|
|
12
|
+
text = text.replace(/^\s+$/, "");
|
|
13
|
+
if (start) {
|
|
14
|
+
text = text.replace(/^\s+?(\s`|\S)/, "$1");
|
|
15
|
+
}
|
|
16
|
+
if (end) {
|
|
17
|
+
text = text.replace(/(`\s|\S)\s+$/, "$1");
|
|
18
|
+
}
|
|
19
|
+
return text;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
23
|
+
/** @type import("./markdownlint").Rule */
|
|
24
|
+
module.exports = {
|
|
25
|
+
"names": [ "MD038", "no-space-in-code" ],
|
|
26
|
+
"description": "Spaces inside code span elements",
|
|
27
|
+
"tags": [ "whitespace", "code" ],
|
|
28
|
+
"parser": "micromark",
|
|
29
|
+
"function": function MD038(params, onError) {
|
|
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 codeTexts = filterByTypes(micromarkTokens, [ "codeText" ])
|
|
36
|
+
.filter((codeText) => !inHtmlFlow(codeText));
|
|
37
|
+
for (const codeText of codeTexts) {
|
|
38
|
+
const { children } = codeText;
|
|
39
|
+
const first = 0;
|
|
40
|
+
const last = children.length - 1;
|
|
41
|
+
const startSequence = tokenIfType(children[first], "codeTextSequence");
|
|
42
|
+
const endSequence = tokenIfType(children[last], "codeTextSequence");
|
|
43
|
+
const startData =
|
|
44
|
+
tokenIfType(children[first + 1], "codeTextData") ||
|
|
45
|
+
tokenIfType(children[first + 2], "codeTextData");
|
|
46
|
+
const endData =
|
|
47
|
+
tokenIfType(children[last - 1], "codeTextData") ||
|
|
48
|
+
tokenIfType(children[last - 2], "codeTextData");
|
|
49
|
+
if (startSequence && endSequence && startData && endData) {
|
|
50
|
+
const spaceLeft = leftSpaceRe.test(startData.text);
|
|
51
|
+
const spaceRight = rightSpaceRe.test(endData.text);
|
|
52
|
+
if (spaceLeft || spaceRight) {
|
|
53
|
+
let lineNumber = startSequence.startLine;
|
|
54
|
+
let range = null;
|
|
55
|
+
let fixInfo = null;
|
|
56
|
+
if (startSequence.startLine === endSequence.endLine) {
|
|
57
|
+
range = [
|
|
58
|
+
startSequence.startColumn,
|
|
59
|
+
endSequence.endColumn - startSequence.startColumn
|
|
60
|
+
];
|
|
61
|
+
fixInfo = {
|
|
62
|
+
"editColumn": startSequence.endColumn,
|
|
63
|
+
"deleteCount": endSequence.startColumn - startSequence.endColumn,
|
|
64
|
+
"insertText": trimCodeText(startData.text, true, true)
|
|
65
|
+
};
|
|
66
|
+
} else if (spaceLeft && (startSequence.endLine === startData.startLine)) {
|
|
67
|
+
range = [
|
|
68
|
+
startSequence.startColumn,
|
|
69
|
+
startData.endColumn - startSequence.startColumn
|
|
70
|
+
];
|
|
71
|
+
fixInfo = {
|
|
72
|
+
"editColumn": startSequence.endColumn,
|
|
73
|
+
"deleteCount": startData.endColumn - startData.startColumn,
|
|
74
|
+
"insertText": trimCodeText(startData.text, true, false)
|
|
75
|
+
};
|
|
76
|
+
} else if (spaceRight && (endData.text.trim().length > 0)) {
|
|
77
|
+
lineNumber = endSequence.endLine;
|
|
78
|
+
range = [
|
|
79
|
+
endData.startColumn,
|
|
80
|
+
endSequence.endColumn - endData.startColumn
|
|
81
|
+
];
|
|
82
|
+
fixInfo = {
|
|
83
|
+
"editColumn": endData.startColumn,
|
|
84
|
+
"deleteCount": endData.endColumn - endData.startColumn,
|
|
85
|
+
"insertText": trimCodeText(endData.text, false, true)
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
if (range) {
|
|
89
|
+
const context = params
|
|
90
|
+
.lines[lineNumber - 1]
|
|
91
|
+
.substring(range[0] - 1, range[0] - 1 + range[1]);
|
|
92
|
+
addErrorContext(
|
|
93
|
+
onError,
|
|
94
|
+
lineNumber,
|
|
95
|
+
context,
|
|
96
|
+
spaceLeft,
|
|
97
|
+
spaceRight,
|
|
98
|
+
range,
|
|
99
|
+
fixInfo
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
const { addErrorContext, filterTokens } = require("../helpers");
|
|
6
|
+
|
|
7
|
+
const spaceInLinkRe =
|
|
8
|
+
/\[(?:\s[^\]]*|[^\]]*?\s)\](?=(\([^)]*\)|\[[^\]]*\]))/;
|
|
9
|
+
|
|
10
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
11
|
+
/** @type import("./markdownlint").Rule */
|
|
12
|
+
module.exports = {
|
|
13
|
+
"names": [ "MD039", "no-space-in-links" ],
|
|
14
|
+
"description": "Spaces inside link text",
|
|
15
|
+
"tags": [ "whitespace", "links" ],
|
|
16
|
+
"parser": "markdownit",
|
|
17
|
+
"function": function MD039(params, onError) {
|
|
18
|
+
filterTokens(params, "inline", (token) => {
|
|
19
|
+
const { children } = token;
|
|
20
|
+
let { lineNumber } = token;
|
|
21
|
+
let inLink = false;
|
|
22
|
+
let linkText = "";
|
|
23
|
+
let lineIndex = 0;
|
|
24
|
+
for (const child of children) {
|
|
25
|
+
const { content, markup, type } = child;
|
|
26
|
+
if (type === "link_open") {
|
|
27
|
+
inLink = true;
|
|
28
|
+
linkText = "";
|
|
29
|
+
} else if (type === "link_close") {
|
|
30
|
+
inLink = false;
|
|
31
|
+
const left = linkText.trimStart().length !== linkText.length;
|
|
32
|
+
const right = linkText.trimEnd().length !== linkText.length;
|
|
33
|
+
if (left || right) {
|
|
34
|
+
const line = params.lines[lineNumber - 1];
|
|
35
|
+
let range = null;
|
|
36
|
+
let fixInfo = null;
|
|
37
|
+
const match = line.slice(lineIndex).match(spaceInLinkRe);
|
|
38
|
+
if (match) {
|
|
39
|
+
// @ts-ignore
|
|
40
|
+
const column = match.index + lineIndex + 1;
|
|
41
|
+
const length = match[0].length;
|
|
42
|
+
range = [ column, length ];
|
|
43
|
+
fixInfo = {
|
|
44
|
+
"editColumn": column + 1,
|
|
45
|
+
"deleteCount": length - 2,
|
|
46
|
+
"insertText": linkText.trim()
|
|
47
|
+
};
|
|
48
|
+
lineIndex = column + length - 1;
|
|
49
|
+
}
|
|
50
|
+
addErrorContext(
|
|
51
|
+
onError,
|
|
52
|
+
lineNumber,
|
|
53
|
+
`[${linkText}]`,
|
|
54
|
+
left,
|
|
55
|
+
right,
|
|
56
|
+
range,
|
|
57
|
+
fixInfo
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
} else if ((type === "softbreak") || (type === "hardbreak")) {
|
|
61
|
+
lineNumber++;
|
|
62
|
+
lineIndex = 0;
|
|
63
|
+
} else if (inLink) {
|
|
64
|
+
linkText += type.endsWith("_inline") ?
|
|
65
|
+
`${markup}${content}${markup}` :
|
|
66
|
+
(content || markup);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
const { addError, addErrorContext } = require("../helpers");
|
|
6
|
+
const { filterByTypes, getTokenTextByType, tokenIfType } =
|
|
7
|
+
require("../helpers/micromark.cjs");
|
|
8
|
+
|
|
9
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
10
|
+
/** @type import("./markdownlint").Rule */
|
|
11
|
+
module.exports = {
|
|
12
|
+
"names": [ "MD040", "fenced-code-language" ],
|
|
13
|
+
"description": "Fenced code blocks should have a language specified",
|
|
14
|
+
"tags": [ "code", "language" ],
|
|
15
|
+
"parser": "micromark",
|
|
16
|
+
"function": function MD040(params, onError) {
|
|
17
|
+
let allowed = params.config.allowed_languages;
|
|
18
|
+
allowed = Array.isArray(allowed) ? allowed : [];
|
|
19
|
+
const languageOnly = !!params.config.language_only;
|
|
20
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
21
|
+
/** @type import("../helpers/micromark.cjs").Token[] */
|
|
22
|
+
const micromarkTokens =
|
|
23
|
+
// @ts-ignore
|
|
24
|
+
params.parsers.micromark.tokens;
|
|
25
|
+
const fencedCodes = filterByTypes(micromarkTokens, [ "codeFenced" ]);
|
|
26
|
+
for (const fencedCode of fencedCodes) {
|
|
27
|
+
const openingFence = tokenIfType(fencedCode.children[0], "codeFencedFence");
|
|
28
|
+
if (openingFence) {
|
|
29
|
+
const { children, startLine, text } = openingFence;
|
|
30
|
+
const info = getTokenTextByType(children, "codeFencedFenceInfo");
|
|
31
|
+
if (!info) {
|
|
32
|
+
addErrorContext(onError, startLine, text);
|
|
33
|
+
} else if ((allowed.length > 0) && !allowed.includes(info)) {
|
|
34
|
+
addError(onError, startLine, `"${info}" is not allowed`);
|
|
35
|
+
}
|
|
36
|
+
if (languageOnly && getTokenTextByType(children, "codeFencedFenceMeta")) {
|
|
37
|
+
addError(onError, startLine, `Info string contains more than language: "${text}"`);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
const { addErrorContext, frontMatterHasTitle } = require("../helpers");
|
|
6
|
+
const { filterByTypes, getHeadingLevel, getHtmlTagInfo, isHtmlFlowComment, nonContentTokens } =
|
|
7
|
+
require("../helpers/micromark.cjs");
|
|
8
|
+
|
|
9
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
10
|
+
/** @type import("./markdownlint").Rule */
|
|
11
|
+
module.exports = {
|
|
12
|
+
"names": [ "MD041", "first-line-heading", "first-line-h1" ],
|
|
13
|
+
"description": "First line in a file should be a top-level heading",
|
|
14
|
+
"tags": [ "headings" ],
|
|
15
|
+
"parser": "micromark",
|
|
16
|
+
"function": function MD041(params, onError) {
|
|
17
|
+
const level = Number(params.config.level || 1);
|
|
18
|
+
if (!frontMatterHasTitle(params.frontMatterLines, params.config.front_matter_title)) {
|
|
19
|
+
params.parsers.micromark.tokens.
|
|
20
|
+
filter((token) => !nonContentTokens.has(token.type) && !isHtmlFlowComment(token)).
|
|
21
|
+
every((token) => {
|
|
22
|
+
let isError = true;
|
|
23
|
+
if ((token.type === "atxHeading") || (token.type === "setextHeading")) {
|
|
24
|
+
isError = (getHeadingLevel(token) !== level);
|
|
25
|
+
} else if (token.type === "htmlFlow") {
|
|
26
|
+
const htmlTexts = filterByTypes(token.children, [ "htmlText" ]);
|
|
27
|
+
const tagInfo = (htmlTexts.length > 0) && getHtmlTagInfo(htmlTexts[0]);
|
|
28
|
+
isError = !tagInfo || (tagInfo.name.toLowerCase() !== `h${level}`);
|
|
29
|
+
}
|
|
30
|
+
if (isError) {
|
|
31
|
+
addErrorContext(onError, token.startLine, params.lines[token.startLine - 1]);
|
|
32
|
+
}
|
|
33
|
+
return false;
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
const { addErrorContext, escapeForRegExp, filterTokens } =
|
|
6
|
+
require("../helpers");
|
|
7
|
+
|
|
8
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
9
|
+
/** @type import("./markdownlint").Rule */
|
|
10
|
+
module.exports = {
|
|
11
|
+
"names": [ "MD042", "no-empty-links" ],
|
|
12
|
+
"description": "No empty links",
|
|
13
|
+
"tags": [ "links" ],
|
|
14
|
+
"parser": "markdownit",
|
|
15
|
+
"function": function MD042(params, onError) {
|
|
16
|
+
filterTokens(params, "inline", function forToken(token) {
|
|
17
|
+
let inLink = false;
|
|
18
|
+
let linkText = "";
|
|
19
|
+
let emptyLink = false;
|
|
20
|
+
for (const child of token.children) {
|
|
21
|
+
if (child.type === "link_open") {
|
|
22
|
+
inLink = true;
|
|
23
|
+
linkText = "";
|
|
24
|
+
for (const attr of child.attrs) {
|
|
25
|
+
if (attr[0] === "href" && (!attr[1] || (attr[1] === "#"))) {
|
|
26
|
+
emptyLink = true;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
} else if (child.type === "link_close") {
|
|
30
|
+
inLink = false;
|
|
31
|
+
if (emptyLink) {
|
|
32
|
+
let context = `[${linkText}]`;
|
|
33
|
+
let range = null;
|
|
34
|
+
const match = child.line.match(
|
|
35
|
+
new RegExp(`${escapeForRegExp(context)}\\((?:|#|<>)\\)`)
|
|
36
|
+
);
|
|
37
|
+
if (match) {
|
|
38
|
+
context = match[0];
|
|
39
|
+
// @ts-ignore
|
|
40
|
+
range = [ match.index + 1, match[0].length ];
|
|
41
|
+
}
|
|
42
|
+
addErrorContext(
|
|
43
|
+
onError, child.lineNumber, context, null, null, range
|
|
44
|
+
);
|
|
45
|
+
emptyLink = false;
|
|
46
|
+
}
|
|
47
|
+
} else if (inLink) {
|
|
48
|
+
linkText += child.content;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
const { addErrorContext, addErrorDetailIf, forEachHeading } =
|
|
6
|
+
require("../helpers");
|
|
7
|
+
|
|
8
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
9
|
+
/** @type import("./markdownlint").Rule */
|
|
10
|
+
module.exports = {
|
|
11
|
+
"names": [ "MD043", "required-headings" ],
|
|
12
|
+
"description": "Required heading structure",
|
|
13
|
+
"tags": [ "headings" ],
|
|
14
|
+
"parser": "markdownit",
|
|
15
|
+
"function": function MD043(params, onError) {
|
|
16
|
+
const requiredHeadings = params.config.headings;
|
|
17
|
+
if (!Array.isArray(requiredHeadings)) {
|
|
18
|
+
// Nothing to check; avoid doing any work
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
const matchCase = params.config.match_case || false;
|
|
22
|
+
const levels = {};
|
|
23
|
+
for (const level of [ 1, 2, 3, 4, 5, 6 ]) {
|
|
24
|
+
levels["h" + level] = "######".substr(-level);
|
|
25
|
+
}
|
|
26
|
+
let i = 0;
|
|
27
|
+
let matchAny = false;
|
|
28
|
+
let hasError = false;
|
|
29
|
+
let anyHeadings = false;
|
|
30
|
+
const getExpected = () => requiredHeadings[i++] || "[None]";
|
|
31
|
+
const handleCase = (str) => (matchCase ? str : str.toLowerCase());
|
|
32
|
+
forEachHeading(params, (heading, content) => {
|
|
33
|
+
if (!hasError) {
|
|
34
|
+
anyHeadings = true;
|
|
35
|
+
const actual = levels[heading.tag] + " " + content;
|
|
36
|
+
const expected = getExpected();
|
|
37
|
+
if (expected === "*") {
|
|
38
|
+
const nextExpected = getExpected();
|
|
39
|
+
if (handleCase(nextExpected) !== handleCase(actual)) {
|
|
40
|
+
matchAny = true;
|
|
41
|
+
i--;
|
|
42
|
+
}
|
|
43
|
+
} else if (expected === "+") {
|
|
44
|
+
matchAny = true;
|
|
45
|
+
} else if (handleCase(expected) === handleCase(actual)) {
|
|
46
|
+
matchAny = false;
|
|
47
|
+
} else if (matchAny) {
|
|
48
|
+
i--;
|
|
49
|
+
} else {
|
|
50
|
+
addErrorDetailIf(onError, heading.lineNumber,
|
|
51
|
+
expected, actual);
|
|
52
|
+
hasError = true;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
const extraHeadings = requiredHeadings.length - i;
|
|
57
|
+
if (
|
|
58
|
+
!hasError &&
|
|
59
|
+
((extraHeadings > 1) ||
|
|
60
|
+
((extraHeadings === 1) && (requiredHeadings[i] !== "*"))) &&
|
|
61
|
+
(anyHeadings || !requiredHeadings.every((heading) => heading === "*"))
|
|
62
|
+
) {
|
|
63
|
+
addErrorContext(onError, params.lines.length,
|
|
64
|
+
requiredHeadings[i]);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
};
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
const { addErrorDetailIf, escapeForRegExp, withinAnyRange } =
|
|
6
|
+
require("../helpers");
|
|
7
|
+
const { filterByPredicate, filterByTypes, parse } =
|
|
8
|
+
require("../helpers/micromark.cjs");
|
|
9
|
+
|
|
10
|
+
const ignoredChildTypes = new Set(
|
|
11
|
+
[ "codeFencedFence", "definition", "reference", "resource" ]
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
15
|
+
/** @type import("./markdownlint").Rule */
|
|
16
|
+
module.exports = {
|
|
17
|
+
"names": [ "MD044", "proper-names" ],
|
|
18
|
+
"description": "Proper names should have the correct capitalization",
|
|
19
|
+
"tags": [ "spelling" ],
|
|
20
|
+
"parser": "micromark",
|
|
21
|
+
"function": function MD044(params, onError) {
|
|
22
|
+
let names = params.config.names;
|
|
23
|
+
names = Array.isArray(names) ? names : [];
|
|
24
|
+
names.sort((a, b) => (b.length - a.length) || a.localeCompare(b));
|
|
25
|
+
if (names.length === 0) {
|
|
26
|
+
// Nothing to check; avoid doing any work
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const codeBlocks = params.config.code_blocks;
|
|
30
|
+
const includeCodeBlocks =
|
|
31
|
+
(codeBlocks === undefined) ? true : !!codeBlocks;
|
|
32
|
+
const htmlElements = params.config.html_elements;
|
|
33
|
+
const includeHtmlElements =
|
|
34
|
+
(htmlElements === undefined) ? true : !!htmlElements;
|
|
35
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
36
|
+
/** @type import("../helpers/micromark.cjs").Token[] */
|
|
37
|
+
const micromarkTokens =
|
|
38
|
+
// @ts-ignore
|
|
39
|
+
params.parsers.micromark.tokens;
|
|
40
|
+
const scannedTypes = new Set([ "data" ]);
|
|
41
|
+
if (includeCodeBlocks) {
|
|
42
|
+
scannedTypes.add("codeFlowValue");
|
|
43
|
+
scannedTypes.add("codeTextData");
|
|
44
|
+
}
|
|
45
|
+
if (includeHtmlElements) {
|
|
46
|
+
scannedTypes.add("htmlFlowData");
|
|
47
|
+
scannedTypes.add("htmlTextData");
|
|
48
|
+
}
|
|
49
|
+
const contentTokens =
|
|
50
|
+
filterByPredicate(
|
|
51
|
+
micromarkTokens,
|
|
52
|
+
(token) => scannedTypes.has(token.type),
|
|
53
|
+
(token) => (
|
|
54
|
+
token.children.filter((t) => !ignoredChildTypes.has(t.type))
|
|
55
|
+
)
|
|
56
|
+
);
|
|
57
|
+
const exclusions = [];
|
|
58
|
+
const autoLinked = new Set();
|
|
59
|
+
for (const name of names) {
|
|
60
|
+
const escapedName = escapeForRegExp(name);
|
|
61
|
+
const startNamePattern = /^\W/.test(name) ? "" : "\\b_*";
|
|
62
|
+
const endNamePattern = /\W$/.test(name) ? "" : "_*\\b";
|
|
63
|
+
const namePattern =
|
|
64
|
+
`(${startNamePattern})(${escapedName})${endNamePattern}`;
|
|
65
|
+
const nameRe = new RegExp(namePattern, "gi");
|
|
66
|
+
for (const token of contentTokens) {
|
|
67
|
+
let match = null;
|
|
68
|
+
while ((match = nameRe.exec(token.text)) !== null) {
|
|
69
|
+
const [ , leftMatch, nameMatch ] = match;
|
|
70
|
+
const index = token.startColumn - 1 + match.index + leftMatch.length;
|
|
71
|
+
const length = nameMatch.length;
|
|
72
|
+
const lineIndex = token.startLine - 1;
|
|
73
|
+
if (
|
|
74
|
+
!withinAnyRange(exclusions, lineIndex, index, length) &&
|
|
75
|
+
!names.includes(nameMatch)
|
|
76
|
+
) {
|
|
77
|
+
let urlRanges = [];
|
|
78
|
+
if (!autoLinked.has(token)) {
|
|
79
|
+
urlRanges = filterByTypes(
|
|
80
|
+
parse(token.text),
|
|
81
|
+
[ "literalAutolink" ]
|
|
82
|
+
).map(
|
|
83
|
+
(t) => [
|
|
84
|
+
lineIndex,
|
|
85
|
+
token.startColumn - 1 + t.startColumn - 1,
|
|
86
|
+
t.endColumn - t.startColumn
|
|
87
|
+
]
|
|
88
|
+
);
|
|
89
|
+
exclusions.push(...urlRanges);
|
|
90
|
+
autoLinked.add(token);
|
|
91
|
+
}
|
|
92
|
+
if (!withinAnyRange(urlRanges, lineIndex, index, length)) {
|
|
93
|
+
const column = index + 1;
|
|
94
|
+
addErrorDetailIf(
|
|
95
|
+
onError,
|
|
96
|
+
token.startLine,
|
|
97
|
+
name,
|
|
98
|
+
nameMatch,
|
|
99
|
+
null,
|
|
100
|
+
null,
|
|
101
|
+
[ column, length ],
|
|
102
|
+
{
|
|
103
|
+
"editColumn": column,
|
|
104
|
+
"deleteCount": length,
|
|
105
|
+
"insertText": name
|
|
106
|
+
}
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
exclusions.push([ lineIndex, index, length ]);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
const { addError, getHtmlAttributeRe, nextLinesRe } = require("../helpers");
|
|
6
|
+
const { filterByTypes, getHtmlTagInfo } = require("../helpers/micromark.cjs");
|
|
7
|
+
|
|
8
|
+
const altRe = getHtmlAttributeRe("alt");
|
|
9
|
+
|
|
10
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
11
|
+
/** @type import("./markdownlint").Rule */
|
|
12
|
+
module.exports = {
|
|
13
|
+
"names": [ "MD045", "no-alt-text" ],
|
|
14
|
+
"description": "Images should have alternate text (alt text)",
|
|
15
|
+
"tags": [ "accessibility", "images" ],
|
|
16
|
+
"parser": "micromark",
|
|
17
|
+
"function": function MD045(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
|
+
|
|
24
|
+
// Process Markdown images
|
|
25
|
+
const images = filterByTypes(micromarkTokens, [ "image" ]);
|
|
26
|
+
for (const image of images) {
|
|
27
|
+
const labelTexts = filterByTypes(image.children, [ "labelText" ]);
|
|
28
|
+
if (labelTexts.some((labelText) => labelText.text.length === 0)) {
|
|
29
|
+
const range = (image.startLine === image.endLine) ?
|
|
30
|
+
[ image.startColumn, image.endColumn - image.startColumn ] :
|
|
31
|
+
undefined;
|
|
32
|
+
addError(
|
|
33
|
+
onError,
|
|
34
|
+
image.startLine,
|
|
35
|
+
undefined,
|
|
36
|
+
undefined,
|
|
37
|
+
range
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Process HTML images
|
|
43
|
+
const htmlTexts = filterByTypes(micromarkTokens, [ "htmlText" ]);
|
|
44
|
+
for (const htmlText of htmlTexts) {
|
|
45
|
+
const { startColumn, startLine, text } = htmlText;
|
|
46
|
+
const htmlTagInfo = getHtmlTagInfo(htmlText);
|
|
47
|
+
if (
|
|
48
|
+
htmlTagInfo &&
|
|
49
|
+
!htmlTagInfo.close &&
|
|
50
|
+
(htmlTagInfo.name.toLowerCase() === "img") &&
|
|
51
|
+
!altRe.test(text)
|
|
52
|
+
) {
|
|
53
|
+
const range = [
|
|
54
|
+
startColumn,
|
|
55
|
+
text.replace(nextLinesRe, "").length
|
|
56
|
+
];
|
|
57
|
+
addError(
|
|
58
|
+
onError,
|
|
59
|
+
startLine,
|
|
60
|
+
undefined,
|
|
61
|
+
undefined,
|
|
62
|
+
range
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
const { addErrorDetailIf } = require("../helpers");
|
|
6
|
+
const { filterByTypes } = require("../helpers/micromark.cjs");
|
|
7
|
+
|
|
8
|
+
const tokenTypeToStyle = {
|
|
9
|
+
"codeFenced": "fenced",
|
|
10
|
+
"codeIndented": "indented"
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
14
|
+
/** @type import("./markdownlint").Rule */
|
|
15
|
+
module.exports = {
|
|
16
|
+
"names": [ "MD046", "code-block-style" ],
|
|
17
|
+
"description": "Code block style",
|
|
18
|
+
"tags": [ "code" ],
|
|
19
|
+
"parser": "micromark",
|
|
20
|
+
"function": function MD046(params, onError) {
|
|
21
|
+
let expectedStyle = String(params.config.style || "consistent");
|
|
22
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
23
|
+
/** @type import("../helpers/micromark.cjs").Token[] */
|
|
24
|
+
const micromarkTokens =
|
|
25
|
+
// @ts-ignore
|
|
26
|
+
params.parsers.micromark.tokens;
|
|
27
|
+
const codeBlocksAndFences = filterByTypes(micromarkTokens, [ "codeFenced", "codeIndented" ]);
|
|
28
|
+
for (const token of codeBlocksAndFences) {
|
|
29
|
+
const { startLine, type } = token;
|
|
30
|
+
if (expectedStyle === "consistent") {
|
|
31
|
+
expectedStyle = tokenTypeToStyle[type];
|
|
32
|
+
}
|
|
33
|
+
addErrorDetailIf(
|
|
34
|
+
onError,
|
|
35
|
+
startLine,
|
|
36
|
+
expectedStyle,
|
|
37
|
+
tokenTypeToStyle[type]);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
const { addError, isBlankLine } = require("../helpers");
|
|
6
|
+
|
|
7
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
8
|
+
/** @type import("./markdownlint").Rule */
|
|
9
|
+
module.exports = {
|
|
10
|
+
"names": [ "MD047", "single-trailing-newline" ],
|
|
11
|
+
"description": "Files should end with a single newline character",
|
|
12
|
+
"tags": [ "blank_lines" ],
|
|
13
|
+
"parser": "none",
|
|
14
|
+
"function": function MD047(params, onError) {
|
|
15
|
+
const lastLineNumber = params.lines.length;
|
|
16
|
+
const lastLine = params.lines[lastLineNumber - 1];
|
|
17
|
+
if (!isBlankLine(lastLine)) {
|
|
18
|
+
addError(
|
|
19
|
+
onError,
|
|
20
|
+
lastLineNumber,
|
|
21
|
+
undefined,
|
|
22
|
+
undefined,
|
|
23
|
+
[ lastLine.length, 1 ],
|
|
24
|
+
{
|
|
25
|
+
"insertText": "\n",
|
|
26
|
+
"editColumn": lastLine.length + 1
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
const { addErrorDetailIf, fencedCodeBlockStyleFor } = require("../helpers");
|
|
6
|
+
const { filterByTypes, tokenIfType } = require("../helpers/micromark.cjs");
|
|
7
|
+
|
|
8
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
9
|
+
/** @type import("./markdownlint").Rule */
|
|
10
|
+
module.exports = {
|
|
11
|
+
"names": [ "MD048", "code-fence-style" ],
|
|
12
|
+
"description": "Code fence style",
|
|
13
|
+
"tags": [ "code" ],
|
|
14
|
+
"parser": "micromark",
|
|
15
|
+
"function": function MD048(params, onError) {
|
|
16
|
+
const style = String(params.config.style || "consistent");
|
|
17
|
+
// eslint-disable-next-line jsdoc/valid-types
|
|
18
|
+
/** @type import("../helpers/micromark.cjs").Token[] */
|
|
19
|
+
const micromarkTokens =
|
|
20
|
+
// @ts-ignore
|
|
21
|
+
params.parsers.micromark.tokens;
|
|
22
|
+
let expectedStyle = style;
|
|
23
|
+
const codeFenceds = filterByTypes(micromarkTokens, [ "codeFenced" ]);
|
|
24
|
+
for (const codeFenced of codeFenceds) {
|
|
25
|
+
const codeFencedFence = tokenIfType(codeFenced.children[0], "codeFencedFence");
|
|
26
|
+
if (codeFencedFence) {
|
|
27
|
+
const codeFencedFenceSequence = tokenIfType(codeFencedFence.children[0], "codeFencedFenceSequence");
|
|
28
|
+
if (codeFencedFenceSequence) {
|
|
29
|
+
const { startLine, text } = codeFencedFenceSequence;
|
|
30
|
+
if (expectedStyle === "consistent") {
|
|
31
|
+
expectedStyle = fencedCodeBlockStyleFor(text);
|
|
32
|
+
}
|
|
33
|
+
addErrorDetailIf(
|
|
34
|
+
onError,
|
|
35
|
+
startLine,
|
|
36
|
+
expectedStyle,
|
|
37
|
+
fencedCodeBlockStyleFor(text)
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
};
|