@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,42 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
|
|
3
|
-
"use strict";
|
|
4
|
-
|
|
5
|
-
const { addError } = require("../helpers");
|
|
6
|
-
const { filterByTypesCached } = require("./cache");
|
|
7
|
-
|
|
8
|
-
const ignoreTypes = new Set([ "lineEnding", "listItemIndent", "linePrefix" ]);
|
|
9
|
-
|
|
10
|
-
// eslint-disable-next-line jsdoc/valid-types
|
|
11
|
-
/** @type import("./markdownlint").Rule */
|
|
12
|
-
module.exports = {
|
|
13
|
-
"names": [ "MD028", "no-blanks-blockquote" ],
|
|
14
|
-
"description": "Blank line inside blockquote",
|
|
15
|
-
"tags": [ "blockquote", "whitespace" ],
|
|
16
|
-
"parser": "micromark",
|
|
17
|
-
"function": function MD028(params, onError) {
|
|
18
|
-
for (const token of filterByTypesCached([ "blockQuote" ])) {
|
|
19
|
-
const errorLineNumbers = [];
|
|
20
|
-
const siblings = token.parent?.children || params.parsers.micromark.tokens;
|
|
21
|
-
for (let i = siblings.indexOf(token) + 1; i < siblings.length; i++) {
|
|
22
|
-
const sibling = siblings[i];
|
|
23
|
-
const { startLine, type } = sibling;
|
|
24
|
-
if (type === "lineEndingBlank") {
|
|
25
|
-
// Possible blank between blockquotes
|
|
26
|
-
errorLineNumbers.push(startLine);
|
|
27
|
-
} else if (ignoreTypes.has(type)) {
|
|
28
|
-
// Ignore invisible formatting
|
|
29
|
-
} else if (type === "blockQuote") {
|
|
30
|
-
// Blockquote followed by blockquote
|
|
31
|
-
for (const lineNumber of errorLineNumbers) {
|
|
32
|
-
addError(onError, lineNumber);
|
|
33
|
-
}
|
|
34
|
-
break;
|
|
35
|
-
} else {
|
|
36
|
-
// Blockquote not followed by blockquote
|
|
37
|
-
break;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
};
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
|
|
3
|
-
"use strict";
|
|
4
|
-
|
|
5
|
-
const { addErrorDetailIf } = require("../helpers");
|
|
6
|
-
const { getDescendantsByType, getTokenTextByType } = require("../helpers/micromark.cjs");
|
|
7
|
-
const { filterByTypesCached } = require("./cache");
|
|
8
|
-
|
|
9
|
-
const listStyleExamples = {
|
|
10
|
-
"one": "1/1/1",
|
|
11
|
-
"ordered": "1/2/3",
|
|
12
|
-
"zero": "0/0/0"
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Gets the value of an ordered list item prefix token.
|
|
17
|
-
*
|
|
18
|
-
* @param {import("../helpers/micromark.cjs").Token} listItemPrefix List item prefix token.
|
|
19
|
-
* @returns {number} List item value.
|
|
20
|
-
*/
|
|
21
|
-
function getOrderedListItemValue(listItemPrefix) {
|
|
22
|
-
return Number(getTokenTextByType(listItemPrefix.children, "listItemValue"));
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// eslint-disable-next-line jsdoc/valid-types
|
|
26
|
-
/** @type import("./markdownlint").Rule */
|
|
27
|
-
module.exports = {
|
|
28
|
-
"names": [ "MD029", "ol-prefix" ],
|
|
29
|
-
"description": "Ordered list item prefix",
|
|
30
|
-
"tags": [ "ol" ],
|
|
31
|
-
"parser": "micromark",
|
|
32
|
-
"function": function MD029(params, onError) {
|
|
33
|
-
const style = String(params.config.style || "one_or_ordered");
|
|
34
|
-
for (const listOrdered of filterByTypesCached([ "listOrdered" ])) {
|
|
35
|
-
const listItemPrefixes = getDescendantsByType(listOrdered, [ "listItemPrefix" ]);
|
|
36
|
-
let expected = 1;
|
|
37
|
-
let incrementing = false;
|
|
38
|
-
// Check for incrementing number pattern 1/2/3 or 0/1/2
|
|
39
|
-
if (listItemPrefixes.length >= 2) {
|
|
40
|
-
const firstValue = getOrderedListItemValue(listItemPrefixes[0]);
|
|
41
|
-
const secondValue = getOrderedListItemValue(listItemPrefixes[1]);
|
|
42
|
-
if ((secondValue !== 1) || (firstValue === 0)) {
|
|
43
|
-
incrementing = true;
|
|
44
|
-
if (firstValue === 0) {
|
|
45
|
-
expected = 0;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
// Determine effective style
|
|
50
|
-
let listStyle = style;
|
|
51
|
-
if (listStyle === "one_or_ordered") {
|
|
52
|
-
listStyle = incrementing ? "ordered" : "one";
|
|
53
|
-
} else if (listStyle === "zero") {
|
|
54
|
-
expected = 0;
|
|
55
|
-
} else if (listStyle === "one") {
|
|
56
|
-
expected = 1;
|
|
57
|
-
}
|
|
58
|
-
// Validate each list item marker
|
|
59
|
-
for (const listItemPrefix of listItemPrefixes) {
|
|
60
|
-
const actual = getOrderedListItemValue(listItemPrefix);
|
|
61
|
-
addErrorDetailIf(
|
|
62
|
-
onError,
|
|
63
|
-
listItemPrefix.startLine,
|
|
64
|
-
expected,
|
|
65
|
-
actual,
|
|
66
|
-
"Style: " + listStyleExamples[listStyle],
|
|
67
|
-
undefined,
|
|
68
|
-
[ listItemPrefix.startColumn, listItemPrefix.endColumn - listItemPrefix.startColumn ]
|
|
69
|
-
);
|
|
70
|
-
if (listStyle === "ordered") {
|
|
71
|
-
expected++;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
};
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
|
|
3
|
-
"use strict";
|
|
4
|
-
|
|
5
|
-
const { 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": [ "MD030", "list-marker-space" ],
|
|
12
|
-
"description": "Spaces after list markers",
|
|
13
|
-
"tags": [ "ol", "ul", "whitespace" ],
|
|
14
|
-
"parser": "micromark",
|
|
15
|
-
"function": function MD030(params, onError) {
|
|
16
|
-
const ulSingle = Number(params.config.ul_single || 1);
|
|
17
|
-
const olSingle = Number(params.config.ol_single || 1);
|
|
18
|
-
const ulMulti = Number(params.config.ul_multi || 1);
|
|
19
|
-
const olMulti = Number(params.config.ol_multi || 1);
|
|
20
|
-
for (const list of filterByTypesCached([ "listOrdered", "listUnordered" ])) {
|
|
21
|
-
const ordered = (list.type === "listOrdered");
|
|
22
|
-
const listItemPrefixes =
|
|
23
|
-
list.children.filter((token) => (token.type === "listItemPrefix"));
|
|
24
|
-
const allSingleLine =
|
|
25
|
-
(list.endLine - list.startLine + 1) === listItemPrefixes.length;
|
|
26
|
-
const expectedSpaces = ordered ?
|
|
27
|
-
(allSingleLine ? olSingle : olMulti) :
|
|
28
|
-
(allSingleLine ? ulSingle : ulMulti);
|
|
29
|
-
for (const listItemPrefix of listItemPrefixes) {
|
|
30
|
-
const range = [
|
|
31
|
-
listItemPrefix.startColumn,
|
|
32
|
-
listItemPrefix.endColumn - listItemPrefix.startColumn
|
|
33
|
-
];
|
|
34
|
-
const listItemPrefixWhitespaces = listItemPrefix.children.filter(
|
|
35
|
-
(token) => (token.type === "listItemPrefixWhitespace")
|
|
36
|
-
);
|
|
37
|
-
for (const listItemPrefixWhitespace of listItemPrefixWhitespaces) {
|
|
38
|
-
const { endColumn, startColumn, startLine } =
|
|
39
|
-
listItemPrefixWhitespace;
|
|
40
|
-
const actualSpaces = endColumn - startColumn;
|
|
41
|
-
const fixInfo = {
|
|
42
|
-
"editColumn": startColumn,
|
|
43
|
-
"deleteCount": actualSpaces,
|
|
44
|
-
"insertText": "".padEnd(expectedSpaces)
|
|
45
|
-
};
|
|
46
|
-
addErrorDetailIf(
|
|
47
|
-
onError,
|
|
48
|
-
startLine,
|
|
49
|
-
expectedSpaces,
|
|
50
|
-
actualSpaces,
|
|
51
|
-
undefined,
|
|
52
|
-
undefined,
|
|
53
|
-
range,
|
|
54
|
-
fixInfo
|
|
55
|
-
);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
};
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
|
|
3
|
-
"use strict";
|
|
4
|
-
|
|
5
|
-
const { addErrorContext, isBlankLine } = require("../helpers");
|
|
6
|
-
const { getTokenParentOfType } = require("../helpers/micromark.cjs");
|
|
7
|
-
const { filterByTypesCached } = require("./cache");
|
|
8
|
-
|
|
9
|
-
const codeFencePrefixRe = /^(.*?)[`~]/;
|
|
10
|
-
|
|
11
|
-
// eslint-disable-next-line jsdoc/valid-types
|
|
12
|
-
/** @typedef {readonly string[]} ReadonlyStringArray */
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Adds an error for the top or bottom of a code fence.
|
|
16
|
-
*
|
|
17
|
-
* @param {import("./markdownlint").RuleOnError} onError Error-reporting callback.
|
|
18
|
-
* @param {ReadonlyStringArray} lines Lines of Markdown content.
|
|
19
|
-
* @param {number} lineNumber Line number.
|
|
20
|
-
* @param {boolean} top True iff top fence.
|
|
21
|
-
* @returns {void}
|
|
22
|
-
*/
|
|
23
|
-
function addError(onError, lines, lineNumber, top) {
|
|
24
|
-
const line = lines[lineNumber - 1];
|
|
25
|
-
const [ , prefix ] = line.match(codeFencePrefixRe) || [];
|
|
26
|
-
const fixInfo = (prefix === undefined) ? null : {
|
|
27
|
-
"lineNumber": lineNumber + (top ? 0 : 1),
|
|
28
|
-
"insertText": `${prefix.replace(/[^>]/g, " ").trim()}\n`
|
|
29
|
-
};
|
|
30
|
-
addErrorContext(
|
|
31
|
-
onError,
|
|
32
|
-
lineNumber,
|
|
33
|
-
line.trim(),
|
|
34
|
-
undefined,
|
|
35
|
-
undefined,
|
|
36
|
-
undefined,
|
|
37
|
-
fixInfo
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// eslint-disable-next-line jsdoc/valid-types
|
|
42
|
-
/** @type import("./markdownlint").Rule */
|
|
43
|
-
module.exports = {
|
|
44
|
-
"names": [ "MD031", "blanks-around-fences" ],
|
|
45
|
-
"description": "Fenced code blocks should be surrounded by blank lines",
|
|
46
|
-
"tags": [ "code", "blank_lines" ],
|
|
47
|
-
"parser": "micromark",
|
|
48
|
-
"function": function MD031(params, onError) {
|
|
49
|
-
const listItems = params.config.list_items;
|
|
50
|
-
const includeListItems = (listItems === undefined) ? true : !!listItems;
|
|
51
|
-
const { lines } = params;
|
|
52
|
-
for (const codeBlock of filterByTypesCached([ "codeFenced" ])) {
|
|
53
|
-
if (includeListItems || !(getTokenParentOfType(codeBlock, [ "listOrdered", "listUnordered" ]))) {
|
|
54
|
-
if (!isBlankLine(lines[codeBlock.startLine - 2])) {
|
|
55
|
-
addError(onError, lines, codeBlock.startLine, true);
|
|
56
|
-
}
|
|
57
|
-
if (!isBlankLine(lines[codeBlock.endLine]) && !isBlankLine(lines[codeBlock.endLine - 1])) {
|
|
58
|
-
addError(onError, lines, codeBlock.endLine, false);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
};
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
|
|
3
|
-
"use strict";
|
|
4
|
-
|
|
5
|
-
const { addErrorContextForLine, isBlankLine } = require("../helpers");
|
|
6
|
-
const { filterByPredicate, nonContentTokens } = require("../helpers/micromark.cjs");
|
|
7
|
-
|
|
8
|
-
const isList = (token) => (
|
|
9
|
-
(token.type === "listOrdered") || (token.type === "listUnordered")
|
|
10
|
-
);
|
|
11
|
-
|
|
12
|
-
// eslint-disable-next-line jsdoc/valid-types
|
|
13
|
-
/** @type import("./markdownlint").Rule */
|
|
14
|
-
module.exports = {
|
|
15
|
-
"names": [ "MD032", "blanks-around-lists" ],
|
|
16
|
-
"description": "Lists should be surrounded by blank lines",
|
|
17
|
-
"tags": [ "bullet", "ul", "ol", "blank_lines" ],
|
|
18
|
-
"parser": "micromark",
|
|
19
|
-
"function": function MD032(params, onError) {
|
|
20
|
-
const { lines, parsers } = params;
|
|
21
|
-
|
|
22
|
-
// For every top-level list...
|
|
23
|
-
const topLevelLists = filterByPredicate(
|
|
24
|
-
parsers.micromark.tokens,
|
|
25
|
-
isList,
|
|
26
|
-
(token) => (
|
|
27
|
-
(isList(token) || (token.type === "htmlFlow")) ? [] : token.children
|
|
28
|
-
)
|
|
29
|
-
);
|
|
30
|
-
for (const list of topLevelLists) {
|
|
31
|
-
|
|
32
|
-
// Look for a blank line above the list
|
|
33
|
-
const firstIndex = list.startLine - 1;
|
|
34
|
-
if (!isBlankLine(lines[firstIndex - 1])) {
|
|
35
|
-
addErrorContextForLine(
|
|
36
|
-
onError,
|
|
37
|
-
// @ts-ignore
|
|
38
|
-
lines,
|
|
39
|
-
firstIndex
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// Find the "visual" end of the list
|
|
44
|
-
let endLine = list.endLine;
|
|
45
|
-
const flattenedChildren = filterByPredicate(list.children);
|
|
46
|
-
for (const child of flattenedChildren.reverse()) {
|
|
47
|
-
if (!nonContentTokens.has(child.type)) {
|
|
48
|
-
endLine = child.endLine;
|
|
49
|
-
break;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// Look for a blank line below the list
|
|
54
|
-
const lastIndex = endLine - 1;
|
|
55
|
-
if (!isBlankLine(lines[lastIndex + 1])) {
|
|
56
|
-
addErrorContextForLine(
|
|
57
|
-
onError,
|
|
58
|
-
// @ts-ignore
|
|
59
|
-
lines,
|
|
60
|
-
lastIndex,
|
|
61
|
-
lastIndex + 2
|
|
62
|
-
);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
|
|
3
|
-
"use strict";
|
|
4
|
-
|
|
5
|
-
const { addError, nextLinesRe } = require("../helpers");
|
|
6
|
-
const { getHtmlTagInfo } = 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": [ "MD033", "no-inline-html" ],
|
|
13
|
-
"description": "Inline HTML",
|
|
14
|
-
"tags": [ "html" ],
|
|
15
|
-
"parser": "micromark",
|
|
16
|
-
"function": function MD033(params, onError) {
|
|
17
|
-
let allowedElements = params.config.allowed_elements;
|
|
18
|
-
allowedElements = Array.isArray(allowedElements) ? allowedElements : [];
|
|
19
|
-
allowedElements = allowedElements.map((element) => element.toLowerCase());
|
|
20
|
-
for (const token of filterByTypesCached([ "htmlText" ], true)) {
|
|
21
|
-
const htmlTagInfo = getHtmlTagInfo(token);
|
|
22
|
-
if (
|
|
23
|
-
htmlTagInfo &&
|
|
24
|
-
!htmlTagInfo.close &&
|
|
25
|
-
!allowedElements.includes(htmlTagInfo.name.toLowerCase())
|
|
26
|
-
) {
|
|
27
|
-
const range = [
|
|
28
|
-
token.startColumn,
|
|
29
|
-
token.text.replace(nextLinesRe, "").length
|
|
30
|
-
];
|
|
31
|
-
addError(
|
|
32
|
-
onError,
|
|
33
|
-
token.startLine,
|
|
34
|
-
"Element: " + htmlTagInfo.name,
|
|
35
|
-
undefined,
|
|
36
|
-
range
|
|
37
|
-
);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
};
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
|
|
3
|
-
"use strict";
|
|
4
|
-
|
|
5
|
-
const { addErrorContext } = require("../helpers");
|
|
6
|
-
const { filterByPredicate, getHtmlTagInfo, inHtmlFlow, parse } = 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": [ "MD034", "no-bare-urls" ],
|
|
13
|
-
"description": "Bare URL used",
|
|
14
|
-
"tags": [ "links", "url" ],
|
|
15
|
-
"parser": "micromark",
|
|
16
|
-
"function": function MD034(params, onError) {
|
|
17
|
-
const literalAutolinks = (tokens) => (
|
|
18
|
-
filterByPredicate(
|
|
19
|
-
tokens,
|
|
20
|
-
(token) => {
|
|
21
|
-
if ((token.type === "literalAutolink") && !inHtmlFlow(token)) {
|
|
22
|
-
// Detect and ignore https://github.com/micromark/micromark/issues/164
|
|
23
|
-
const siblings = token.parent?.children;
|
|
24
|
-
// Commented-out due to not being able to exercise in test/code coverage
|
|
25
|
-
// || micromarkTokens;
|
|
26
|
-
const index = siblings?.indexOf(token);
|
|
27
|
-
// @ts-ignore
|
|
28
|
-
const prev = siblings?.at(index - 1);
|
|
29
|
-
// @ts-ignore
|
|
30
|
-
const next = siblings?.at(index + 1);
|
|
31
|
-
return !(
|
|
32
|
-
prev &&
|
|
33
|
-
next &&
|
|
34
|
-
(prev.type === "data") &&
|
|
35
|
-
(next.type === "data") &&
|
|
36
|
-
prev.text.endsWith("<") &&
|
|
37
|
-
next.text.startsWith(">")
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
return false;
|
|
41
|
-
},
|
|
42
|
-
(token) => {
|
|
43
|
-
const { children } = token;
|
|
44
|
-
const result = [];
|
|
45
|
-
for (let i = 0; i < children.length; i++) {
|
|
46
|
-
const current = children[i];
|
|
47
|
-
const openTagInfo = getHtmlTagInfo(current);
|
|
48
|
-
if (openTagInfo && !openTagInfo.close) {
|
|
49
|
-
let count = 1;
|
|
50
|
-
for (let j = i + 1; j < children.length; j++) {
|
|
51
|
-
const candidate = children[j];
|
|
52
|
-
const closeTagInfo = getHtmlTagInfo(candidate);
|
|
53
|
-
if (closeTagInfo && (openTagInfo.name === closeTagInfo.name)) {
|
|
54
|
-
if (closeTagInfo.close) {
|
|
55
|
-
count--;
|
|
56
|
-
if (count === 0) {
|
|
57
|
-
i = j;
|
|
58
|
-
break;
|
|
59
|
-
}
|
|
60
|
-
} else {
|
|
61
|
-
count++;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
} else {
|
|
66
|
-
result.push(current);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
return result;
|
|
70
|
-
}
|
|
71
|
-
)
|
|
72
|
-
);
|
|
73
|
-
const autoLinks = filterByTypesCached([ "literalAutolink" ]);
|
|
74
|
-
if (autoLinks.length > 0) {
|
|
75
|
-
// Re-parse with correct link/image reference definition handling
|
|
76
|
-
const document = params.lines.join("\n");
|
|
77
|
-
const tokens = parse(document, undefined, false);
|
|
78
|
-
for (const token of literalAutolinks(tokens)) {
|
|
79
|
-
const range = [
|
|
80
|
-
token.startColumn,
|
|
81
|
-
token.endColumn - token.startColumn
|
|
82
|
-
];
|
|
83
|
-
const fixInfo = {
|
|
84
|
-
"editColumn": range[0],
|
|
85
|
-
"deleteCount": range[1],
|
|
86
|
-
"insertText": `<${token.text}>`
|
|
87
|
-
};
|
|
88
|
-
addErrorContext(
|
|
89
|
-
onError,
|
|
90
|
-
token.startLine,
|
|
91
|
-
token.text,
|
|
92
|
-
undefined,
|
|
93
|
-
undefined,
|
|
94
|
-
range,
|
|
95
|
-
fixInfo
|
|
96
|
-
);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
|
|
3
|
-
"use strict";
|
|
4
|
-
|
|
5
|
-
const { 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": [ "MD035", "hr-style" ],
|
|
12
|
-
"description": "Horizontal rule style",
|
|
13
|
-
"tags": [ "hr" ],
|
|
14
|
-
"parser": "micromark",
|
|
15
|
-
"function": function MD035(params, onError) {
|
|
16
|
-
let style = String(params.config.style || "consistent").trim();
|
|
17
|
-
const thematicBreaks = filterByTypesCached([ "thematicBreak" ]);
|
|
18
|
-
for (const token of thematicBreaks) {
|
|
19
|
-
const { startLine, text } = token;
|
|
20
|
-
if (style === "consistent") {
|
|
21
|
-
style = text;
|
|
22
|
-
}
|
|
23
|
-
addErrorDetailIf(onError, startLine, style, text);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
|
|
3
|
-
"use strict";
|
|
4
|
-
|
|
5
|
-
const { addErrorContext, allPunctuation } = require("../helpers");
|
|
6
|
-
const { matchAndGetTokensByType } = require("../helpers/micromark.cjs");
|
|
7
|
-
const { filterByTypesCached } = require("./cache");
|
|
8
|
-
|
|
9
|
-
/** @typedef {import("../helpers/micromark.cjs").TokenType} TokenType */
|
|
10
|
-
/** @type {Map<TokenType, TokenType[]>} */
|
|
11
|
-
const emphasisAndChildrenTypes = new Map([
|
|
12
|
-
[ "emphasis", [ "emphasisSequence", "emphasisText", "emphasisSequence" ] ],
|
|
13
|
-
[ "strong", [ "strongSequence", "strongText", "strongSequence" ] ]
|
|
14
|
-
]);
|
|
15
|
-
|
|
16
|
-
// eslint-disable-next-line jsdoc/valid-types
|
|
17
|
-
/** @type import("./markdownlint").Rule */
|
|
18
|
-
module.exports = {
|
|
19
|
-
"names": [ "MD036", "no-emphasis-as-heading" ],
|
|
20
|
-
"description": "Emphasis used instead of a heading",
|
|
21
|
-
"tags": [ "headings", "emphasis" ],
|
|
22
|
-
"parser": "micromark",
|
|
23
|
-
"function": function MD036(params, onError) {
|
|
24
|
-
let punctuation = params.config.punctuation;
|
|
25
|
-
punctuation = String((punctuation === undefined) ? allPunctuation : punctuation);
|
|
26
|
-
const punctuationRe = new RegExp("[" + punctuation + "]$");
|
|
27
|
-
const paragraphTokens =
|
|
28
|
-
filterByTypesCached([ "paragraph" ]).
|
|
29
|
-
filter((token) =>
|
|
30
|
-
(token.parent?.type === "content") && !token.parent?.parent && (token.children.length === 1)
|
|
31
|
-
);
|
|
32
|
-
for (const paragraphToken of paragraphTokens) {
|
|
33
|
-
const childToken = paragraphToken.children[0];
|
|
34
|
-
for (const [ emphasisType, emphasisChildrenTypes ] of emphasisAndChildrenTypes) {
|
|
35
|
-
if (childToken.type === emphasisType) {
|
|
36
|
-
const matchingTokens = matchAndGetTokensByType(childToken.children, emphasisChildrenTypes);
|
|
37
|
-
if (matchingTokens) {
|
|
38
|
-
const textToken = matchingTokens[1];
|
|
39
|
-
if (
|
|
40
|
-
(textToken.children.length === 1) &&
|
|
41
|
-
(textToken.children[0].type === "data") &&
|
|
42
|
-
!punctuationRe.test(textToken.text)
|
|
43
|
-
) {
|
|
44
|
-
addErrorContext(onError, textToken.startLine, textToken.text);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
};
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
|
|
3
|
-
"use strict";
|
|
4
|
-
|
|
5
|
-
const { addError } = require("../helpers");
|
|
6
|
-
const { filterByPredicate, inHtmlFlow } = require("../helpers/micromark.cjs");
|
|
7
|
-
|
|
8
|
-
// eslint-disable-next-line jsdoc/valid-types
|
|
9
|
-
/** @type import("./markdownlint").Rule */
|
|
10
|
-
module.exports = {
|
|
11
|
-
"names": [ "MD037", "no-space-in-emphasis" ],
|
|
12
|
-
"description": "Spaces inside emphasis markers",
|
|
13
|
-
"tags": [ "whitespace", "emphasis" ],
|
|
14
|
-
"parser": "micromark",
|
|
15
|
-
"function": function MD037(params, onError) {
|
|
16
|
-
|
|
17
|
-
// Initialize variables
|
|
18
|
-
const { lines, parsers } = params;
|
|
19
|
-
const emphasisTokensByMarker = new Map();
|
|
20
|
-
for (const marker of [ "_", "__", "___", "*", "**", "***" ]) {
|
|
21
|
-
emphasisTokensByMarker.set(marker, []);
|
|
22
|
-
}
|
|
23
|
-
const tokens = filterByPredicate(
|
|
24
|
-
parsers.micromark.tokens,
|
|
25
|
-
(token) => token.children.some((child) => child.type === "data")
|
|
26
|
-
);
|
|
27
|
-
for (const token of tokens) {
|
|
28
|
-
|
|
29
|
-
// Build lists of bare tokens for each emphasis marker type
|
|
30
|
-
for (const emphasisTokens of emphasisTokensByMarker.values()) {
|
|
31
|
-
emphasisTokens.length = 0;
|
|
32
|
-
}
|
|
33
|
-
for (const child of token.children) {
|
|
34
|
-
const { text, type } = child;
|
|
35
|
-
if ((type === "data") && (text.length <= 3)) {
|
|
36
|
-
const emphasisTokens = emphasisTokensByMarker.get(text);
|
|
37
|
-
if (emphasisTokens && !inHtmlFlow(child)) {
|
|
38
|
-
emphasisTokens.push(child);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// Process bare tokens for each emphasis marker type
|
|
44
|
-
for (const entry of emphasisTokensByMarker.entries()) {
|
|
45
|
-
const [ marker, emphasisTokens ] = entry;
|
|
46
|
-
for (let i = 0; i + 1 < emphasisTokens.length; i += 2) {
|
|
47
|
-
|
|
48
|
-
// Process start token of start/end pair
|
|
49
|
-
const startToken = emphasisTokens[i];
|
|
50
|
-
const startLine = lines[startToken.startLine - 1];
|
|
51
|
-
const startSlice = startLine.slice(startToken.endColumn - 1);
|
|
52
|
-
const startMatch = startSlice.match(/^\s+\S/);
|
|
53
|
-
if (startMatch) {
|
|
54
|
-
const [ startSpaceCharacter ] = startMatch;
|
|
55
|
-
const startContext = `${marker}${startSpaceCharacter}`;
|
|
56
|
-
addError(
|
|
57
|
-
onError,
|
|
58
|
-
startToken.startLine,
|
|
59
|
-
undefined,
|
|
60
|
-
startContext,
|
|
61
|
-
[ startToken.startColumn, startContext.length ],
|
|
62
|
-
{
|
|
63
|
-
"editColumn": startToken.endColumn,
|
|
64
|
-
"deleteCount": startSpaceCharacter.length - 1
|
|
65
|
-
}
|
|
66
|
-
);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// Process end token of start/end pair
|
|
70
|
-
const endToken = emphasisTokens[i + 1];
|
|
71
|
-
const endLine = lines[endToken.startLine - 1];
|
|
72
|
-
const endSlice = endLine.slice(0, endToken.startColumn - 1);
|
|
73
|
-
const endMatch = endSlice.match(/\S\s+$/);
|
|
74
|
-
if (endMatch) {
|
|
75
|
-
const [ endSpaceCharacter ] = endMatch;
|
|
76
|
-
const endContext = `${endSpaceCharacter}${marker}`;
|
|
77
|
-
addError(
|
|
78
|
-
onError,
|
|
79
|
-
endToken.startLine,
|
|
80
|
-
undefined,
|
|
81
|
-
endContext,
|
|
82
|
-
[ endToken.endColumn - endContext.length, endContext.length ],
|
|
83
|
-
{
|
|
84
|
-
"editColumn":
|
|
85
|
-
endToken.startColumn - (endSpaceCharacter.length - 1),
|
|
86
|
-
"deleteCount": endSpaceCharacter.length - 1
|
|
87
|
-
}
|
|
88
|
-
);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
};
|