@alexlit/lint-kit 127.6.0 → 127.6.2
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/.npmpackagejsonlintrc.json +0 -0
- package/.npmrc +5 -0
- package/LICENSE +0 -0
- package/README.md +1 -1
- package/commitlint.config.js +0 -0
- package/lint-staged.config.js +0 -0
- package/package.json +11 -9
- package/packages/config-commitlint/LICENSE +0 -0
- package/packages/config-commitlint/index.js +0 -0
- package/packages/config-commitlint/node_modules/.bin/commitlint +17 -0
- package/packages/config-commitlint/node_modules/.bin/conventional-changelog +17 -0
- package/packages/config-commitlint/node_modules/.bin/conventional-commits-parser +17 -0
- package/packages/config-commitlint/node_modules/.bin/tsc +17 -0
- package/packages/config-commitlint/node_modules/.bin/tsserver +17 -0
- package/packages/config-commitlint/package.json +0 -0
- package/packages/config-eslint/LICENSE +0 -0
- package/packages/config-eslint/_legacy/LICENSE +0 -0
- package/packages/config-eslint/_legacy/dictionaries/index.js +0 -0
- package/packages/config-eslint/_legacy/dictionaries/programming/bash.js +0 -0
- package/packages/config-eslint/_legacy/dictionaries/programming/django.js +0 -0
- package/packages/config-eslint/_legacy/dictionaries/programming/elixir.js +0 -0
- package/packages/config-eslint/_legacy/dictionaries/programming/go.js +0 -0
- package/packages/config-eslint/_legacy/dictionaries/programming/java.js +0 -0
- package/packages/config-eslint/_legacy/dictionaries/programming/latex.js +0 -0
- package/packages/config-eslint/_legacy/dictionaries/programming/lua.js +0 -0
- package/packages/config-eslint/_legacy/dictionaries/programming/php.js +0 -0
- package/packages/config-eslint/_legacy/dictionaries/programming/python.js +0 -0
- package/packages/config-eslint/_legacy/dictionaries/programming/ruby.js +0 -0
- package/packages/config-eslint/_legacy/dictionaries/programming/rust.js +0 -0
- package/packages/config-eslint/_legacy/dictionaries/programming/scala.js +0 -0
- package/packages/config-eslint/_legacy/dictionaries/specialized/html-symbol-entities.js +0 -0
- package/packages/config-eslint/_legacy/dictionaries/specialized/lorem-ipsum.js +0 -0
- package/packages/config-eslint/_legacy/index.js +0 -0
- package/packages/config-eslint/_legacy/legacy.js +0 -0
- package/packages/config-eslint/_legacy/package.json +0 -0
- package/packages/config-eslint/_legacy/plugins/array-func.js +0 -0
- package/packages/config-eslint/_legacy/plugins/compat.js +0 -0
- package/packages/config-eslint/_legacy/plugins/decorator-position.js +0 -0
- package/packages/config-eslint/_legacy/plugins/eslint-comments.js +0 -0
- package/packages/config-eslint/_legacy/plugins/etc.js +0 -0
- package/packages/config-eslint/_legacy/plugins/ext.js +0 -0
- package/packages/config-eslint/_legacy/plugins/filenames.js +0 -0
- package/packages/config-eslint/_legacy/plugins/import.js +0 -0
- package/packages/config-eslint/_legacy/plugins/jsdoc.js +0 -0
- package/packages/config-eslint/_legacy/plugins/jsx-a11y.js +0 -0
- package/packages/config-eslint/_legacy/plugins/lit-a11y.js +0 -0
- package/packages/config-eslint/_legacy/plugins/lit.js +0 -0
- package/packages/config-eslint/_legacy/plugins/more.js +0 -0
- package/packages/config-eslint/_legacy/plugins/no-constructor-bind.js +0 -0
- package/packages/config-eslint/_legacy/plugins/no-explicit-type-exports.js +0 -0
- package/packages/config-eslint/_legacy/plugins/no-loops.js +0 -0
- package/packages/config-eslint/_legacy/plugins/no-secrets.js +0 -0
- package/packages/config-eslint/_legacy/plugins/no-use-extend-native.js +0 -0
- package/packages/config-eslint/_legacy/plugins/node.js +0 -0
- package/packages/config-eslint/_legacy/plugins/prettier.js +0 -0
- package/packages/config-eslint/_legacy/plugins/promise.js +0 -0
- package/packages/config-eslint/_legacy/plugins/regexp.js +0 -0
- package/packages/config-eslint/_legacy/plugins/security.js +0 -0
- package/packages/config-eslint/_legacy/plugins/simple-import-sort.js +0 -0
- package/packages/config-eslint/_legacy/plugins/sonar.js +0 -0
- package/packages/config-eslint/_legacy/plugins/sort-class-members.js +0 -0
- package/packages/config-eslint/_legacy/plugins/sort-destructure-keys.js +0 -0
- package/packages/config-eslint/_legacy/plugins/sort-keys-fix.js +0 -0
- package/packages/config-eslint/_legacy/plugins/spellcheck.js +0 -0
- package/packages/config-eslint/_legacy/plugins/sql.js +0 -0
- package/packages/config-eslint/_legacy/plugins/tanstack-query.js +0 -0
- package/packages/config-eslint/_legacy/plugins/testing-library.js +0 -0
- package/packages/config-eslint/_legacy/plugins/typescript-sort-keys.js +0 -0
- package/packages/config-eslint/_legacy/plugins/unicorn.js +0 -0
- package/packages/config-eslint/_legacy/plugins/unused-imports.js +0 -0
- package/packages/config-eslint/_legacy/plugins/vitest.js +0 -0
- package/packages/config-eslint/_legacy/plugins/vue-i18n.js +0 -0
- package/packages/config-eslint/_legacy/plugins/vue.js +0 -0
- package/packages/config-eslint/_legacy/plugins/vuejs-accessibility.js +0 -0
- package/packages/config-eslint/_legacy/plugins/wc.js +0 -0
- package/packages/config-eslint/_legacy/plugins/write-good-comments.js +0 -0
- package/packages/config-eslint/_legacy/utils/create-config.js +0 -0
- package/packages/config-eslint/index.js +0 -0
- package/packages/config-eslint/node_modules/.bin/acorn +17 -0
- package/packages/config-eslint/node_modules/.bin/browserslist +17 -0
- package/packages/config-eslint/node_modules/.bin/eslint +17 -0
- package/packages/config-eslint/node_modules/.bin/eslint-config-prettier +17 -0
- package/packages/config-eslint/node_modules/.bin/jiti +17 -0
- package/packages/config-eslint/node_modules/.bin/prettier +17 -0
- package/packages/config-eslint/node_modules/.bin/tsc +17 -0
- package/packages/config-eslint/node_modules/.bin/tsserver +17 -0
- package/packages/config-eslint/package.json +1 -1
- package/packages/config-hooks/LICENSE +0 -0
- package/packages/config-hooks/lint-staged.js +0 -0
- package/packages/config-hooks/node_modules/.bin/husky +17 -0
- package/packages/config-hooks/node_modules/.bin/lint-staged +17 -0
- package/packages/config-hooks/package.json +0 -0
- package/packages/config-htmllint/LICENSE +0 -0
- package/packages/config-htmllint/index.js +0 -0
- package/packages/config-htmllint/node_modules/.bin/linthtml +17 -0
- package/packages/config-htmllint/node_modules/.bin/tsc +17 -0
- package/packages/config-htmllint/node_modules/.bin/tsserver +17 -0
- package/packages/config-htmllint/package.json +0 -0
- package/packages/config-markdownlint/LICENSE +0 -0
- package/packages/config-markdownlint/index.json +0 -0
- package/packages/config-markdownlint/node_modules/.bin/markdownlint +17 -0
- package/packages/config-markdownlint/package.json +0 -0
- package/packages/config-npmlint/LICENSE +0 -0
- package/packages/config-npmlint/index.json +0 -0
- package/packages/config-npmlint/node_modules/.bin/lockfile-lint +17 -0
- package/packages/config-npmlint/node_modules/.bin/npmPkgJsonLint +17 -0
- package/packages/config-npmlint/node_modules/.bin/tsc +17 -0
- package/packages/config-npmlint/node_modules/.bin/tsserver +17 -0
- package/packages/config-npmlint/package.json +0 -0
- package/packages/config-prettier/LICENSE +0 -0
- package/packages/config-prettier/index.js +0 -0
- package/packages/config-prettier/node_modules/.bin/prettier +17 -0
- package/packages/config-prettier/package.json +0 -0
- package/packages/config-prettier/plugins/jsdoc.js +0 -0
- package/packages/config-prettier/plugins/packagejson.js +0 -0
- package/packages/config-prettier/plugins/php.js +0 -0
- package/packages/config-prettier/plugins/pug.js +0 -0
- package/packages/config-prettier/plugins/ruby.js +0 -0
- package/packages/config-prettier/plugins/sh.js +0 -0
- package/packages/config-prettier/plugins/solidity.js +0 -0
- package/packages/config-prettier/plugins/sort-json.js +0 -0
- package/packages/config-prettier/plugins/sql.js +0 -0
- package/packages/config-prettier/plugins/svelte.js +0 -0
- package/packages/config-prettier/plugins/tailwindcss.js +0 -0
- package/packages/config-prettier/plugins/xml.js +0 -0
- package/packages/config-stylelint/LICENSE +0 -0
- package/packages/config-stylelint/index.js +1 -0
- package/packages/config-stylelint/node_modules/.bin/browserslist +17 -0
- package/packages/config-stylelint/node_modules/.bin/prettier +17 -0
- package/packages/config-stylelint/node_modules/.bin/stylelint +17 -0
- package/packages/config-stylelint/node_modules/.bin/tsc +17 -0
- package/packages/config-stylelint/node_modules/.bin/tsserver +17 -0
- package/packages/config-stylelint/package.json +2 -2
- package/packages/config-stylelint/plugins/a11y.js +0 -0
- package/packages/config-stylelint/plugins/at-rule-no-children.js +0 -0
- package/packages/config-stylelint/plugins/color-format.js +0 -0
- package/packages/config-stylelint/plugins/declaration-block-no-ignored-properties.js +0 -0
- package/packages/config-stylelint/plugins/gamut.js +0 -0
- package/packages/config-stylelint/plugins/high-performance-animation.js +0 -0
- package/packages/config-stylelint/plugins/logical-css.js +0 -0
- package/packages/config-stylelint/plugins/no-indistinguishable-colors.js +0 -0
- package/packages/config-stylelint/plugins/no-nested-media.js +0 -0
- package/packages/config-stylelint/plugins/no-unresolved-module.js +0 -0
- package/packages/config-stylelint/plugins/no-unsupported-browser-features.js +0 -0
- package/packages/config-stylelint/plugins/order.js +0 -0
- package/packages/config-stylelint/plugins/prettier.js +0 -0
- package/packages/config-stylelint/plugins/scss.js +0 -0
- package/packages/config-stylelint/plugins/selector-no-empty.js +0 -0
- package/packages/config-stylelint/plugins/use-nesting.js +0 -0
- package/prettier.config.js +0 -0
- package/scripts/check.editorconfig.sh +0 -0
- package/scripts/i.sh +1 -1
- package/scripts/lint.eslint.sh +0 -0
- package/scripts/lint.htmllint.sh +0 -0
- package/scripts/lint.markdownlint.sh +0 -0
- package/scripts/lint.npmlint.sh +1 -1
- package/scripts/lint.sh +5 -5
- package/scripts/lint.stylelint.sh +0 -0
- package/scripts/ou.sh +8 -0
- package/scripts/preinstall.sh +1 -0
- package/scripts/release.sh +3 -3
- package/scripts/semver.sh +0 -0
- package/scripts/up.sh +12 -27
- package/stylelint.config.js +0 -0
- package/packages/config-markdownlint/node_modules/markdownlint/CHANGELOG.md +0 -457
- package/packages/config-markdownlint/node_modules/markdownlint/CONTRIBUTING.md +0 -93
- package/packages/config-markdownlint/node_modules/markdownlint/LICENSE +0 -21
- package/packages/config-markdownlint/node_modules/markdownlint/README.md +0 -1047
- package/packages/config-markdownlint/node_modules/markdownlint/demo/markdownlint-browser.js +0 -7094
- package/packages/config-markdownlint/node_modules/markdownlint/doc/CustomRules.md +0 -388
- package/packages/config-markdownlint/node_modules/markdownlint/doc/Prettier.md +0 -27
- package/packages/config-markdownlint/node_modules/markdownlint/doc/ReleaseProcess.md +0 -20
- package/packages/config-markdownlint/node_modules/markdownlint/doc/Rules.md +0 -2528
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md001.md +0 -37
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md003.md +0 -59
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md004.md +0 -49
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md005.md +0 -53
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md007.md +0 -52
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md009.md +0 -51
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md010.md +0 -56
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md011.md +0 -30
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md012.md +0 -38
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md013.md +0 -58
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md014.md +0 -54
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md018.md +0 -27
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md019.md +0 -28
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md020.md +0 -29
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md021.md +0 -31
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md022.md +0 -52
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md023.md +0 -33
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md024.md +0 -44
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md025.md +0 -49
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md026.md +0 -40
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md027.md +0 -24
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md028.md +0 -40
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md029.md +0 -98
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md030.md +0 -82
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md031.md +0 -50
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md032.md +0 -55
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md033.md +0 -27
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md034.md +0 -55
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md035.md +0 -42
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md036.md +0 -45
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md037.md +0 -37
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md038.md +0 -40
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md039.md +0 -21
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md040.md +0 -52
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md041.md +0 -49
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md042.md +0 -32
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md043.md +0 -69
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md044.md +0 -45
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md045.md +0 -40
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md046.md +0 -40
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md047.md +0 -34
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md048.md +0 -41
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md049.md +0 -35
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md050.md +0 -35
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md051.md +0 -87
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md052.md +0 -40
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md053.md +0 -38
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md054.md +0 -100
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md055.md +0 -54
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md056.md +0 -37
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md058.md +0 -48
- package/packages/config-markdownlint/node_modules/markdownlint/helpers/LICENSE +0 -21
- package/packages/config-markdownlint/node_modules/markdownlint/helpers/README.md +0 -46
- package/packages/config-markdownlint/node_modules/markdownlint/helpers/helpers.js +0 -793
- package/packages/config-markdownlint/node_modules/markdownlint/helpers/micromark.cjs +0 -544
- package/packages/config-markdownlint/node_modules/markdownlint/helpers/package.json +0 -26
- package/packages/config-markdownlint/node_modules/markdownlint/helpers/shared.js +0 -10
- package/packages/config-markdownlint/node_modules/markdownlint/lib/cache.js +0 -70
- package/packages/config-markdownlint/node_modules/markdownlint/lib/configuration-strict.d.ts +0 -1185
- package/packages/config-markdownlint/node_modules/markdownlint/lib/configuration.d.ts +0 -8
- package/packages/config-markdownlint/node_modules/markdownlint/lib/constants.js +0 -15
- package/packages/config-markdownlint/node_modules/markdownlint/lib/markdownlint.d.ts +0 -488
- package/packages/config-markdownlint/node_modules/markdownlint/lib/markdownlint.js +0 -1572
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md001.js +0 -31
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md003.js +0 -50
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md004.js +0 -86
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md005.js +0 -72
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md007.js +0 -88
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md009.js +0 -95
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md010.js +0 -78
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md011.js +0 -57
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md012.js +0 -43
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md013.js +0 -105
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md014.js +0 -54
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md018.js +0 -46
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md019-md021.js +0 -80
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md020.js +0 -71
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md022.js +0 -106
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md023.js +0 -40
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md024.js +0 -48
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md025.js +0 -40
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md026.js +0 -49
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md027.js +0 -37
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md028.js +0 -42
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md029.js +0 -76
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md030.js +0 -60
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md031.js +0 -63
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md032.js +0 -66
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md033.js +0 -41
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md034.js +0 -100
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md035.js +0 -26
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md036.js +0 -51
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md037.js +0 -94
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md038.js +0 -100
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md039.js +0 -83
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md040.js +0 -37
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md041.js +0 -37
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md042.js +0 -63
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md043.js +0 -73
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md044.js +0 -110
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md045.js +0 -62
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md046.js +0 -34
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md047.js +0 -31
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md048.js +0 -39
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md049-md050.js +0 -103
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md051.js +0 -170
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md052.js +0 -42
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md053.js +0 -62
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md054.js +0 -125
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md055.js +0 -79
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md056.js +0 -56
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md058.js +0 -43
- package/packages/config-markdownlint/node_modules/markdownlint/lib/rules.js +0 -74
- package/packages/config-markdownlint/node_modules/markdownlint/package.json +0 -105
- package/packages/config-markdownlint/node_modules/markdownlint/schema/.markdownlint.jsonc +0 -307
- package/packages/config-markdownlint/node_modules/markdownlint/schema/.markdownlint.yaml +0 -275
- package/packages/config-markdownlint/node_modules/markdownlint/schema/ValidatingConfiguration.md +0 -26
- package/packages/config-markdownlint/node_modules/markdownlint/schema/markdownlint-config-schema-strict.json +0 -1819
- package/packages/config-markdownlint/node_modules/markdownlint/schema/markdownlint-config-schema.json +0 -1824
- package/packages/config-markdownlint/node_modules/markdownlint/style/all.json +0 -5
- package/packages/config-markdownlint/node_modules/markdownlint/style/cirosantilli.json +0 -22
- package/packages/config-markdownlint/node_modules/markdownlint/style/prettier.json +0 -27
- package/packages/config-markdownlint/node_modules/markdownlint/style/relaxed.json +0 -12
- package/packages/config-markdownlint/node_modules/markdownlint-micromark/LICENSE +0 -21
- package/packages/config-markdownlint/node_modules/markdownlint-micromark/README.md +0 -10
- package/packages/config-markdownlint/node_modules/markdownlint-micromark/micromark-browser.js +0 -2
- package/packages/config-markdownlint/node_modules/markdownlint-micromark/micromark-html-browser.js +0 -2
- package/packages/config-markdownlint/node_modules/markdownlint-micromark/micromark.cjs +0 -1
- package/packages/config-markdownlint/node_modules/markdownlint-micromark/micromark.d.cts +0 -1751
- package/packages/config-markdownlint/node_modules/markdownlint-micromark/package.json +0 -46
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
|
|
3
|
-
"use strict";
|
|
4
|
-
|
|
5
|
-
const { addErrorDetailIf } = require("../helpers");
|
|
6
|
-
const { getReferenceLinkImageData } = require("./cache");
|
|
7
|
-
const { addRangeToSet, getDescendantsByType } = require("../helpers/micromark.cjs");
|
|
8
|
-
const { filterByTypesCached } = require("./cache");
|
|
9
|
-
|
|
10
|
-
const longLineRePrefix = "^.{";
|
|
11
|
-
const longLineRePostfixRelaxed = "}.*\\s.*$";
|
|
12
|
-
const longLineRePostfixStrict = "}.+$";
|
|
13
|
-
const sternModeRe = /^(?:[#>\s]*\s)?\S*$/;
|
|
14
|
-
|
|
15
|
-
// eslint-disable-next-line jsdoc/valid-types
|
|
16
|
-
/** @type import("./markdownlint").Rule */
|
|
17
|
-
module.exports = {
|
|
18
|
-
"names": [ "MD013", "line-length" ],
|
|
19
|
-
"description": "Line length",
|
|
20
|
-
"tags": [ "line_length" ],
|
|
21
|
-
"parser": "micromark",
|
|
22
|
-
"function": function MD013(params, onError) {
|
|
23
|
-
const lineLength = Number(params.config.line_length || 80);
|
|
24
|
-
const headingLineLength =
|
|
25
|
-
Number(params.config.heading_line_length || lineLength);
|
|
26
|
-
const codeLineLength =
|
|
27
|
-
Number(params.config.code_block_line_length || lineLength);
|
|
28
|
-
const strict = !!params.config.strict;
|
|
29
|
-
const stern = !!params.config.stern;
|
|
30
|
-
const longLineRePostfix =
|
|
31
|
-
(strict || stern) ? longLineRePostfixStrict : longLineRePostfixRelaxed;
|
|
32
|
-
const longLineRe =
|
|
33
|
-
new RegExp(longLineRePrefix + lineLength + longLineRePostfix);
|
|
34
|
-
const longHeadingLineRe =
|
|
35
|
-
new RegExp(longLineRePrefix + headingLineLength + longLineRePostfix);
|
|
36
|
-
const longCodeLineRe =
|
|
37
|
-
new RegExp(longLineRePrefix + codeLineLength + longLineRePostfix);
|
|
38
|
-
const codeBlocks = params.config.code_blocks;
|
|
39
|
-
const includeCodeBlocks = (codeBlocks === undefined) ? true : !!codeBlocks;
|
|
40
|
-
const tables = params.config.tables;
|
|
41
|
-
const includeTables = (tables === undefined) ? true : !!tables;
|
|
42
|
-
const headings = params.config.headings;
|
|
43
|
-
const includeHeadings = (headings === undefined) ? true : !!headings;
|
|
44
|
-
const headingLineNumbers = new Set();
|
|
45
|
-
for (const heading of filterByTypesCached([ "atxHeading", "setextHeading" ])) {
|
|
46
|
-
addRangeToSet(headingLineNumbers, heading.startLine, heading.endLine);
|
|
47
|
-
}
|
|
48
|
-
const codeBlockLineNumbers = new Set();
|
|
49
|
-
for (const codeBlock of filterByTypesCached([ "codeFenced", "codeIndented" ])) {
|
|
50
|
-
addRangeToSet(codeBlockLineNumbers, codeBlock.startLine, codeBlock.endLine);
|
|
51
|
-
}
|
|
52
|
-
const tableLineNumbers = new Set();
|
|
53
|
-
for (const table of filterByTypesCached([ "table" ])) {
|
|
54
|
-
addRangeToSet(tableLineNumbers, table.startLine, table.endLine);
|
|
55
|
-
}
|
|
56
|
-
const linkLineNumbers = new Set();
|
|
57
|
-
for (const link of filterByTypesCached([ "autolink", "image", "link", "literalAutolink" ])) {
|
|
58
|
-
addRangeToSet(linkLineNumbers, link.startLine, link.endLine);
|
|
59
|
-
}
|
|
60
|
-
const paragraphDataLineNumbers = new Set();
|
|
61
|
-
for (const paragraph of filterByTypesCached([ "paragraph" ])) {
|
|
62
|
-
for (const data of getDescendantsByType(paragraph, [ "data" ])) {
|
|
63
|
-
addRangeToSet(paragraphDataLineNumbers, data.startLine, data.endLine);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
const linkOnlyLineNumbers = new Set();
|
|
67
|
-
for (const lineNumber of linkLineNumbers) {
|
|
68
|
-
if (!paragraphDataLineNumbers.has(lineNumber)) {
|
|
69
|
-
linkOnlyLineNumbers.add(lineNumber);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
const definitionLineIndices = new Set(getReferenceLinkImageData().definitionLineIndices);
|
|
73
|
-
for (let lineIndex = 0; lineIndex < params.lines.length; lineIndex++) {
|
|
74
|
-
const line = params.lines[lineIndex];
|
|
75
|
-
const lineNumber = lineIndex + 1;
|
|
76
|
-
const isHeading = headingLineNumbers.has(lineNumber);
|
|
77
|
-
const inCode = codeBlockLineNumbers.has(lineNumber);
|
|
78
|
-
const inTable = tableLineNumbers.has(lineNumber);
|
|
79
|
-
const length = inCode ?
|
|
80
|
-
codeLineLength :
|
|
81
|
-
(isHeading ? headingLineLength : lineLength);
|
|
82
|
-
const lengthRe = inCode ?
|
|
83
|
-
longCodeLineRe :
|
|
84
|
-
(isHeading ? longHeadingLineRe : longLineRe);
|
|
85
|
-
if ((includeCodeBlocks || !inCode) &&
|
|
86
|
-
(includeTables || !inTable) &&
|
|
87
|
-
(includeHeadings || !isHeading) &&
|
|
88
|
-
!definitionLineIndices.has(lineIndex) &&
|
|
89
|
-
(strict ||
|
|
90
|
-
(!(stern && sternModeRe.test(line)) &&
|
|
91
|
-
!linkOnlyLineNumbers.has(lineNumber))) &&
|
|
92
|
-
lengthRe.test(line)) {
|
|
93
|
-
addErrorDetailIf(
|
|
94
|
-
onError,
|
|
95
|
-
lineNumber,
|
|
96
|
-
length,
|
|
97
|
-
line.length,
|
|
98
|
-
undefined,
|
|
99
|
-
undefined,
|
|
100
|
-
[ length + 1, line.length - length ]
|
|
101
|
-
);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
};
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
|
|
3
|
-
"use strict";
|
|
4
|
-
|
|
5
|
-
const { addErrorContext } = require("../helpers");
|
|
6
|
-
const { filterByTypes } = require("../helpers/micromark.cjs");
|
|
7
|
-
const { filterByTypesCached } = require("./cache");
|
|
8
|
-
|
|
9
|
-
const dollarCommandRe = /^(\s*)(\$\s+)/;
|
|
10
|
-
|
|
11
|
-
// eslint-disable-next-line jsdoc/valid-types
|
|
12
|
-
/** @type import("./markdownlint").Rule */
|
|
13
|
-
module.exports = {
|
|
14
|
-
"names": [ "MD014", "commands-show-output" ],
|
|
15
|
-
"description": "Dollar signs used before commands without showing output",
|
|
16
|
-
"tags": [ "code" ],
|
|
17
|
-
"parser": "micromark",
|
|
18
|
-
"function": function MD014(params, onError) {
|
|
19
|
-
for (const codeBlock of filterByTypesCached([ "codeFenced", "codeIndented" ])) {
|
|
20
|
-
const codeFlowValues = filterByTypes(
|
|
21
|
-
codeBlock.children,
|
|
22
|
-
[ "codeFlowValue" ]
|
|
23
|
-
);
|
|
24
|
-
const dollarMatches = codeFlowValues.
|
|
25
|
-
map((codeFlowValue) => ({
|
|
26
|
-
"result": codeFlowValue.text.match(dollarCommandRe),
|
|
27
|
-
"startColumn": codeFlowValue.startColumn,
|
|
28
|
-
"startLine": codeFlowValue.startLine,
|
|
29
|
-
"text": codeFlowValue.text
|
|
30
|
-
})).
|
|
31
|
-
filter((dollarMatch) => dollarMatch.result);
|
|
32
|
-
if (dollarMatches.length === codeFlowValues.length) {
|
|
33
|
-
for (const dollarMatch of dollarMatches) {
|
|
34
|
-
// @ts-ignore
|
|
35
|
-
const column = dollarMatch.startColumn + dollarMatch.result[1].length;
|
|
36
|
-
// @ts-ignore
|
|
37
|
-
const length = dollarMatch.result[2].length;
|
|
38
|
-
addErrorContext(
|
|
39
|
-
onError,
|
|
40
|
-
dollarMatch.startLine,
|
|
41
|
-
dollarMatch.text,
|
|
42
|
-
undefined,
|
|
43
|
-
undefined,
|
|
44
|
-
[ column, length ],
|
|
45
|
-
{
|
|
46
|
-
"editColumn": column,
|
|
47
|
-
"deleteCount": length
|
|
48
|
-
}
|
|
49
|
-
);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
|
|
3
|
-
"use strict";
|
|
4
|
-
|
|
5
|
-
const { addErrorContext } = require("../helpers");
|
|
6
|
-
const { addRangeToSet } = require("../helpers/micromark.cjs");
|
|
7
|
-
const { filterByTypesCached } = require("./cache");
|
|
8
|
-
|
|
9
|
-
// eslint-disable-next-line jsdoc/valid-types
|
|
10
|
-
/** @type import("./markdownlint").Rule */
|
|
11
|
-
module.exports = {
|
|
12
|
-
"names": [ "MD018", "no-missing-space-atx" ],
|
|
13
|
-
"description": "No space after hash on atx style heading",
|
|
14
|
-
"tags": [ "headings", "atx", "spaces" ],
|
|
15
|
-
"parser": "micromark",
|
|
16
|
-
"function": function MD018(params, onError) {
|
|
17
|
-
const { lines } = params;
|
|
18
|
-
const ignoreBlockLineNumbers = new Set();
|
|
19
|
-
for (const ignoreBlock of filterByTypesCached([ "codeFenced", "codeIndented", "htmlFlow" ])) {
|
|
20
|
-
addRangeToSet(ignoreBlockLineNumbers, ignoreBlock.startLine, ignoreBlock.endLine);
|
|
21
|
-
}
|
|
22
|
-
for (const [ lineIndex, line ] of lines.entries()) {
|
|
23
|
-
if (
|
|
24
|
-
!ignoreBlockLineNumbers.has(lineIndex + 1) &&
|
|
25
|
-
/^#+[^# \t]/.test(line) &&
|
|
26
|
-
!/#\s*$/.test(line) &&
|
|
27
|
-
!line.startsWith("#️⃣")
|
|
28
|
-
) {
|
|
29
|
-
// @ts-ignore
|
|
30
|
-
const hashCount = /^#+/.exec(line)[0].length;
|
|
31
|
-
addErrorContext(
|
|
32
|
-
onError,
|
|
33
|
-
lineIndex + 1,
|
|
34
|
-
line.trim(),
|
|
35
|
-
undefined,
|
|
36
|
-
undefined,
|
|
37
|
-
[ 1, hashCount + 1 ],
|
|
38
|
-
{
|
|
39
|
-
"editColumn": hashCount + 1,
|
|
40
|
-
"insertText": " "
|
|
41
|
-
}
|
|
42
|
-
);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
};
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
|
|
3
|
-
"use strict";
|
|
4
|
-
|
|
5
|
-
const { addErrorContext } = require("../helpers/helpers");
|
|
6
|
-
const { getHeadingStyle } = require("../helpers/micromark.cjs");
|
|
7
|
-
const { filterByTypesCached } = require("./cache");
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Validate heading sequence and whitespace length at start or end.
|
|
11
|
-
*
|
|
12
|
-
* @param {import("./markdownlint").RuleOnError} onError Error-reporting callback.
|
|
13
|
-
* @param {import("./markdownlint").MicromarkToken} heading ATX heading token.
|
|
14
|
-
* @param {number} delta Direction to scan.
|
|
15
|
-
* @returns {void}
|
|
16
|
-
*/
|
|
17
|
-
function validateHeadingSpaces(onError, heading, delta) {
|
|
18
|
-
const { children, startLine, text } = heading;
|
|
19
|
-
let index = (delta > 0) ? 0 : (children.length - 1);
|
|
20
|
-
while (
|
|
21
|
-
children[index] &&
|
|
22
|
-
(children[index].type !== "atxHeadingSequence")
|
|
23
|
-
) {
|
|
24
|
-
index += delta;
|
|
25
|
-
}
|
|
26
|
-
const headingSequence = children[index];
|
|
27
|
-
const whitespace = children[index + delta];
|
|
28
|
-
if (
|
|
29
|
-
(headingSequence?.type === "atxHeadingSequence") &&
|
|
30
|
-
(whitespace?.type === "whitespace") &&
|
|
31
|
-
(whitespace.text.length > 1)
|
|
32
|
-
) {
|
|
33
|
-
const column = whitespace.startColumn + 1;
|
|
34
|
-
const length = whitespace.endColumn - column;
|
|
35
|
-
addErrorContext(
|
|
36
|
-
onError,
|
|
37
|
-
startLine,
|
|
38
|
-
text.trim(),
|
|
39
|
-
delta > 0,
|
|
40
|
-
delta < 0,
|
|
41
|
-
[ column, length ],
|
|
42
|
-
{
|
|
43
|
-
"editColumn": column,
|
|
44
|
-
"deleteCount": length
|
|
45
|
-
}
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// eslint-disable-next-line jsdoc/valid-types
|
|
51
|
-
/** @type import("./markdownlint").Rule[] */
|
|
52
|
-
module.exports = [
|
|
53
|
-
{
|
|
54
|
-
"names": [ "MD019", "no-multiple-space-atx" ],
|
|
55
|
-
"description": "Multiple spaces after hash on atx style heading",
|
|
56
|
-
"tags": [ "headings", "atx", "spaces" ],
|
|
57
|
-
"parser": "micromark",
|
|
58
|
-
"function": function MD019(params, onError) {
|
|
59
|
-
const atxHeadings = filterByTypesCached([ "atxHeading" ])
|
|
60
|
-
.filter((heading) => getHeadingStyle(heading) === "atx");
|
|
61
|
-
for (const atxHeading of atxHeadings) {
|
|
62
|
-
validateHeadingSpaces(onError, atxHeading, 1);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
"names": [ "MD021", "no-multiple-space-closed-atx" ],
|
|
68
|
-
"description": "Multiple spaces inside hashes on closed atx style heading",
|
|
69
|
-
"tags": [ "headings", "atx_closed", "spaces" ],
|
|
70
|
-
"parser": "micromark",
|
|
71
|
-
"function": function MD021(params, onError) {
|
|
72
|
-
const atxClosedHeadings = filterByTypesCached([ "atxHeading" ])
|
|
73
|
-
.filter((heading) => getHeadingStyle(heading) === "atx_closed");
|
|
74
|
-
for (const atxClosedHeading of atxClosedHeadings) {
|
|
75
|
-
validateHeadingSpaces(onError, atxClosedHeading, 1);
|
|
76
|
-
validateHeadingSpaces(onError, atxClosedHeading, -1);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
];
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
|
|
3
|
-
"use strict";
|
|
4
|
-
|
|
5
|
-
const { addErrorContext } = require("../helpers");
|
|
6
|
-
const { addRangeToSet } = require("../helpers/micromark.cjs");
|
|
7
|
-
const { filterByTypesCached } = require("./cache");
|
|
8
|
-
|
|
9
|
-
// eslint-disable-next-line jsdoc/valid-types
|
|
10
|
-
/** @type import("./markdownlint").Rule */
|
|
11
|
-
module.exports = {
|
|
12
|
-
"names": [ "MD020", "no-missing-space-closed-atx" ],
|
|
13
|
-
"description": "No space inside hashes on closed atx style heading",
|
|
14
|
-
"tags": [ "headings", "atx_closed", "spaces" ],
|
|
15
|
-
"parser": "micromark",
|
|
16
|
-
"function": function MD020(params, onError) {
|
|
17
|
-
const { lines } = params;
|
|
18
|
-
const ignoreBlockLineNumbers = new Set();
|
|
19
|
-
for (const ignoreBlock of filterByTypesCached([ "codeFenced", "codeIndented", "htmlFlow" ])) {
|
|
20
|
-
addRangeToSet(ignoreBlockLineNumbers, ignoreBlock.startLine, ignoreBlock.endLine);
|
|
21
|
-
}
|
|
22
|
-
for (const [ lineIndex, line ] of lines.entries()) {
|
|
23
|
-
if (!ignoreBlockLineNumbers.has(lineIndex + 1)) {
|
|
24
|
-
const match =
|
|
25
|
-
/^(#+)([ \t]*)([^#]*?[^#\\])([ \t]*)((?:\\#)?)(#+)(\s*)$/.exec(line);
|
|
26
|
-
if (match) {
|
|
27
|
-
const [
|
|
28
|
-
,
|
|
29
|
-
leftHash,
|
|
30
|
-
{ "length": leftSpaceLength },
|
|
31
|
-
content,
|
|
32
|
-
{ "length": rightSpaceLength },
|
|
33
|
-
rightEscape,
|
|
34
|
-
rightHash,
|
|
35
|
-
{ "length": trailSpaceLength }
|
|
36
|
-
] = match;
|
|
37
|
-
const leftHashLength = leftHash.length;
|
|
38
|
-
const rightHashLength = rightHash.length;
|
|
39
|
-
const left = !leftSpaceLength;
|
|
40
|
-
const right = !rightSpaceLength || !!rightEscape;
|
|
41
|
-
const rightEscapeReplacement = rightEscape ? `${rightEscape} ` : "";
|
|
42
|
-
if (left || right) {
|
|
43
|
-
const range = left ?
|
|
44
|
-
[
|
|
45
|
-
1,
|
|
46
|
-
leftHashLength + 1
|
|
47
|
-
] :
|
|
48
|
-
[
|
|
49
|
-
line.length - trailSpaceLength - rightHashLength,
|
|
50
|
-
rightHashLength + 1
|
|
51
|
-
];
|
|
52
|
-
addErrorContext(
|
|
53
|
-
onError,
|
|
54
|
-
lineIndex + 1,
|
|
55
|
-
line.trim(),
|
|
56
|
-
left,
|
|
57
|
-
right,
|
|
58
|
-
range,
|
|
59
|
-
{
|
|
60
|
-
"editColumn": 1,
|
|
61
|
-
"deleteCount": line.length,
|
|
62
|
-
"insertText":
|
|
63
|
-
`${leftHash} ${content} ${rightEscapeReplacement}${rightHash}`
|
|
64
|
-
}
|
|
65
|
-
);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
};
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
|
|
3
|
-
"use strict";
|
|
4
|
-
|
|
5
|
-
const { addErrorDetailIf, blockquotePrefixRe, isBlankLine } = require("../helpers");
|
|
6
|
-
const { getHeadingLevel } = require("../helpers/micromark.cjs");
|
|
7
|
-
const { filterByTypesCached } = require("./cache");
|
|
8
|
-
|
|
9
|
-
const defaultLines = 1;
|
|
10
|
-
|
|
11
|
-
const getLinesFunction = (linesParam) => {
|
|
12
|
-
if (Array.isArray(linesParam)) {
|
|
13
|
-
const linesArray = new Array(6).fill(defaultLines);
|
|
14
|
-
for (const [ index, value ] of [ ...linesParam.entries() ].slice(0, 6)) {
|
|
15
|
-
linesArray[index] = value;
|
|
16
|
-
}
|
|
17
|
-
return (heading) => linesArray[getHeadingLevel(heading) - 1];
|
|
18
|
-
}
|
|
19
|
-
// Coerce linesParam to a number
|
|
20
|
-
const lines = (linesParam === undefined) ? defaultLines : Number(linesParam);
|
|
21
|
-
return () => lines;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
const getBlockQuote = (str, count) => (
|
|
25
|
-
(str || "")
|
|
26
|
-
.match(blockquotePrefixRe)[0]
|
|
27
|
-
.trimEnd()
|
|
28
|
-
// eslint-disable-next-line unicorn/prefer-spread
|
|
29
|
-
.concat("\n")
|
|
30
|
-
.repeat(count)
|
|
31
|
-
);
|
|
32
|
-
|
|
33
|
-
// eslint-disable-next-line jsdoc/valid-types
|
|
34
|
-
/** @type import("./markdownlint").Rule */
|
|
35
|
-
module.exports = {
|
|
36
|
-
"names": [ "MD022", "blanks-around-headings" ],
|
|
37
|
-
"description": "Headings should be surrounded by blank lines",
|
|
38
|
-
"tags": [ "headings", "blank_lines" ],
|
|
39
|
-
"parser": "micromark",
|
|
40
|
-
"function": function MD022(params, onError) {
|
|
41
|
-
const getLinesAbove = getLinesFunction(params.config.lines_above);
|
|
42
|
-
const getLinesBelow = getLinesFunction(params.config.lines_below);
|
|
43
|
-
const { lines } = params;
|
|
44
|
-
for (const heading of filterByTypesCached([ "atxHeading", "setextHeading" ])) {
|
|
45
|
-
const { startLine, endLine } = heading;
|
|
46
|
-
const line = lines[startLine - 1].trim();
|
|
47
|
-
|
|
48
|
-
// Check lines above
|
|
49
|
-
const linesAbove = getLinesAbove(heading);
|
|
50
|
-
if (linesAbove >= 0) {
|
|
51
|
-
let actualAbove = 0;
|
|
52
|
-
for (
|
|
53
|
-
let i = 0;
|
|
54
|
-
(i < linesAbove) && isBlankLine(lines[startLine - 2 - i]);
|
|
55
|
-
i++
|
|
56
|
-
) {
|
|
57
|
-
actualAbove++;
|
|
58
|
-
}
|
|
59
|
-
addErrorDetailIf(
|
|
60
|
-
onError,
|
|
61
|
-
startLine,
|
|
62
|
-
linesAbove,
|
|
63
|
-
actualAbove,
|
|
64
|
-
"Above",
|
|
65
|
-
line,
|
|
66
|
-
undefined,
|
|
67
|
-
{
|
|
68
|
-
"insertText": getBlockQuote(
|
|
69
|
-
lines[startLine - 2],
|
|
70
|
-
linesAbove - actualAbove
|
|
71
|
-
)
|
|
72
|
-
}
|
|
73
|
-
);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// Check lines below
|
|
77
|
-
const linesBelow = getLinesBelow(heading);
|
|
78
|
-
if (linesBelow >= 0) {
|
|
79
|
-
let actualBelow = 0;
|
|
80
|
-
for (
|
|
81
|
-
let i = 0;
|
|
82
|
-
(i < linesBelow) && isBlankLine(lines[endLine + i]);
|
|
83
|
-
i++
|
|
84
|
-
) {
|
|
85
|
-
actualBelow++;
|
|
86
|
-
}
|
|
87
|
-
addErrorDetailIf(
|
|
88
|
-
onError,
|
|
89
|
-
startLine,
|
|
90
|
-
linesBelow,
|
|
91
|
-
actualBelow,
|
|
92
|
-
"Below",
|
|
93
|
-
line,
|
|
94
|
-
undefined,
|
|
95
|
-
{
|
|
96
|
-
"lineNumber": endLine + 1,
|
|
97
|
-
"insertText": getBlockQuote(
|
|
98
|
-
lines[endLine],
|
|
99
|
-
linesBelow - actualBelow
|
|
100
|
-
)
|
|
101
|
-
}
|
|
102
|
-
);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
|
|
3
|
-
"use strict";
|
|
4
|
-
|
|
5
|
-
const { addErrorContext } = require("../helpers");
|
|
6
|
-
const { filterByTypesCached } = require("./cache");
|
|
7
|
-
|
|
8
|
-
// eslint-disable-next-line jsdoc/valid-types
|
|
9
|
-
/** @type import("./markdownlint").Rule */
|
|
10
|
-
module.exports = {
|
|
11
|
-
"names": [ "MD023", "heading-start-left" ],
|
|
12
|
-
"description": "Headings must start at the beginning of the line",
|
|
13
|
-
"tags": [ "headings", "spaces" ],
|
|
14
|
-
"parser": "micromark",
|
|
15
|
-
"function": function MD023(params, onError) {
|
|
16
|
-
const headings = filterByTypesCached([ "atxHeading", "linePrefix", "setextHeading" ]);
|
|
17
|
-
for (let i = 0; i < headings.length - 1; i++) {
|
|
18
|
-
if (
|
|
19
|
-
(headings[i].type === "linePrefix") &&
|
|
20
|
-
(headings[i + 1].type !== "linePrefix") &&
|
|
21
|
-
(headings[i].startLine === headings[i + 1].startLine)
|
|
22
|
-
) {
|
|
23
|
-
const { endColumn, startColumn, startLine } = headings[i];
|
|
24
|
-
const length = endColumn - startColumn;
|
|
25
|
-
addErrorContext(
|
|
26
|
-
onError,
|
|
27
|
-
startLine,
|
|
28
|
-
params.lines[startLine - 1],
|
|
29
|
-
true,
|
|
30
|
-
false,
|
|
31
|
-
[ startColumn, length ],
|
|
32
|
-
{
|
|
33
|
-
"editColumn": startColumn,
|
|
34
|
-
"deleteCount": length
|
|
35
|
-
}
|
|
36
|
-
);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
|
|
3
|
-
"use strict";
|
|
4
|
-
|
|
5
|
-
const { addErrorContext } = require("../helpers");
|
|
6
|
-
const { getHeadingLevel, getHeadingText } = require("../helpers/micromark.cjs");
|
|
7
|
-
const { filterByTypesCached } = require("./cache");
|
|
8
|
-
|
|
9
|
-
// eslint-disable-next-line jsdoc/valid-types
|
|
10
|
-
/** @type import("./markdownlint").Rule */
|
|
11
|
-
module.exports = {
|
|
12
|
-
"names": [ "MD024", "no-duplicate-heading" ],
|
|
13
|
-
"description": "Multiple headings with the same content",
|
|
14
|
-
"tags": [ "headings" ],
|
|
15
|
-
"parser": "micromark",
|
|
16
|
-
"function": function MD024(params, onError) {
|
|
17
|
-
const siblingsOnly = !!params.config.siblings_only || false;
|
|
18
|
-
const knownContents = [ null, [] ];
|
|
19
|
-
let lastLevel = 1;
|
|
20
|
-
let knownContent = knownContents[lastLevel];
|
|
21
|
-
for (const heading of filterByTypesCached([ "atxHeading", "setextHeading" ])) {
|
|
22
|
-
const headingText = getHeadingText(heading);
|
|
23
|
-
if (siblingsOnly) {
|
|
24
|
-
const newLevel = getHeadingLevel(heading);
|
|
25
|
-
while (lastLevel < newLevel) {
|
|
26
|
-
lastLevel++;
|
|
27
|
-
knownContents[lastLevel] = [];
|
|
28
|
-
}
|
|
29
|
-
while (lastLevel > newLevel) {
|
|
30
|
-
knownContents[lastLevel] = [];
|
|
31
|
-
lastLevel--;
|
|
32
|
-
}
|
|
33
|
-
knownContent = knownContents[newLevel];
|
|
34
|
-
}
|
|
35
|
-
// @ts-ignore
|
|
36
|
-
if (knownContent.includes(headingText)) {
|
|
37
|
-
addErrorContext(
|
|
38
|
-
onError,
|
|
39
|
-
heading.startLine,
|
|
40
|
-
headingText.trim()
|
|
41
|
-
);
|
|
42
|
-
} else {
|
|
43
|
-
// @ts-ignore
|
|
44
|
-
knownContent.push(headingText);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
|
|
3
|
-
"use strict";
|
|
4
|
-
|
|
5
|
-
const { addErrorContext, frontMatterHasTitle } = require("../helpers");
|
|
6
|
-
const { getHeadingLevel, getHeadingText } = require("../helpers/micromark.cjs");
|
|
7
|
-
const { filterByTypesCached } = require("./cache");
|
|
8
|
-
|
|
9
|
-
// eslint-disable-next-line jsdoc/valid-types
|
|
10
|
-
/** @type import("./markdownlint").Rule */
|
|
11
|
-
module.exports = {
|
|
12
|
-
"names": [ "MD025", "single-title", "single-h1" ],
|
|
13
|
-
"description": "Multiple top-level headings in the same document",
|
|
14
|
-
"tags": [ "headings" ],
|
|
15
|
-
"parser": "micromark",
|
|
16
|
-
"function": function MD025(params, onError) {
|
|
17
|
-
const level = Number(params.config.level || 1);
|
|
18
|
-
const foundFrontMatterTitle =
|
|
19
|
-
frontMatterHasTitle(
|
|
20
|
-
params.frontMatterLines,
|
|
21
|
-
params.config.front_matter_title
|
|
22
|
-
);
|
|
23
|
-
let hasTopLevelHeading = false;
|
|
24
|
-
for (const heading of filterByTypesCached([ "atxHeading", "setextHeading" ])) {
|
|
25
|
-
const headingLevel = getHeadingLevel(heading);
|
|
26
|
-
if (headingLevel === level) {
|
|
27
|
-
if (hasTopLevelHeading || foundFrontMatterTitle) {
|
|
28
|
-
const headingText = getHeadingText(heading);
|
|
29
|
-
addErrorContext(
|
|
30
|
-
onError,
|
|
31
|
-
heading.startLine,
|
|
32
|
-
headingText
|
|
33
|
-
);
|
|
34
|
-
} else if (heading.startLine === 1) {
|
|
35
|
-
hasTopLevelHeading = true;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
|
|
3
|
-
"use strict";
|
|
4
|
-
|
|
5
|
-
const { addError, allPunctuationNoQuestion, endOfLineGemojiCodeRe,
|
|
6
|
-
endOfLineHtmlEntityRe, escapeForRegExp } = require("../helpers");
|
|
7
|
-
const { filterByTypesCached } = require("./cache");
|
|
8
|
-
|
|
9
|
-
// eslint-disable-next-line jsdoc/valid-types
|
|
10
|
-
/** @type import("./markdownlint").Rule */
|
|
11
|
-
module.exports = {
|
|
12
|
-
"names": [ "MD026", "no-trailing-punctuation" ],
|
|
13
|
-
"description": "Trailing punctuation in heading",
|
|
14
|
-
"tags": [ "headings" ],
|
|
15
|
-
"parser": "micromark",
|
|
16
|
-
"function": function MD026(params, onError) {
|
|
17
|
-
let punctuation = params.config.punctuation;
|
|
18
|
-
punctuation = String(
|
|
19
|
-
(punctuation === undefined) ? allPunctuationNoQuestion : punctuation
|
|
20
|
-
);
|
|
21
|
-
const trailingPunctuationRe =
|
|
22
|
-
new RegExp("\\s*[" + escapeForRegExp(punctuation) + "]+$");
|
|
23
|
-
const headings = filterByTypesCached([ "atxHeadingText", "setextHeadingText" ]);
|
|
24
|
-
for (const heading of headings) {
|
|
25
|
-
const { endColumn, endLine, text } = heading;
|
|
26
|
-
const match = trailingPunctuationRe.exec(text);
|
|
27
|
-
if (
|
|
28
|
-
match &&
|
|
29
|
-
!endOfLineHtmlEntityRe.test(text) &&
|
|
30
|
-
!endOfLineGemojiCodeRe.test(text)
|
|
31
|
-
) {
|
|
32
|
-
const fullMatch = match[0];
|
|
33
|
-
const length = fullMatch.length;
|
|
34
|
-
const column = endColumn - length;
|
|
35
|
-
addError(
|
|
36
|
-
onError,
|
|
37
|
-
endLine,
|
|
38
|
-
`Punctuation: '${fullMatch}'`,
|
|
39
|
-
undefined,
|
|
40
|
-
[ column, length ],
|
|
41
|
-
{
|
|
42
|
-
"editColumn": column,
|
|
43
|
-
"deleteCount": length
|
|
44
|
-
}
|
|
45
|
-
);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
|
|
3
|
-
"use strict";
|
|
4
|
-
|
|
5
|
-
const { addErrorContext } = require("../helpers");
|
|
6
|
-
const { filterByTypesCached } = require("./cache");
|
|
7
|
-
|
|
8
|
-
// eslint-disable-next-line jsdoc/valid-types
|
|
9
|
-
/** @type import("./markdownlint").Rule */
|
|
10
|
-
module.exports = {
|
|
11
|
-
"names": ["MD027", "no-multiple-space-blockquote"],
|
|
12
|
-
"description": "Multiple spaces after blockquote symbol",
|
|
13
|
-
"tags": ["blockquote", "whitespace", "indentation"],
|
|
14
|
-
"parser": "micromark",
|
|
15
|
-
"function": function MD027(params, onError) {
|
|
16
|
-
for (const token of filterByTypesCached([ "linePrefix" ])) {
|
|
17
|
-
const siblings = token.parent?.children || params.parsers.micromark.tokens;
|
|
18
|
-
if (siblings[siblings.indexOf(token) - 1]?.type === "blockQuotePrefix") {
|
|
19
|
-
const { startColumn, startLine, text } = token;
|
|
20
|
-
const { length } = text;
|
|
21
|
-
const line = params.lines[startLine - 1];
|
|
22
|
-
addErrorContext(
|
|
23
|
-
onError,
|
|
24
|
-
startLine,
|
|
25
|
-
line,
|
|
26
|
-
undefined,
|
|
27
|
-
undefined,
|
|
28
|
-
[ startColumn, length ],
|
|
29
|
-
{
|
|
30
|
-
"editColumn": startColumn,
|
|
31
|
-
"deleteCount": length
|
|
32
|
-
}
|
|
33
|
-
);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
};
|