@alexlit/lint-kit 127.5.3 → 127.6.1
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 +3 -3
- package/packages/config-eslint/plugins/sonar.js +4 -0
- 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 +2 -1
- 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 +0 -0
- 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,31 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
|
|
3
|
-
"use strict";
|
|
4
|
-
|
|
5
|
-
const { addErrorDetailIf } = require("../helpers");
|
|
6
|
-
const { getHeadingLevel } = 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": [ "MD001", "heading-increment" ],
|
|
13
|
-
"description": "Heading levels should only increment by one level at a time",
|
|
14
|
-
"tags": [ "headings" ],
|
|
15
|
-
"parser": "micromark",
|
|
16
|
-
"function": function MD001(params, onError) {
|
|
17
|
-
let prevLevel = Number.MAX_SAFE_INTEGER;
|
|
18
|
-
for (const heading of filterByTypesCached([ "atxHeading", "setextHeading" ])) {
|
|
19
|
-
const level = getHeadingLevel(heading);
|
|
20
|
-
if (level > prevLevel) {
|
|
21
|
-
addErrorDetailIf(
|
|
22
|
-
onError,
|
|
23
|
-
heading.startLine,
|
|
24
|
-
`h${prevLevel + 1}`,
|
|
25
|
-
`h${level}`
|
|
26
|
-
);
|
|
27
|
-
}
|
|
28
|
-
prevLevel = level;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
|
|
3
|
-
"use strict";
|
|
4
|
-
|
|
5
|
-
const { addErrorDetailIf } = require("../helpers");
|
|
6
|
-
const { getHeadingLevel, getHeadingStyle } = 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": [ "MD003", "heading-style" ],
|
|
13
|
-
"description": "Heading style",
|
|
14
|
-
"tags": [ "headings" ],
|
|
15
|
-
"parser": "micromark",
|
|
16
|
-
"function": function MD003(params, onError) {
|
|
17
|
-
let style = String(params.config.style || "consistent");
|
|
18
|
-
for (const heading of filterByTypesCached([ "atxHeading", "setextHeading" ])) {
|
|
19
|
-
const styleForToken = getHeadingStyle(heading);
|
|
20
|
-
if (style === "consistent") {
|
|
21
|
-
style = styleForToken;
|
|
22
|
-
}
|
|
23
|
-
if (styleForToken !== style) {
|
|
24
|
-
const h12 = getHeadingLevel(heading) <= 2;
|
|
25
|
-
const setextWithAtx =
|
|
26
|
-
(style === "setext_with_atx") &&
|
|
27
|
-
((h12 && (styleForToken === "setext")) ||
|
|
28
|
-
(!h12 && (styleForToken === "atx")));
|
|
29
|
-
const setextWithAtxClosed =
|
|
30
|
-
(style === "setext_with_atx_closed") &&
|
|
31
|
-
((h12 && (styleForToken === "setext")) ||
|
|
32
|
-
(!h12 && (styleForToken === "atx_closed")));
|
|
33
|
-
if (!setextWithAtx && !setextWithAtxClosed) {
|
|
34
|
-
let expected = style;
|
|
35
|
-
if (style === "setext_with_atx") {
|
|
36
|
-
expected = h12 ? "setext" : "atx";
|
|
37
|
-
} else if (style === "setext_with_atx_closed") {
|
|
38
|
-
expected = h12 ? "setext" : "atx_closed";
|
|
39
|
-
}
|
|
40
|
-
addErrorDetailIf(
|
|
41
|
-
onError,
|
|
42
|
-
heading.startLine,
|
|
43
|
-
expected,
|
|
44
|
-
styleForToken
|
|
45
|
-
);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
};
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
|
|
3
|
-
"use strict";
|
|
4
|
-
|
|
5
|
-
const { addErrorDetailIf } = require("../helpers");
|
|
6
|
-
const { getDescendantsByType, getTokenParentOfType } = require("../helpers/micromark.cjs");
|
|
7
|
-
const { filterByTypesCached } = require("./cache");
|
|
8
|
-
|
|
9
|
-
const markerToStyle = {
|
|
10
|
-
"-": "dash",
|
|
11
|
-
"+": "plus",
|
|
12
|
-
"*": "asterisk"
|
|
13
|
-
};
|
|
14
|
-
const styleToMarker = {
|
|
15
|
-
"dash": "-",
|
|
16
|
-
"plus": "+",
|
|
17
|
-
"asterisk": "*"
|
|
18
|
-
};
|
|
19
|
-
const differentItemStyle = {
|
|
20
|
-
"dash": "plus",
|
|
21
|
-
"plus": "asterisk",
|
|
22
|
-
"asterisk": "dash"
|
|
23
|
-
};
|
|
24
|
-
const validStyles = new Set([
|
|
25
|
-
"asterisk",
|
|
26
|
-
"consistent",
|
|
27
|
-
"dash",
|
|
28
|
-
"plus",
|
|
29
|
-
"sublist"
|
|
30
|
-
]);
|
|
31
|
-
|
|
32
|
-
// eslint-disable-next-line jsdoc/valid-types
|
|
33
|
-
/** @type import("./markdownlint").Rule */
|
|
34
|
-
module.exports = {
|
|
35
|
-
"names": [ "MD004", "ul-style" ],
|
|
36
|
-
"description": "Unordered list style",
|
|
37
|
-
"tags": [ "bullet", "ul" ],
|
|
38
|
-
"parser": "micromark",
|
|
39
|
-
"function": function MD004(params, onError) {
|
|
40
|
-
const style = String(params.config.style || "consistent");
|
|
41
|
-
let expectedStyle = validStyles.has(style) ? style : "dash";
|
|
42
|
-
const nestingStyles = [];
|
|
43
|
-
for (const listUnordered of filterByTypesCached([ "listUnordered" ])) {
|
|
44
|
-
let nesting = 0;
|
|
45
|
-
if (style === "sublist") {
|
|
46
|
-
/** @type {import("../helpers/micromark.cjs").Token | null} */
|
|
47
|
-
let parent = listUnordered;
|
|
48
|
-
// @ts-ignore
|
|
49
|
-
while ((parent = getTokenParentOfType(parent, [ "listOrdered", "listUnordered" ]))) {
|
|
50
|
-
nesting++;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
const listItemMarkers = getDescendantsByType(listUnordered, [ "listItemPrefix", "listItemMarker" ]);
|
|
54
|
-
for (const listItemMarker of listItemMarkers) {
|
|
55
|
-
const itemStyle = markerToStyle[listItemMarker.text];
|
|
56
|
-
if (style === "sublist") {
|
|
57
|
-
if (!nestingStyles[nesting]) {
|
|
58
|
-
nestingStyles[nesting] =
|
|
59
|
-
(itemStyle === nestingStyles[nesting - 1]) ?
|
|
60
|
-
differentItemStyle[itemStyle] :
|
|
61
|
-
itemStyle;
|
|
62
|
-
}
|
|
63
|
-
expectedStyle = nestingStyles[nesting];
|
|
64
|
-
} else if (expectedStyle === "consistent") {
|
|
65
|
-
expectedStyle = itemStyle;
|
|
66
|
-
}
|
|
67
|
-
const column = listItemMarker.startColumn;
|
|
68
|
-
const length = listItemMarker.endColumn - listItemMarker.startColumn;
|
|
69
|
-
addErrorDetailIf(
|
|
70
|
-
onError,
|
|
71
|
-
listItemMarker.startLine,
|
|
72
|
-
expectedStyle,
|
|
73
|
-
itemStyle,
|
|
74
|
-
undefined,
|
|
75
|
-
undefined,
|
|
76
|
-
[ column, length ],
|
|
77
|
-
{
|
|
78
|
-
"editColumn": column,
|
|
79
|
-
"deleteCount": length,
|
|
80
|
-
"insertText": styleToMarker[expectedStyle]
|
|
81
|
-
}
|
|
82
|
-
);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
};
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
|
|
3
|
-
"use strict";
|
|
4
|
-
|
|
5
|
-
const { addError, addErrorDetailIf } = 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": [ "MD005", "list-indent" ],
|
|
12
|
-
"description": "Inconsistent indentation for list items at the same level",
|
|
13
|
-
"tags": [ "bullet", "ul", "indentation" ],
|
|
14
|
-
"parser": "micromark",
|
|
15
|
-
"function": function MD005(params, onError) {
|
|
16
|
-
for (const list of filterByTypesCached([ "listOrdered", "listUnordered" ])) {
|
|
17
|
-
const expectedIndent = list.startColumn - 1;
|
|
18
|
-
let expectedEnd = 0;
|
|
19
|
-
let endMatching = false;
|
|
20
|
-
const listItemPrefixes =
|
|
21
|
-
list.children.filter((token) => (token.type === "listItemPrefix"));
|
|
22
|
-
for (const listItemPrefix of listItemPrefixes) {
|
|
23
|
-
const lineNumber = listItemPrefix.startLine;
|
|
24
|
-
const actualIndent = listItemPrefix.startColumn - 1;
|
|
25
|
-
const range = [ 1, listItemPrefix.endColumn - 1 ];
|
|
26
|
-
if (list.type === "listUnordered") {
|
|
27
|
-
addErrorDetailIf(
|
|
28
|
-
onError,
|
|
29
|
-
lineNumber,
|
|
30
|
-
expectedIndent,
|
|
31
|
-
actualIndent,
|
|
32
|
-
undefined,
|
|
33
|
-
undefined,
|
|
34
|
-
range
|
|
35
|
-
// No fixInfo; MD007 handles this scenario better
|
|
36
|
-
);
|
|
37
|
-
} else {
|
|
38
|
-
const markerLength = listItemPrefix.text.trim().length;
|
|
39
|
-
const actualEnd = listItemPrefix.startColumn + markerLength - 1;
|
|
40
|
-
expectedEnd = expectedEnd || actualEnd;
|
|
41
|
-
if ((expectedIndent !== actualIndent) || endMatching) {
|
|
42
|
-
if (expectedEnd === actualEnd) {
|
|
43
|
-
endMatching = true;
|
|
44
|
-
} else {
|
|
45
|
-
const detail = endMatching ?
|
|
46
|
-
`Expected: (${expectedEnd}); Actual: (${actualEnd})` :
|
|
47
|
-
`Expected: ${expectedIndent}; Actual: ${actualIndent}`;
|
|
48
|
-
const expected = endMatching ?
|
|
49
|
-
expectedEnd - markerLength :
|
|
50
|
-
expectedIndent;
|
|
51
|
-
const actual = endMatching ?
|
|
52
|
-
actualEnd - markerLength :
|
|
53
|
-
actualIndent;
|
|
54
|
-
addError(
|
|
55
|
-
onError,
|
|
56
|
-
lineNumber,
|
|
57
|
-
detail,
|
|
58
|
-
undefined,
|
|
59
|
-
range,
|
|
60
|
-
{
|
|
61
|
-
"editColumn": Math.min(actual, expected) + 1,
|
|
62
|
-
"deleteCount": Math.max(actual - expected, 0),
|
|
63
|
-
"insertText": "".padEnd(Math.max(expected - actual, 0))
|
|
64
|
-
}
|
|
65
|
-
);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
};
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
|
|
3
|
-
"use strict";
|
|
4
|
-
|
|
5
|
-
const { addErrorDetailIf } = require("../helpers");
|
|
6
|
-
const { getTokenParentOfType } = require("../helpers/micromark.cjs");
|
|
7
|
-
const { filterByTypesCached } = require("./cache");
|
|
8
|
-
|
|
9
|
-
// eslint-disable-next-line jsdoc/valid-types
|
|
10
|
-
/** @type import("markdownlint-micromark").TokenType[] */
|
|
11
|
-
const unorderedListTypes =
|
|
12
|
-
[ "blockQuotePrefix", "listItemPrefix", "listUnordered" ];
|
|
13
|
-
// eslint-disable-next-line jsdoc/valid-types
|
|
14
|
-
/** @type import("markdownlint-micromark").TokenType[] */
|
|
15
|
-
const unorderedParentTypes =
|
|
16
|
-
[ "blockQuote", "listOrdered", "listUnordered" ];
|
|
17
|
-
|
|
18
|
-
// eslint-disable-next-line jsdoc/valid-types
|
|
19
|
-
/** @type import("./markdownlint").Rule */
|
|
20
|
-
module.exports = {
|
|
21
|
-
"names": [ "MD007", "ul-indent" ],
|
|
22
|
-
"description": "Unordered list indentation",
|
|
23
|
-
"tags": [ "bullet", "ul", "indentation" ],
|
|
24
|
-
"parser": "micromark",
|
|
25
|
-
"function": function MD007(params, onError) {
|
|
26
|
-
const indent = Number(params.config.indent || 2);
|
|
27
|
-
const startIndented = !!params.config.start_indented;
|
|
28
|
-
const startIndent = Number(params.config.start_indent || indent);
|
|
29
|
-
const unorderedListNesting = new Map();
|
|
30
|
-
let lastBlockQuotePrefix = null;
|
|
31
|
-
const tokens = filterByTypesCached(unorderedListTypes);
|
|
32
|
-
for (const token of tokens) {
|
|
33
|
-
const { endColumn, parent, startColumn, startLine, type } = token;
|
|
34
|
-
if (type === "blockQuotePrefix") {
|
|
35
|
-
lastBlockQuotePrefix = token;
|
|
36
|
-
} else if (type === "listUnordered") {
|
|
37
|
-
let nesting = 0;
|
|
38
|
-
/** @type {import("../helpers/micromark.cjs").Token | null} */
|
|
39
|
-
let current = token;
|
|
40
|
-
while (
|
|
41
|
-
// @ts-ignore
|
|
42
|
-
(current = getTokenParentOfType(current, unorderedParentTypes))
|
|
43
|
-
) {
|
|
44
|
-
if (current.type === "listUnordered") {
|
|
45
|
-
nesting++;
|
|
46
|
-
// eslint-disable-next-line no-continue
|
|
47
|
-
continue;
|
|
48
|
-
} else if (current.type === "listOrdered") {
|
|
49
|
-
nesting = -1;
|
|
50
|
-
}
|
|
51
|
-
break;
|
|
52
|
-
}
|
|
53
|
-
if (nesting >= 0) {
|
|
54
|
-
unorderedListNesting.set(token, nesting);
|
|
55
|
-
}
|
|
56
|
-
} else {
|
|
57
|
-
// listItemPrefix
|
|
58
|
-
const nesting = unorderedListNesting.get(parent);
|
|
59
|
-
if (nesting !== undefined) {
|
|
60
|
-
// listItemPrefix for listUnordered
|
|
61
|
-
const expectedIndent =
|
|
62
|
-
(startIndented ? startIndent : 0) + (nesting * indent);
|
|
63
|
-
const blockQuoteAdjustment =
|
|
64
|
-
(lastBlockQuotePrefix?.endLine === startLine) ?
|
|
65
|
-
(lastBlockQuotePrefix.endColumn - 1) :
|
|
66
|
-
0;
|
|
67
|
-
const actualIndent = startColumn - 1 - blockQuoteAdjustment;
|
|
68
|
-
const range = [ 1, endColumn - 1 ];
|
|
69
|
-
const fixInfo = {
|
|
70
|
-
"editColumn": startColumn - actualIndent,
|
|
71
|
-
"deleteCount": Math.max(actualIndent - expectedIndent, 0),
|
|
72
|
-
"insertText": "".padEnd(Math.max(expectedIndent - actualIndent, 0))
|
|
73
|
-
};
|
|
74
|
-
addErrorDetailIf(
|
|
75
|
-
onError,
|
|
76
|
-
startLine,
|
|
77
|
-
expectedIndent,
|
|
78
|
-
actualIndent,
|
|
79
|
-
undefined,
|
|
80
|
-
undefined,
|
|
81
|
-
range,
|
|
82
|
-
fixInfo
|
|
83
|
-
);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
};
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
|
|
3
|
-
"use strict";
|
|
4
|
-
|
|
5
|
-
const { addError } = 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": [ "MD009", "no-trailing-spaces" ],
|
|
13
|
-
"description": "Trailing spaces",
|
|
14
|
-
"tags": [ "whitespace" ],
|
|
15
|
-
"parser": "micromark",
|
|
16
|
-
"function": function MD009(params, onError) {
|
|
17
|
-
let brSpaces = params.config.br_spaces;
|
|
18
|
-
brSpaces = Number((brSpaces === undefined) ? 2 : brSpaces);
|
|
19
|
-
const listItemEmptyLines = !!params.config.list_item_empty_lines;
|
|
20
|
-
const strict = !!params.config.strict;
|
|
21
|
-
const codeBlockLineNumbers = new Set();
|
|
22
|
-
for (const codeBlock of filterByTypesCached([ "codeFenced" ])) {
|
|
23
|
-
addRangeToSet(codeBlockLineNumbers, codeBlock.startLine + 1, codeBlock.endLine - 1);
|
|
24
|
-
}
|
|
25
|
-
for (const codeBlock of filterByTypesCached([ "codeIndented" ])) {
|
|
26
|
-
addRangeToSet(codeBlockLineNumbers, codeBlock.startLine, codeBlock.endLine);
|
|
27
|
-
}
|
|
28
|
-
const listItemLineNumbers = new Set();
|
|
29
|
-
if (listItemEmptyLines) {
|
|
30
|
-
for (const listBlock of filterByTypesCached([ "listOrdered", "listUnordered" ])) {
|
|
31
|
-
addRangeToSet(listItemLineNumbers, listBlock.startLine, listBlock.endLine);
|
|
32
|
-
let trailingIndent = true;
|
|
33
|
-
for (let i = listBlock.children.length - 1; i >= 0; i--) {
|
|
34
|
-
const child = listBlock.children[i];
|
|
35
|
-
switch (child.type) {
|
|
36
|
-
case "content":
|
|
37
|
-
trailingIndent = false;
|
|
38
|
-
break;
|
|
39
|
-
case "listItemIndent":
|
|
40
|
-
if (trailingIndent) {
|
|
41
|
-
listItemLineNumbers.delete(child.startLine);
|
|
42
|
-
}
|
|
43
|
-
break;
|
|
44
|
-
case "listItemPrefix":
|
|
45
|
-
trailingIndent = true;
|
|
46
|
-
break;
|
|
47
|
-
default:
|
|
48
|
-
break;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
const paragraphLineNumbers = new Set();
|
|
54
|
-
const codeInlineLineNumbers = new Set();
|
|
55
|
-
if (strict) {
|
|
56
|
-
for (const paragraph of filterByTypesCached([ "paragraph" ])) {
|
|
57
|
-
addRangeToSet(paragraphLineNumbers, paragraph.startLine, paragraph.endLine - 1);
|
|
58
|
-
}
|
|
59
|
-
for (const codeText of filterByTypesCached([ "codeText" ])) {
|
|
60
|
-
addRangeToSet(codeInlineLineNumbers, codeText.startLine, codeText.endLine - 1);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
const expected = (brSpaces < 2) ? 0 : brSpaces;
|
|
64
|
-
for (let lineIndex = 0; lineIndex < params.lines.length; lineIndex++) {
|
|
65
|
-
const line = params.lines[lineIndex];
|
|
66
|
-
const lineNumber = lineIndex + 1;
|
|
67
|
-
const trailingSpaces = line.length - line.trimEnd().length;
|
|
68
|
-
if (
|
|
69
|
-
trailingSpaces &&
|
|
70
|
-
!codeBlockLineNumbers.has(lineNumber) &&
|
|
71
|
-
!listItemLineNumbers.has(lineNumber) &&
|
|
72
|
-
(
|
|
73
|
-
(expected !== trailingSpaces) ||
|
|
74
|
-
(strict &&
|
|
75
|
-
(!paragraphLineNumbers.has(lineNumber) ||
|
|
76
|
-
codeInlineLineNumbers.has(lineNumber)))
|
|
77
|
-
)
|
|
78
|
-
) {
|
|
79
|
-
const column = line.length - trailingSpaces + 1;
|
|
80
|
-
addError(
|
|
81
|
-
onError,
|
|
82
|
-
lineNumber,
|
|
83
|
-
"Expected: " + (expected === 0 ? "" : "0 or ") +
|
|
84
|
-
expected + "; Actual: " + trailingSpaces,
|
|
85
|
-
undefined,
|
|
86
|
-
[ column, trailingSpaces ],
|
|
87
|
-
{
|
|
88
|
-
"editColumn": column,
|
|
89
|
-
"deleteCount": trailingSpaces
|
|
90
|
-
}
|
|
91
|
-
);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
};
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
|
|
3
|
-
"use strict";
|
|
4
|
-
|
|
5
|
-
const { addError, withinAnyRange } = require("../helpers");
|
|
6
|
-
const { getDescendantsByType, getExclusionsForToken } = require("../helpers/micromark.cjs");
|
|
7
|
-
const { filterByTypesCached } = require("./cache");
|
|
8
|
-
|
|
9
|
-
const tabRe = /\t+/g;
|
|
10
|
-
|
|
11
|
-
// eslint-disable-next-line jsdoc/valid-types
|
|
12
|
-
/** @type import("./markdownlint").Rule */
|
|
13
|
-
module.exports = {
|
|
14
|
-
"names": [ "MD010", "no-hard-tabs" ],
|
|
15
|
-
"description": "Hard tabs",
|
|
16
|
-
"tags": [ "whitespace", "hard_tab" ],
|
|
17
|
-
"parser": "micromark",
|
|
18
|
-
"function": function MD010(params, onError) {
|
|
19
|
-
const codeBlocks = params.config.code_blocks;
|
|
20
|
-
const includeCode = (codeBlocks === undefined) ? true : !!codeBlocks;
|
|
21
|
-
const ignoreCodeLanguages = new Set(
|
|
22
|
-
(params.config.ignore_code_languages || [])
|
|
23
|
-
.map((language) => language.toLowerCase())
|
|
24
|
-
);
|
|
25
|
-
const spacesPerTab = params.config.spaces_per_tab;
|
|
26
|
-
const spaceMultiplier = (spacesPerTab === undefined) ?
|
|
27
|
-
1 :
|
|
28
|
-
Math.max(0, Number(spacesPerTab));
|
|
29
|
-
const exclusions = [];
|
|
30
|
-
// eslint-disable-next-line jsdoc/valid-types
|
|
31
|
-
/** @type import("../helpers/micromark.cjs").TokenType[] */
|
|
32
|
-
const exclusionTypes = [];
|
|
33
|
-
if (includeCode) {
|
|
34
|
-
if (ignoreCodeLanguages.size > 0) {
|
|
35
|
-
exclusionTypes.push("codeFenced");
|
|
36
|
-
}
|
|
37
|
-
} else {
|
|
38
|
-
exclusionTypes.push("codeFenced", "codeIndented", "codeText");
|
|
39
|
-
}
|
|
40
|
-
const codeTokens = filterByTypesCached(exclusionTypes).filter((token) => {
|
|
41
|
-
if ((token.type === "codeFenced") && (ignoreCodeLanguages.size > 0)) {
|
|
42
|
-
const fenceInfos = getDescendantsByType(token, [ "codeFencedFence", "codeFencedFenceInfo" ]);
|
|
43
|
-
return fenceInfos.every((fenceInfo) => ignoreCodeLanguages.has(fenceInfo.text.toLowerCase()));
|
|
44
|
-
}
|
|
45
|
-
return true;
|
|
46
|
-
});
|
|
47
|
-
for (const codeToken of codeTokens) {
|
|
48
|
-
const exclusionsForToken = getExclusionsForToken(params.lines, codeToken);
|
|
49
|
-
if (codeToken.type === "codeFenced") {
|
|
50
|
-
exclusionsForToken.pop();
|
|
51
|
-
exclusionsForToken.shift();
|
|
52
|
-
}
|
|
53
|
-
exclusions.push(...exclusionsForToken);
|
|
54
|
-
}
|
|
55
|
-
for (let lineIndex = 0; lineIndex < params.lines.length; lineIndex++) {
|
|
56
|
-
const line = params.lines[lineIndex];
|
|
57
|
-
let match = null;
|
|
58
|
-
while ((match = tabRe.exec(line)) !== null) {
|
|
59
|
-
const column = match.index + 1;
|
|
60
|
-
const length = match[0].length;
|
|
61
|
-
if (!withinAnyRange(exclusions, lineIndex + 1, column, length)) {
|
|
62
|
-
addError(
|
|
63
|
-
onError,
|
|
64
|
-
lineIndex + 1,
|
|
65
|
-
"Column: " + column,
|
|
66
|
-
undefined,
|
|
67
|
-
[ column, length ],
|
|
68
|
-
{
|
|
69
|
-
"editColumn": column,
|
|
70
|
-
"deleteCount": length,
|
|
71
|
-
"insertText": "".padEnd(length * spaceMultiplier)
|
|
72
|
-
}
|
|
73
|
-
);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
};
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
|
|
3
|
-
"use strict";
|
|
4
|
-
|
|
5
|
-
const { addError, withinAnyRange } = require("../helpers");
|
|
6
|
-
const { addRangeToSet, getExclusionsForToken } = require("../helpers/micromark.cjs");
|
|
7
|
-
const { filterByTypesCached } = require("./cache");
|
|
8
|
-
|
|
9
|
-
const reversedLinkRe =
|
|
10
|
-
/(^|[^\\])\(([^()]+)\)\[([^\]^][^\]]*)\](?!\()/g;
|
|
11
|
-
|
|
12
|
-
// eslint-disable-next-line jsdoc/valid-types
|
|
13
|
-
/** @type import("./markdownlint").Rule */
|
|
14
|
-
module.exports = {
|
|
15
|
-
"names": [ "MD011", "no-reversed-links" ],
|
|
16
|
-
"description": "Reversed link syntax",
|
|
17
|
-
"tags": [ "links" ],
|
|
18
|
-
"parser": "micromark",
|
|
19
|
-
"function": function MD011(params, onError) {
|
|
20
|
-
const codeBlockLineNumbers = new Set();
|
|
21
|
-
for (const codeBlock of filterByTypesCached([ "codeFenced", "codeIndented" ])) {
|
|
22
|
-
addRangeToSet(codeBlockLineNumbers, codeBlock.startLine, codeBlock.endLine);
|
|
23
|
-
}
|
|
24
|
-
const exclusions = [];
|
|
25
|
-
for (const codeText of filterByTypesCached([ "codeText" ])) {
|
|
26
|
-
exclusions.push(...getExclusionsForToken(params.lines, codeText));
|
|
27
|
-
}
|
|
28
|
-
for (const [ lineIndex, line ] of params.lines.entries()) {
|
|
29
|
-
if (!codeBlockLineNumbers.has(lineIndex + 1)) {
|
|
30
|
-
let match = null;
|
|
31
|
-
while ((match = reversedLinkRe.exec(line)) !== null) {
|
|
32
|
-
const [ reversedLink, preChar, linkText, linkDestination ] = match;
|
|
33
|
-
const index = match.index + preChar.length;
|
|
34
|
-
const length = match[0].length - preChar.length;
|
|
35
|
-
if (
|
|
36
|
-
!linkText.endsWith("\\") &&
|
|
37
|
-
!linkDestination.endsWith("\\") &&
|
|
38
|
-
!withinAnyRange(exclusions, lineIndex + 1, index, length)
|
|
39
|
-
) {
|
|
40
|
-
addError(
|
|
41
|
-
onError,
|
|
42
|
-
lineIndex + 1,
|
|
43
|
-
reversedLink.slice(preChar.length),
|
|
44
|
-
undefined,
|
|
45
|
-
[ index + 1, length ],
|
|
46
|
-
{
|
|
47
|
-
"editColumn": index + 1,
|
|
48
|
-
"deleteCount": length,
|
|
49
|
-
"insertText": `[${linkText}](${linkDestination})`
|
|
50
|
-
}
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
|
|
3
|
-
"use strict";
|
|
4
|
-
|
|
5
|
-
const { addErrorDetailIf } = 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": [ "MD012", "no-multiple-blanks" ],
|
|
13
|
-
"description": "Multiple consecutive blank lines",
|
|
14
|
-
"tags": [ "whitespace", "blank_lines" ],
|
|
15
|
-
"parser": "micromark",
|
|
16
|
-
"function": function MD012(params, onError) {
|
|
17
|
-
const maximum = Number(params.config.maximum || 1);
|
|
18
|
-
const { lines } = params;
|
|
19
|
-
const codeBlockLineNumbers = new Set();
|
|
20
|
-
for (const codeBlock of filterByTypesCached([ "codeFenced", "codeIndented" ])) {
|
|
21
|
-
addRangeToSet(codeBlockLineNumbers, codeBlock.startLine, codeBlock.endLine);
|
|
22
|
-
}
|
|
23
|
-
let count = 0;
|
|
24
|
-
for (const [ lineIndex, line ] of lines.entries()) {
|
|
25
|
-
const inCode = codeBlockLineNumbers.has(lineIndex + 1);
|
|
26
|
-
count = (inCode || (line.trim().length > 0)) ? 0 : count + 1;
|
|
27
|
-
if (maximum < count) {
|
|
28
|
-
addErrorDetailIf(
|
|
29
|
-
onError,
|
|
30
|
-
lineIndex + 1,
|
|
31
|
-
maximum,
|
|
32
|
-
count,
|
|
33
|
-
undefined,
|
|
34
|
-
undefined,
|
|
35
|
-
undefined,
|
|
36
|
-
{
|
|
37
|
-
"deleteCount": -1
|
|
38
|
-
}
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
};
|