@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,1047 +0,0 @@
|
|
|
1
|
-
# markdownlint
|
|
2
|
-
|
|
3
|
-
> A Node.js style checker and lint tool for Markdown/CommonMark files.
|
|
4
|
-
|
|
5
|
-
[![npm version][npm-image]][npm-url]
|
|
6
|
-
[![License][license-image]][license-url]
|
|
7
|
-
|
|
8
|
-
## Install
|
|
9
|
-
|
|
10
|
-
```bash
|
|
11
|
-
npm install markdownlint --save-dev
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
## Overview
|
|
15
|
-
|
|
16
|
-
The [Markdown](https://en.wikipedia.org/wiki/Markdown) markup language
|
|
17
|
-
is designed to be easy to read, write, and understand. It succeeds -
|
|
18
|
-
and its flexibility is both a benefit and a drawback. Many styles are
|
|
19
|
-
possible, so formatting can be inconsistent. Some constructs don't
|
|
20
|
-
work well in all parsers and should be avoided. The
|
|
21
|
-
[CommonMark](https://commonmark.org/) specification standardizes
|
|
22
|
-
parsers - but not authors.
|
|
23
|
-
|
|
24
|
-
`markdownlint` is a
|
|
25
|
-
[static analysis](https://en.wikipedia.org/wiki/Static_program_analysis)
|
|
26
|
-
tool for [Node.js](https://nodejs.org/) with a library of rules
|
|
27
|
-
to enforce standards and consistency for Markdown files. It was
|
|
28
|
-
inspired by - and heavily influenced by - Mark Harrison's
|
|
29
|
-
[markdownlint](https://github.com/markdownlint/markdownlint) for
|
|
30
|
-
[Ruby](https://www.ruby-lang.org/). The initial rules, rule documentation,
|
|
31
|
-
and test cases came directly from that project.
|
|
32
|
-
|
|
33
|
-
### Related
|
|
34
|
-
|
|
35
|
-
- CLI
|
|
36
|
-
- [markdownlint-cli][markdownlint-cli] command-line interface for Node.js
|
|
37
|
-
([works with pre-commit][markdownlint-cli-precommit])
|
|
38
|
-
- [markdownlint-cli2][markdownlint-cli2] command-line interface for Node.js
|
|
39
|
-
([works with pre-commit][markdownlint-cli2-precommit])
|
|
40
|
-
- GitHub
|
|
41
|
-
- [GitHub Action for markdownlint-cli2][markdownlint-cli2-action]
|
|
42
|
-
- [GitHub Super-Linter Action][super-linter]
|
|
43
|
-
- [GitHub Actions problem matcher for
|
|
44
|
-
markdownlint-cli][markdownlint-problem-matcher]
|
|
45
|
-
- Editor
|
|
46
|
-
- [vscode-markdownlint extension for VS Code][vscode-markdownlint]
|
|
47
|
-
- [Sublime Text markdownlint for Sublime Text][sublimelinter]
|
|
48
|
-
- [coc-markdownlint extension for Vim/Neovim][coc]
|
|
49
|
-
- Tooling
|
|
50
|
-
- [eslint-plugin-markdownlint for the ESLint analyzer][eslint-plugin]
|
|
51
|
-
- [grunt-markdownlint for the Grunt task runner][grunt-markdownlint]
|
|
52
|
-
- [Cake.Markdownlint addin for Cake build automation system][cake]
|
|
53
|
-
- [Lombiq Node.js Extensions for MSBuild (.NET builds)][nodejs-extensions]
|
|
54
|
-
- Ruby
|
|
55
|
-
- [markdownlint/mdl gem for Ruby][rubygems-mdl]
|
|
56
|
-
|
|
57
|
-
[cake]: https://github.com/cake-contrib/Cake.Markdownlint
|
|
58
|
-
[coc]: https://github.com/fannheyward/coc-markdownlint
|
|
59
|
-
[eslint-plugin]: https://github.com/paweldrozd/eslint-plugin-markdownlint
|
|
60
|
-
[grunt-markdownlint]: https://github.com/sagiegurari/grunt-markdownlint
|
|
61
|
-
[markdownlint-cli]: https://github.com/igorshubovych/markdownlint-cli
|
|
62
|
-
[markdownlint-cli-precommit]: https://github.com/igorshubovych/markdownlint-cli#use-with-pre-commit
|
|
63
|
-
[markdownlint-cli2]: https://github.com/DavidAnson/markdownlint-cli2
|
|
64
|
-
[markdownlint-cli2-action]: https://github.com/marketplace/actions/markdownlint-cli2-action
|
|
65
|
-
[markdownlint-cli2-precommit]: https://github.com/DavidAnson/markdownlint-cli2#pre-commit
|
|
66
|
-
[markdownlint-problem-matcher]: https://github.com/xt0rted/markdownlint-problem-matcher
|
|
67
|
-
[nodejs-extensions]: https://github.com/Lombiq/NodeJs-Extensions
|
|
68
|
-
[rubygems-mdl]: https://rubygems.org/gems/mdl
|
|
69
|
-
[sublimelinter]: https://packagecontrol.io/packages/SublimeLinter-contrib-markdownlint
|
|
70
|
-
[super-linter]: https://github.com/super-linter/super-linter
|
|
71
|
-
[vscode-markdownlint]: https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint
|
|
72
|
-
|
|
73
|
-
### References
|
|
74
|
-
|
|
75
|
-
The following specifications are considered authoritative in cases of ambiguity:
|
|
76
|
-
|
|
77
|
-
- [CommonMark](https://spec.commonmark.org/current/)
|
|
78
|
-
- [GitHub Flavored Markdown Spec](https://github.github.com/gfm/)
|
|
79
|
-
|
|
80
|
-
## Demonstration
|
|
81
|
-
|
|
82
|
-
[`markdownlint` demo](https://dlaa.me/markdownlint/), an interactive, in-browser
|
|
83
|
-
playground for learning and exploring.
|
|
84
|
-
|
|
85
|
-
## Rules / Aliases
|
|
86
|
-
|
|
87
|
-
<!-- markdownlint-disable line-length -->
|
|
88
|
-
|
|
89
|
-
- **[MD001](doc/md001.md)** *heading-increment* - Heading levels should only increment by one level at a time
|
|
90
|
-
- **[MD003](doc/md003.md)** *heading-style* - Heading style
|
|
91
|
-
- **[MD004](doc/md004.md)** *ul-style* - Unordered list style
|
|
92
|
-
- **[MD005](doc/md005.md)** *list-indent* - Inconsistent indentation for list items at the same level
|
|
93
|
-
- **[MD007](doc/md007.md)** *ul-indent* - Unordered list indentation
|
|
94
|
-
- **[MD009](doc/md009.md)** *no-trailing-spaces* - Trailing spaces
|
|
95
|
-
- **[MD010](doc/md010.md)** *no-hard-tabs* - Hard tabs
|
|
96
|
-
- **[MD011](doc/md011.md)** *no-reversed-links* - Reversed link syntax
|
|
97
|
-
- **[MD012](doc/md012.md)** *no-multiple-blanks* - Multiple consecutive blank lines
|
|
98
|
-
- **[MD013](doc/md013.md)** *line-length* - Line length
|
|
99
|
-
- **[MD014](doc/md014.md)** *commands-show-output* - Dollar signs used before commands without showing output
|
|
100
|
-
- **[MD018](doc/md018.md)** *no-missing-space-atx* - No space after hash on atx style heading
|
|
101
|
-
- **[MD019](doc/md019.md)** *no-multiple-space-atx* - Multiple spaces after hash on atx style heading
|
|
102
|
-
- **[MD020](doc/md020.md)** *no-missing-space-closed-atx* - No space inside hashes on closed atx style heading
|
|
103
|
-
- **[MD021](doc/md021.md)** *no-multiple-space-closed-atx* - Multiple spaces inside hashes on closed atx style heading
|
|
104
|
-
- **[MD022](doc/md022.md)** *blanks-around-headings* - Headings should be surrounded by blank lines
|
|
105
|
-
- **[MD023](doc/md023.md)** *heading-start-left* - Headings must start at the beginning of the line
|
|
106
|
-
- **[MD024](doc/md024.md)** *no-duplicate-heading* - Multiple headings with the same content
|
|
107
|
-
- **[MD025](doc/md025.md)** *single-title/single-h1* - Multiple top-level headings in the same document
|
|
108
|
-
- **[MD026](doc/md026.md)** *no-trailing-punctuation* - Trailing punctuation in heading
|
|
109
|
-
- **[MD027](doc/md027.md)** *no-multiple-space-blockquote* - Multiple spaces after blockquote symbol
|
|
110
|
-
- **[MD028](doc/md028.md)** *no-blanks-blockquote* - Blank line inside blockquote
|
|
111
|
-
- **[MD029](doc/md029.md)** *ol-prefix* - Ordered list item prefix
|
|
112
|
-
- **[MD030](doc/md030.md)** *list-marker-space* - Spaces after list markers
|
|
113
|
-
- **[MD031](doc/md031.md)** *blanks-around-fences* - Fenced code blocks should be surrounded by blank lines
|
|
114
|
-
- **[MD032](doc/md032.md)** *blanks-around-lists* - Lists should be surrounded by blank lines
|
|
115
|
-
- **[MD033](doc/md033.md)** *no-inline-html* - Inline HTML
|
|
116
|
-
- **[MD034](doc/md034.md)** *no-bare-urls* - Bare URL used
|
|
117
|
-
- **[MD035](doc/md035.md)** *hr-style* - Horizontal rule style
|
|
118
|
-
- **[MD036](doc/md036.md)** *no-emphasis-as-heading* - Emphasis used instead of a heading
|
|
119
|
-
- **[MD037](doc/md037.md)** *no-space-in-emphasis* - Spaces inside emphasis markers
|
|
120
|
-
- **[MD038](doc/md038.md)** *no-space-in-code* - Spaces inside code span elements
|
|
121
|
-
- **[MD039](doc/md039.md)** *no-space-in-links* - Spaces inside link text
|
|
122
|
-
- **[MD040](doc/md040.md)** *fenced-code-language* - Fenced code blocks should have a language specified
|
|
123
|
-
- **[MD041](doc/md041.md)** *first-line-heading/first-line-h1* - First line in a file should be a top-level heading
|
|
124
|
-
- **[MD042](doc/md042.md)** *no-empty-links* - No empty links
|
|
125
|
-
- **[MD043](doc/md043.md)** *required-headings* - Required heading structure
|
|
126
|
-
- **[MD044](doc/md044.md)** *proper-names* - Proper names should have the correct capitalization
|
|
127
|
-
- **[MD045](doc/md045.md)** *no-alt-text* - Images should have alternate text (alt text)
|
|
128
|
-
- **[MD046](doc/md046.md)** *code-block-style* - Code block style
|
|
129
|
-
- **[MD047](doc/md047.md)** *single-trailing-newline* - Files should end with a single newline character
|
|
130
|
-
- **[MD048](doc/md048.md)** *code-fence-style* - Code fence style
|
|
131
|
-
- **[MD049](doc/md049.md)** *emphasis-style* - Emphasis style
|
|
132
|
-
- **[MD050](doc/md050.md)** *strong-style* - Strong style
|
|
133
|
-
- **[MD051](doc/md051.md)** *link-fragments* - Link fragments should be valid
|
|
134
|
-
- **[MD052](doc/md052.md)** *reference-links-images* - Reference links and images should use a label that is defined
|
|
135
|
-
- **[MD053](doc/md053.md)** *link-image-reference-definitions* - Link and image reference definitions should be needed
|
|
136
|
-
- **[MD054](doc/md054.md)** *link-image-style* - Link and image style
|
|
137
|
-
- **[MD055](doc/md055.md)** *table-pipe-style* - Table pipe style
|
|
138
|
-
- **[MD056](doc/md056.md)** *table-column-count* - Table column count
|
|
139
|
-
- **[MD058](doc/md058.md)** *blanks-around-tables* - Tables should be surrounded by blank lines
|
|
140
|
-
|
|
141
|
-
<!-- markdownlint-restore -->
|
|
142
|
-
|
|
143
|
-
See [Rules.md](doc/Rules.md) for more details.
|
|
144
|
-
|
|
145
|
-
### Custom Rules
|
|
146
|
-
|
|
147
|
-
In addition to built-in rules, custom rules can be used to address
|
|
148
|
-
project-specific requirements. To find community-developed rules use
|
|
149
|
-
[keyword `markdownlint-rule` on npm][markdownlint-rule].
|
|
150
|
-
To implement your own rules, refer to [CustomRules.md](doc/CustomRules.md).
|
|
151
|
-
|
|
152
|
-
[markdownlint-rule]: https://www.npmjs.com/search?q=keywords:markdownlint-rule
|
|
153
|
-
|
|
154
|
-
## Tags
|
|
155
|
-
|
|
156
|
-
Tags group related rules and can be used to enable/disable multiple
|
|
157
|
-
rules at once.
|
|
158
|
-
|
|
159
|
-
- **`accessibility`** - `MD045`
|
|
160
|
-
- **`atx`** - `MD018`, `MD019`
|
|
161
|
-
- **`atx_closed`** - `MD020`, `MD021`
|
|
162
|
-
- **`blank_lines`** - `MD012`, `MD022`, `MD031`, `MD032`, `MD047`
|
|
163
|
-
- **`blockquote`** - `MD027`, `MD028`
|
|
164
|
-
- **`bullet`** - `MD004`, `MD005`, `MD007`, `MD032`
|
|
165
|
-
- **`code`** - `MD014`, `MD031`, `MD038`, `MD040`, `MD046`, `MD048`
|
|
166
|
-
- **`emphasis`** - `MD036`, `MD037`, `MD049`, `MD050`
|
|
167
|
-
- **`hard_tab`** - `MD010`
|
|
168
|
-
- **`headings`** - `MD001`, `MD003`, `MD018`, `MD019`, `MD020`, `MD021`,
|
|
169
|
-
`MD022`, `MD023`, `MD024`, `MD025`, `MD026`, `MD036`, `MD041`, `MD043`
|
|
170
|
-
- **`hr`** - `MD035`
|
|
171
|
-
- **`html`** - `MD033`
|
|
172
|
-
- **`images`** - `MD045`, `MD052`, `MD053`, `MD054`
|
|
173
|
-
- **`indentation`** - `MD005`, `MD007`, `MD027`
|
|
174
|
-
- **`language`** - `MD040`
|
|
175
|
-
- **`line_length`** - `MD013`
|
|
176
|
-
- **`links`** - `MD011`, `MD034`, `MD039`, `MD042`, `MD051`, `MD052`, `MD053`,
|
|
177
|
-
`MD054`
|
|
178
|
-
- **`ol`** - `MD029`, `MD030`, `MD032`
|
|
179
|
-
- **`spaces`** - `MD018`, `MD019`, `MD020`, `MD021`, `MD023`
|
|
180
|
-
- **`spelling`** - `MD044`
|
|
181
|
-
- **`table`** - `MD055`, `MD056`, `MD058`
|
|
182
|
-
- **`ul`** - `MD004`, `MD005`, `MD007`, `MD030`, `MD032`
|
|
183
|
-
- **`url`** - `MD034`
|
|
184
|
-
- **`whitespace`** - `MD009`, `MD010`, `MD012`, `MD027`, `MD028`, `MD030`,
|
|
185
|
-
`MD037`, `MD038`, `MD039`
|
|
186
|
-
|
|
187
|
-
## Configuration
|
|
188
|
-
|
|
189
|
-
Text passed to `markdownlint` is parsed as Markdown, analyzed, and any
|
|
190
|
-
issues reported. Two kinds of text are ignored by most rules:
|
|
191
|
-
|
|
192
|
-
- [HTML comments](https://www.w3.org/TR/html5/syntax.html#comments)
|
|
193
|
-
- [Front matter](https://jekyllrb.com/docs/frontmatter/) (see
|
|
194
|
-
`options.frontMatter` below)
|
|
195
|
-
|
|
196
|
-
Rules can be enabled, disabled, and configured via `options.config`
|
|
197
|
-
(described below) to define the expected behavior for a set of inputs.
|
|
198
|
-
To enable or disable rules at a particular location within a file, add
|
|
199
|
-
one of these markers to the appropriate place (HTML comments don't
|
|
200
|
-
appear in the final markup):
|
|
201
|
-
|
|
202
|
-
- Disable all rules: `<!-- markdownlint-disable -->`
|
|
203
|
-
- Enable all rules: `<!-- markdownlint-enable -->`
|
|
204
|
-
- Disable all rules for the current line: `<!-- markdownlint-disable-line -->`
|
|
205
|
-
- Disable all rules for the next line: `<!-- markdownlint-disable-next-line -->`
|
|
206
|
-
- Disable one or more rules by name: `<!-- markdownlint-disable MD001 MD005 -->`
|
|
207
|
-
- Enable one or more rules by name: `<!-- markdownlint-enable MD001 MD005 -->`
|
|
208
|
-
- Disable one or more rules by name for the current line:
|
|
209
|
-
`<!-- markdownlint-disable-line MD001 MD005 -->`
|
|
210
|
-
- Disable one or more rules by name for the next line:
|
|
211
|
-
`<!-- markdownlint-disable-next-line MD001 MD005 -->`
|
|
212
|
-
- Capture the current rule configuration: `<!-- markdownlint-capture -->`
|
|
213
|
-
- Restore the captured rule configuration: `<!-- markdownlint-restore -->`
|
|
214
|
-
|
|
215
|
-
For example:
|
|
216
|
-
|
|
217
|
-
```markdown
|
|
218
|
-
<!-- markdownlint-disable-next-line no-space-in-emphasis -->
|
|
219
|
-
space * in * emphasis
|
|
220
|
-
```
|
|
221
|
-
|
|
222
|
-
Or:
|
|
223
|
-
|
|
224
|
-
```markdown
|
|
225
|
-
space * in * emphasis <!-- markdownlint-disable-line no-space-in-emphasis -->
|
|
226
|
-
```
|
|
227
|
-
|
|
228
|
-
Or:
|
|
229
|
-
|
|
230
|
-
```markdown
|
|
231
|
-
<!-- markdownlint-disable no-space-in-emphasis -->
|
|
232
|
-
space * in * emphasis
|
|
233
|
-
<!-- markdownlint-enable no-space-in-emphasis -->
|
|
234
|
-
```
|
|
235
|
-
|
|
236
|
-
To temporarily disable rule(s), then restore the former configuration:
|
|
237
|
-
|
|
238
|
-
```markdown
|
|
239
|
-
<!-- markdownlint-capture -->
|
|
240
|
-
<!-- markdownlint-disable -->
|
|
241
|
-
any violations you want
|
|
242
|
-
<!-- markdownlint-restore -->
|
|
243
|
-
```
|
|
244
|
-
|
|
245
|
-
The initial configuration is captured by default (as if every document
|
|
246
|
-
began with `<!-- markdownlint-capture -->`), so the pattern above can
|
|
247
|
-
be expressed more simply:
|
|
248
|
-
|
|
249
|
-
```markdown
|
|
250
|
-
<!-- markdownlint-disable -->
|
|
251
|
-
any violations you want
|
|
252
|
-
<!-- markdownlint-restore -->
|
|
253
|
-
```
|
|
254
|
-
|
|
255
|
-
Changes take effect starting with the line a comment is on, so the following
|
|
256
|
-
has no effect:
|
|
257
|
-
|
|
258
|
-
```markdown
|
|
259
|
-
space * in * emphasis <!-- markdownlint-disable --> <!-- markdownlint-enable -->
|
|
260
|
-
```
|
|
261
|
-
|
|
262
|
-
To apply changes to an entire file regardless of where the comment is located,
|
|
263
|
-
the following syntax is supported:
|
|
264
|
-
|
|
265
|
-
- Disable all rules: `<!-- markdownlint-disable-file -->`
|
|
266
|
-
- Enable all rules: `<!-- markdownlint-enable-file -->`
|
|
267
|
-
- Disable one or more rules by name: `<!-- markdownlint-disable-file MD001 -->`
|
|
268
|
-
- Enable one or more rules by name: `<!-- markdownlint-enable-file MD001 -->`
|
|
269
|
-
|
|
270
|
-
This can be used to "hide" `markdownlint` comments at the bottom of a file.
|
|
271
|
-
|
|
272
|
-
In cases where it is desirable to change the configuration of one or
|
|
273
|
-
more rules for a file, the following more advanced syntax is supported:
|
|
274
|
-
|
|
275
|
-
- Configure: `<!-- markdownlint-configure-file { options.config JSON } -->`
|
|
276
|
-
|
|
277
|
-
For example:
|
|
278
|
-
|
|
279
|
-
```markdown
|
|
280
|
-
<!-- markdownlint-configure-file { "hr-style": { "style": "---" } } -->
|
|
281
|
-
```
|
|
282
|
-
|
|
283
|
-
or
|
|
284
|
-
|
|
285
|
-
```markdown
|
|
286
|
-
<!-- markdownlint-configure-file
|
|
287
|
-
{
|
|
288
|
-
"hr-style": {
|
|
289
|
-
"style": "---"
|
|
290
|
-
},
|
|
291
|
-
"no-trailing-spaces": false
|
|
292
|
-
}
|
|
293
|
-
-->
|
|
294
|
-
```
|
|
295
|
-
|
|
296
|
-
These changes apply to the entire file regardless of where the comment is
|
|
297
|
-
located. Multiple such comments (if present) are applied top-to-bottom. By
|
|
298
|
-
default, content of `markdownlint-configure-file` is assumed to be JSON, but
|
|
299
|
-
[`options.configParsers`](#optionsconfigparsers) can be used to support
|
|
300
|
-
alternate formats.
|
|
301
|
-
|
|
302
|
-
## API
|
|
303
|
-
|
|
304
|
-
### Linting
|
|
305
|
-
|
|
306
|
-
Standard asynchronous API:
|
|
307
|
-
|
|
308
|
-
```javascript
|
|
309
|
-
/**
|
|
310
|
-
* Lint specified Markdown files.
|
|
311
|
-
*
|
|
312
|
-
* @param {Options} options Configuration options.
|
|
313
|
-
* @param {LintCallback} callback Callback (err, result) function.
|
|
314
|
-
* @returns {void}
|
|
315
|
-
*/
|
|
316
|
-
function markdownlint(options, callback) { ... }
|
|
317
|
-
```
|
|
318
|
-
|
|
319
|
-
Synchronous API (for build scripts, etc.):
|
|
320
|
-
|
|
321
|
-
```javascript
|
|
322
|
-
/**
|
|
323
|
-
* Lint specified Markdown files synchronously.
|
|
324
|
-
*
|
|
325
|
-
* @param {Options} options Configuration options.
|
|
326
|
-
* @returns {LintResults} Results object.
|
|
327
|
-
*/
|
|
328
|
-
function markdownlint.sync(options) { ... }
|
|
329
|
-
```
|
|
330
|
-
|
|
331
|
-
Promise API (in the `promises` namespace like Node.js's
|
|
332
|
-
[`fs` Promises API](https://nodejs.org/api/fs.html#fs_fs_promises_api)):
|
|
333
|
-
|
|
334
|
-
```javascript
|
|
335
|
-
/**
|
|
336
|
-
* Lint specified Markdown files.
|
|
337
|
-
*
|
|
338
|
-
* @param {Options} options Configuration options.
|
|
339
|
-
* @returns {Promise<LintResults>} Results object.
|
|
340
|
-
*/
|
|
341
|
-
function markdownlint(options) { ... }
|
|
342
|
-
```
|
|
343
|
-
|
|
344
|
-
#### options
|
|
345
|
-
|
|
346
|
-
Type: `Object`
|
|
347
|
-
|
|
348
|
-
Configures the function. All properties are optional, but at least one
|
|
349
|
-
of `files` or `strings` should be set to provide input.
|
|
350
|
-
|
|
351
|
-
##### options.config
|
|
352
|
-
|
|
353
|
-
Type: `Object` mapping `String` to `Boolean | Object`
|
|
354
|
-
|
|
355
|
-
Configures the rules to use.
|
|
356
|
-
|
|
357
|
-
Object keys are rule names/aliases; object values are the rule's configuration.
|
|
358
|
-
The value `false` disables a rule, `true` enables its default configuration,
|
|
359
|
-
and passing an object value customizes that rule. Setting the special `default`
|
|
360
|
-
rule to `true` or `false` includes/excludes all rules by default. In the absence
|
|
361
|
-
of a configuration object, all rules are enabled. Enabling or disabling a tag
|
|
362
|
-
name (ex: `whitespace`) affects all rules having that tag.
|
|
363
|
-
|
|
364
|
-
The `default` rule is applied first, then keys are processed in order from top
|
|
365
|
-
to bottom with later values overriding earlier ones. Keys (including rule names,
|
|
366
|
-
aliases, tags, and `default`) are not case-sensitive.
|
|
367
|
-
|
|
368
|
-
Example:
|
|
369
|
-
|
|
370
|
-
```json
|
|
371
|
-
{
|
|
372
|
-
"default": true,
|
|
373
|
-
"MD003": { "style": "atx_closed" },
|
|
374
|
-
"MD007": { "indent": 4 },
|
|
375
|
-
"no-hard-tabs": false,
|
|
376
|
-
"whitespace": false
|
|
377
|
-
}
|
|
378
|
-
```
|
|
379
|
-
|
|
380
|
-
See [.markdownlint.jsonc](schema/.markdownlint.jsonc) and/or
|
|
381
|
-
[.markdownlint.yaml](schema/.markdownlint.yaml) for an example
|
|
382
|
-
configuration object with all properties set to the default value.
|
|
383
|
-
|
|
384
|
-
Sets of rules (known as a "style") can be stored separately and loaded
|
|
385
|
-
as [JSON](https://en.wikipedia.org/wiki/JSON).
|
|
386
|
-
|
|
387
|
-
Example of referencing a built-in style from JavaScript:
|
|
388
|
-
|
|
389
|
-
```javascript
|
|
390
|
-
const options = {
|
|
391
|
-
"files": [ "..." ],
|
|
392
|
-
"config": require("style/relaxed.json")
|
|
393
|
-
};
|
|
394
|
-
```
|
|
395
|
-
|
|
396
|
-
Example doing so from `.markdownlint.json` via `extends` (more on this below):
|
|
397
|
-
|
|
398
|
-
```json
|
|
399
|
-
{
|
|
400
|
-
"extends": "markdownlint/style/relaxed"
|
|
401
|
-
}
|
|
402
|
-
```
|
|
403
|
-
|
|
404
|
-
See the [style](style) directory for more samples.
|
|
405
|
-
|
|
406
|
-
See [markdownlint-config-schema.json](schema/markdownlint-config-schema.json)
|
|
407
|
-
for the [JSON Schema](https://json-schema.org/) of the `options.config`
|
|
408
|
-
object.
|
|
409
|
-
|
|
410
|
-
See [ValidatingConfiguration.md](schema/ValidatingConfiguration.md) for ways to
|
|
411
|
-
use the JSON Schema to validate configuration.
|
|
412
|
-
|
|
413
|
-
For more advanced scenarios, styles can reference and extend other styles.
|
|
414
|
-
The `readConfig` and `readConfigSync` functions can be used to read such
|
|
415
|
-
styles.
|
|
416
|
-
|
|
417
|
-
For example, assuming a `base.json` configuration file:
|
|
418
|
-
|
|
419
|
-
```json
|
|
420
|
-
{
|
|
421
|
-
"default": true
|
|
422
|
-
}
|
|
423
|
-
```
|
|
424
|
-
|
|
425
|
-
And a `custom.json` configuration file:
|
|
426
|
-
|
|
427
|
-
```json
|
|
428
|
-
{
|
|
429
|
-
"extends": "base.json",
|
|
430
|
-
"line-length": false
|
|
431
|
-
}
|
|
432
|
-
```
|
|
433
|
-
|
|
434
|
-
Then code like the following:
|
|
435
|
-
|
|
436
|
-
```javascript
|
|
437
|
-
const options = {
|
|
438
|
-
"config": markdownlint.readConfigSync("./custom.json")
|
|
439
|
-
};
|
|
440
|
-
```
|
|
441
|
-
|
|
442
|
-
Merges `custom.json` and `base.json` and is equivalent to:
|
|
443
|
-
|
|
444
|
-
```javascript
|
|
445
|
-
const options = {
|
|
446
|
-
"config": {
|
|
447
|
-
"default": true,
|
|
448
|
-
"line-length": false
|
|
449
|
-
}
|
|
450
|
-
};
|
|
451
|
-
```
|
|
452
|
-
|
|
453
|
-
##### options.configParsers
|
|
454
|
-
|
|
455
|
-
Type: *Optional* `Array` of `Function` taking (`String`) and returning `Object`
|
|
456
|
-
|
|
457
|
-
Array of functions to parse the content of `markdownlint-configure-file` blocks.
|
|
458
|
-
|
|
459
|
-
As shown in the [Configuration](#configuration) section, inline comments can be
|
|
460
|
-
used to customize the [configuration object](#optionsconfig) for a document. By
|
|
461
|
-
default, the `JSON.parse` built-in is used, but custom parsers can be specified.
|
|
462
|
-
Content is passed to each parser function until one returns a value (vs.
|
|
463
|
-
throwing an exception). As such, strict parsers should come before flexible
|
|
464
|
-
ones.
|
|
465
|
-
|
|
466
|
-
For example:
|
|
467
|
-
|
|
468
|
-
```javascript
|
|
469
|
-
[ JSON.parse, require("toml").parse, require("js-yaml").load ]
|
|
470
|
-
```
|
|
471
|
-
|
|
472
|
-
##### options.customRules
|
|
473
|
-
|
|
474
|
-
Type: `Array` of `Object`
|
|
475
|
-
|
|
476
|
-
List of custom rules to include with the default rule set for linting.
|
|
477
|
-
|
|
478
|
-
Each array element should define a rule. Rules are typically exported
|
|
479
|
-
by another package, but can be defined locally.
|
|
480
|
-
|
|
481
|
-
Example:
|
|
482
|
-
|
|
483
|
-
```javascript
|
|
484
|
-
const extraRules = require("extraRules");
|
|
485
|
-
const options = {
|
|
486
|
-
"customRules": [ extraRules.one, extraRules.two ]
|
|
487
|
-
};
|
|
488
|
-
```
|
|
489
|
-
|
|
490
|
-
See [CustomRules.md](doc/CustomRules.md) for details about authoring
|
|
491
|
-
custom rules.
|
|
492
|
-
|
|
493
|
-
##### options.files
|
|
494
|
-
|
|
495
|
-
Type: `Array` of `String`
|
|
496
|
-
|
|
497
|
-
List of files to lint.
|
|
498
|
-
|
|
499
|
-
Each array element should be a single file (via relative or absolute path);
|
|
500
|
-
[globbing](https://en.wikipedia.org/wiki/Glob_%28programming%29) is the
|
|
501
|
-
caller's responsibility.
|
|
502
|
-
|
|
503
|
-
Example: `[ "one.md", "dir/two.md" ]`
|
|
504
|
-
|
|
505
|
-
##### options.frontMatter
|
|
506
|
-
|
|
507
|
-
Type: `RegExp`
|
|
508
|
-
|
|
509
|
-
Matches any [front matter](https://jekyllrb.com/docs/frontmatter/)
|
|
510
|
-
found at the beginning of a file.
|
|
511
|
-
|
|
512
|
-
Some Markdown content begins with metadata; the default `RegExp` for
|
|
513
|
-
this option ignores common forms of "front matter". To match differently,
|
|
514
|
-
specify a custom `RegExp` or use the value `null` to disable the feature.
|
|
515
|
-
|
|
516
|
-
The default value:
|
|
517
|
-
|
|
518
|
-
```javascript
|
|
519
|
-
/((^---\s*$[\s\S]+?^---\s*)|(^\+\+\+\s*$[\s\S]+?^(\+\+\+|\.\.\.)\s*)|(^\{\s*$[\s\S]+?^\}\s*))(\r\n|\r|\n|$)/m
|
|
520
|
-
```
|
|
521
|
-
|
|
522
|
-
Ignores [YAML](https://en.wikipedia.org/wiki/YAML),
|
|
523
|
-
[TOML](https://en.wikipedia.org/wiki/TOML), and
|
|
524
|
-
[JSON](https://en.wikipedia.org/wiki/JSON) front matter such as:
|
|
525
|
-
|
|
526
|
-
```text
|
|
527
|
-
---
|
|
528
|
-
layout: post
|
|
529
|
-
title: Title
|
|
530
|
-
---
|
|
531
|
-
```
|
|
532
|
-
|
|
533
|
-
Note: Matches must occur at the start of the file.
|
|
534
|
-
|
|
535
|
-
##### options.fs
|
|
536
|
-
|
|
537
|
-
Type: `Object` implementing the [file system API][node-fs-api]
|
|
538
|
-
|
|
539
|
-
In advanced scenarios, it may be desirable to bypass the default file system
|
|
540
|
-
API. If a custom file system implementation is provided, `markdownlint` will use
|
|
541
|
-
that instead of invoking `require("fs")`.
|
|
542
|
-
|
|
543
|
-
Note: The only methods called are `readFile` and `readFileSync`.
|
|
544
|
-
|
|
545
|
-
[node-fs-api]: https://nodejs.org/api/fs.html
|
|
546
|
-
|
|
547
|
-
##### options.handleRuleFailures
|
|
548
|
-
|
|
549
|
-
Type: `Boolean`
|
|
550
|
-
|
|
551
|
-
Catches exceptions thrown during rule processing and reports the problem
|
|
552
|
-
as a rule violation.
|
|
553
|
-
|
|
554
|
-
By default, exceptions thrown by rules (or the library itself) are unhandled
|
|
555
|
-
and bubble up the stack to the caller in the conventional manner. By setting
|
|
556
|
-
`handleRuleFailures` to `true`, exceptions thrown by failing rules will
|
|
557
|
-
be handled by the library and the exception message logged as a rule violation.
|
|
558
|
-
This setting can be useful in the presence of (custom) rules that encounter
|
|
559
|
-
unexpected syntax and fail. By enabling this option, the linting process
|
|
560
|
-
is allowed to continue and report any violations that were found.
|
|
561
|
-
|
|
562
|
-
##### options.markdownItPlugins
|
|
563
|
-
|
|
564
|
-
Type: `Array` of `Array` of `Function` and plugin parameters
|
|
565
|
-
|
|
566
|
-
Specifies additional [`markdown-it` plugins][markdown-it-plugin] to use when
|
|
567
|
-
parsing input. Plugins can be used to support additional syntax and features for
|
|
568
|
-
advanced scenarios.
|
|
569
|
-
|
|
570
|
-
[markdown-it-plugin]: https://www.npmjs.com/search?q=keywords:markdown-it-plugin
|
|
571
|
-
|
|
572
|
-
Each item in the top-level `Array` should be of the form:
|
|
573
|
-
|
|
574
|
-
```javascript
|
|
575
|
-
[ require("markdown-it-plugin"), plugin_param_0, plugin_param_1, ... ]
|
|
576
|
-
```
|
|
577
|
-
|
|
578
|
-
> Note that `markdown-it` plugins are only called when the `markdown-it` parser
|
|
579
|
-
> is invoked. None of the built-in rules use the `markdown-it` parser, so
|
|
580
|
-
> `markdown-it` plugins will only be invoked when one or more
|
|
581
|
-
> [custom rules][custom-rules] that use the `markdown-it` parser are present.
|
|
582
|
-
|
|
583
|
-
[custom-rules]: #custom-rules
|
|
584
|
-
|
|
585
|
-
##### options.noInlineConfig
|
|
586
|
-
|
|
587
|
-
Type: `Boolean`
|
|
588
|
-
|
|
589
|
-
Disables the use of HTML comments like `<!-- markdownlint-enable -->` to toggle
|
|
590
|
-
rules within the body of Markdown content.
|
|
591
|
-
|
|
592
|
-
By default, properly-formatted inline comments can be used to create exceptions
|
|
593
|
-
for parts of a document. Setting `noInlineConfig` to `true` ignores all such
|
|
594
|
-
comments.
|
|
595
|
-
|
|
596
|
-
##### options.resultVersion
|
|
597
|
-
|
|
598
|
-
Type: `Number`
|
|
599
|
-
|
|
600
|
-
Specifies which version of the `result` object to return (see the "Usage"
|
|
601
|
-
section below for examples).
|
|
602
|
-
|
|
603
|
-
Passing a `resultVersion` of `0` corresponds to the original, simple format
|
|
604
|
-
where each error is identified by rule name and line number. *This is
|
|
605
|
-
deprecated.*
|
|
606
|
-
|
|
607
|
-
Passing a `resultVersion` of `1` corresponds to a detailed format where each
|
|
608
|
-
error includes information about the line number, rule name, alias, description,
|
|
609
|
-
as well as any additional detail or context that is available. *This is
|
|
610
|
-
deprecated.*
|
|
611
|
-
|
|
612
|
-
Passing a `resultVersion` of `2` corresponds to a detailed format where each
|
|
613
|
-
error includes information about the line number, rule names, description, as
|
|
614
|
-
well as any additional detail or context that is available. *This is
|
|
615
|
-
deprecated.*
|
|
616
|
-
|
|
617
|
-
Passing a `resultVersion` of `3` corresponds to the detailed version `2` format
|
|
618
|
-
with additional information about how to fix automatically-fixable errors. In
|
|
619
|
-
this mode, all errors that occur on each line are reported (other versions
|
|
620
|
-
report only the first error for each rule). *This is the default.*
|
|
621
|
-
|
|
622
|
-
##### options.strings
|
|
623
|
-
|
|
624
|
-
Type: `Object` mapping `String` to `String`
|
|
625
|
-
|
|
626
|
-
Map of identifiers to strings for linting.
|
|
627
|
-
|
|
628
|
-
When Markdown content is not available as files, it can be passed as
|
|
629
|
-
strings. The keys of the `strings` object are used to identify each
|
|
630
|
-
input value in the `result` summary.
|
|
631
|
-
|
|
632
|
-
Example:
|
|
633
|
-
|
|
634
|
-
```json
|
|
635
|
-
{
|
|
636
|
-
"readme": "# README\n...",
|
|
637
|
-
"changelog": "# CHANGELOG\n..."
|
|
638
|
-
}
|
|
639
|
-
```
|
|
640
|
-
|
|
641
|
-
#### callback
|
|
642
|
-
|
|
643
|
-
Type: `Function` taking (`Error`, `Object`)
|
|
644
|
-
|
|
645
|
-
Standard completion callback.
|
|
646
|
-
|
|
647
|
-
#### result
|
|
648
|
-
|
|
649
|
-
Type: `Object`
|
|
650
|
-
|
|
651
|
-
Call `result.toString()` for convenience or see below for an example of the
|
|
652
|
-
structure of the `result` object. Passing the value `true` to `toString()`
|
|
653
|
-
uses rule aliases (ex: `no-hard-tabs`) instead of names (ex: `MD010`).
|
|
654
|
-
|
|
655
|
-
### Config
|
|
656
|
-
|
|
657
|
-
The `options.config` configuration object is simple and can be stored in a file
|
|
658
|
-
for readability and easy reuse. The `readConfig` and `readConfigSync` functions
|
|
659
|
-
load configuration settings and support the `extends` keyword for referencing
|
|
660
|
-
other files (see above).
|
|
661
|
-
|
|
662
|
-
By default, configuration files are parsed as JSON (and named
|
|
663
|
-
`.markdownlint.json`). Custom parsers can be provided to handle other formats
|
|
664
|
-
like JSONC, YAML, and TOML.
|
|
665
|
-
|
|
666
|
-
Asynchronous API:
|
|
667
|
-
|
|
668
|
-
```javascript
|
|
669
|
-
/**
|
|
670
|
-
* Read specified configuration file.
|
|
671
|
-
*
|
|
672
|
-
* @param {string} file Configuration file name.
|
|
673
|
-
* @param {ConfigurationParser[] | ReadConfigCallback} parsers Parsing function.
|
|
674
|
-
* @param {Object} [fs] File system implementation.
|
|
675
|
-
* @param {ReadConfigCallback} [callback] Callback (err, result) function.
|
|
676
|
-
* @returns {void}
|
|
677
|
-
*/
|
|
678
|
-
function readConfig(file, parsers, fs, callback) { ... }
|
|
679
|
-
```
|
|
680
|
-
|
|
681
|
-
Synchronous API:
|
|
682
|
-
|
|
683
|
-
```javascript
|
|
684
|
-
/**
|
|
685
|
-
* Read specified configuration file synchronously.
|
|
686
|
-
*
|
|
687
|
-
* @param {string} file Configuration file name.
|
|
688
|
-
* @param {ConfigurationParser[]} [parsers] Parsing function(s).
|
|
689
|
-
* @param {Object} [fs] File system implementation.
|
|
690
|
-
* @returns {Configuration} Configuration object.
|
|
691
|
-
*/
|
|
692
|
-
function readConfigSync(file, parsers, fs) { ... }
|
|
693
|
-
```
|
|
694
|
-
|
|
695
|
-
Promise API (in the `promises` namespace like Node.js's
|
|
696
|
-
[`fs` Promises API](https://nodejs.org/api/fs.html#fs_promises_api)):
|
|
697
|
-
|
|
698
|
-
```javascript
|
|
699
|
-
/**
|
|
700
|
-
* Read specified configuration file.
|
|
701
|
-
*
|
|
702
|
-
* @param {string} file Configuration file name.
|
|
703
|
-
* @param {ConfigurationParser[]} [parsers] Parsing function(s).
|
|
704
|
-
* @param {Object} [fs] File system implementation.
|
|
705
|
-
* @returns {Promise<Configuration>} Configuration object.
|
|
706
|
-
*/
|
|
707
|
-
function readConfig(file, parsers, fs) { ... }
|
|
708
|
-
```
|
|
709
|
-
|
|
710
|
-
#### file
|
|
711
|
-
|
|
712
|
-
Type: `String`
|
|
713
|
-
|
|
714
|
-
Location of configuration file to read.
|
|
715
|
-
|
|
716
|
-
The `file` is resolved relative to the current working directory. If an
|
|
717
|
-
`extends` key is present once read, its value will be resolved as a path
|
|
718
|
-
relative to `file` and loaded recursively. Settings from a file referenced by
|
|
719
|
-
`extends` are applied first, then those of `file` are applied on top (overriding
|
|
720
|
-
any of the same keys appearing in the referenced file). If either the `file` or
|
|
721
|
-
`extends` path begins with the `~` directory, it will act as a placeholder for
|
|
722
|
-
the home directory.
|
|
723
|
-
|
|
724
|
-
#### parsers
|
|
725
|
-
|
|
726
|
-
Type: *Optional* `Array` of `Function` taking (`String`) and returning `Object`
|
|
727
|
-
|
|
728
|
-
Array of functions to parse configuration files.
|
|
729
|
-
|
|
730
|
-
The contents of a configuration file are passed to each parser function until
|
|
731
|
-
one of them returns a value (vs. throwing an exception). Consequently, strict
|
|
732
|
-
parsers should come before flexible parsers.
|
|
733
|
-
|
|
734
|
-
For example:
|
|
735
|
-
|
|
736
|
-
```javascript
|
|
737
|
-
[ JSON.parse, require("toml").parse, require("js-yaml").load ]
|
|
738
|
-
```
|
|
739
|
-
|
|
740
|
-
#### fs
|
|
741
|
-
|
|
742
|
-
Type: *Optional* `Object` implementing the [file system API][file-system-api]
|
|
743
|
-
|
|
744
|
-
[file-system-api]: https://nodejs.org/api/fs.html
|
|
745
|
-
|
|
746
|
-
In advanced scenarios, it may be desirable to bypass the default file system
|
|
747
|
-
API. If a custom file system implementation is provided, `markdownlint` will use
|
|
748
|
-
that instead of invoking `require("fs")`.
|
|
749
|
-
|
|
750
|
-
Note: The only methods called are `readFile`, `readFileSync`, `access`, and
|
|
751
|
-
`accessSync`.
|
|
752
|
-
|
|
753
|
-
#### callback
|
|
754
|
-
|
|
755
|
-
Type: `Function` taking (`Error`, `Object`)
|
|
756
|
-
|
|
757
|
-
Standard completion callback.
|
|
758
|
-
|
|
759
|
-
#### result
|
|
760
|
-
|
|
761
|
-
Type: `Object`
|
|
762
|
-
|
|
763
|
-
Configuration object.
|
|
764
|
-
|
|
765
|
-
## Usage
|
|
766
|
-
|
|
767
|
-
Invoke `markdownlint` and use the `result` object's `toString` method:
|
|
768
|
-
|
|
769
|
-
```javascript
|
|
770
|
-
const markdownlint = require("markdownlint");
|
|
771
|
-
|
|
772
|
-
const options = {
|
|
773
|
-
"files": [ "good.md", "bad.md" ],
|
|
774
|
-
"strings": {
|
|
775
|
-
"good.string": "# good.string\n\nThis string passes all rules.",
|
|
776
|
-
"bad.string": "#bad.string\n\n#This string fails\tsome rules."
|
|
777
|
-
}
|
|
778
|
-
};
|
|
779
|
-
|
|
780
|
-
markdownlint(options, function callback(err, result) {
|
|
781
|
-
if (!err) {
|
|
782
|
-
console.log(result.toString());
|
|
783
|
-
}
|
|
784
|
-
});
|
|
785
|
-
```
|
|
786
|
-
|
|
787
|
-
Output:
|
|
788
|
-
|
|
789
|
-
```text
|
|
790
|
-
bad.string: 3: MD010/no-hard-tabs Hard tabs [Column: 19]
|
|
791
|
-
bad.string: 1: MD018/no-missing-space-atx No space after hash on atx style heading [Context: "#bad.string"]
|
|
792
|
-
bad.string: 3: MD018/no-missing-space-atx No space after hash on atx style heading [Context: "#This string fails some rules."]
|
|
793
|
-
bad.string: 1: MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "#bad.string"]
|
|
794
|
-
bad.md: 3: MD010/no-hard-tabs Hard tabs [Column: 17]
|
|
795
|
-
bad.md: 1: MD018/no-missing-space-atx No space after hash on atx style heading [Context: "#bad.md"]
|
|
796
|
-
bad.md: 3: MD018/no-missing-space-atx No space after hash on atx style heading [Context: "#This file fails some rules."]
|
|
797
|
-
bad.md: 1: MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "#bad.md"]
|
|
798
|
-
```
|
|
799
|
-
|
|
800
|
-
Or invoke `markdownlint.sync` for a synchronous call:
|
|
801
|
-
|
|
802
|
-
```javascript
|
|
803
|
-
const result = markdownlint.sync(options);
|
|
804
|
-
console.log(result.toString());
|
|
805
|
-
```
|
|
806
|
-
|
|
807
|
-
To examine the `result` object directly:
|
|
808
|
-
|
|
809
|
-
```javascript
|
|
810
|
-
markdownlint(options, function callback(err, result) {
|
|
811
|
-
if (!err) {
|
|
812
|
-
console.dir(result, { "colors": true, "depth": null });
|
|
813
|
-
}
|
|
814
|
-
});
|
|
815
|
-
```
|
|
816
|
-
|
|
817
|
-
Output:
|
|
818
|
-
|
|
819
|
-
```json
|
|
820
|
-
{
|
|
821
|
-
"good.md": [],
|
|
822
|
-
"bad.md": [
|
|
823
|
-
{ "lineNumber": 3,
|
|
824
|
-
"ruleNames": [ "MD010", "no-hard-tabs" ],
|
|
825
|
-
"ruleDescription": "Hard tabs",
|
|
826
|
-
"ruleInformation": "https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md",
|
|
827
|
-
"errorDetail": "Column: 17",
|
|
828
|
-
"errorContext": null,
|
|
829
|
-
"errorRange": [ 17, 1 ] },
|
|
830
|
-
{ "lineNumber": 1,
|
|
831
|
-
"ruleNames": [ "MD018", "no-missing-space-atx" ],
|
|
832
|
-
"ruleDescription": "No space after hash on atx style heading",
|
|
833
|
-
"ruleInformation": "https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md018.md",
|
|
834
|
-
"errorDetail": null,
|
|
835
|
-
"errorContext": "#bad.md",
|
|
836
|
-
"errorRange": [ 1, 2 ] },
|
|
837
|
-
{ "lineNumber": 3,
|
|
838
|
-
"ruleNames": [ "MD018", "no-missing-space-atx" ],
|
|
839
|
-
"ruleDescription": "No space after hash on atx style heading",
|
|
840
|
-
"ruleInformation": "https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md018.md",
|
|
841
|
-
"errorDetail": null,
|
|
842
|
-
"errorContext": "#This file fails\tsome rules.",
|
|
843
|
-
"errorRange": [ 1, 2 ] },
|
|
844
|
-
{ "lineNumber": 1,
|
|
845
|
-
"ruleNames": [ "MD041", "first-line-heading", "first-line-h1" ],
|
|
846
|
-
"ruleDescription": "First line in a file should be a top-level heading",
|
|
847
|
-
"ruleInformation": "https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md041.md",
|
|
848
|
-
"errorDetail": null,
|
|
849
|
-
"errorContext": "#bad.md",
|
|
850
|
-
"errorRange": null }
|
|
851
|
-
]
|
|
852
|
-
}
|
|
853
|
-
```
|
|
854
|
-
|
|
855
|
-
Integration with the [gulp](https://gulpjs.com/) build system is
|
|
856
|
-
straightforward:
|
|
857
|
-
|
|
858
|
-
```javascript
|
|
859
|
-
const gulp = require("gulp");
|
|
860
|
-
const through2 = require("through2");
|
|
861
|
-
const markdownlint = require("markdownlint");
|
|
862
|
-
|
|
863
|
-
gulp.task("markdownlint", function task() {
|
|
864
|
-
return gulp.src("*.md", { "read": false })
|
|
865
|
-
.pipe(through2.obj(function obj(file, enc, next) {
|
|
866
|
-
markdownlint(
|
|
867
|
-
{ "files": [ file.relative ] },
|
|
868
|
-
function callback(err, result) {
|
|
869
|
-
const resultString = (result || "").toString();
|
|
870
|
-
if (resultString) {
|
|
871
|
-
console.log(resultString);
|
|
872
|
-
}
|
|
873
|
-
next(err, file);
|
|
874
|
-
});
|
|
875
|
-
}));
|
|
876
|
-
});
|
|
877
|
-
```
|
|
878
|
-
|
|
879
|
-
Output:
|
|
880
|
-
|
|
881
|
-
```text
|
|
882
|
-
[00:00:00] Starting 'markdownlint'...
|
|
883
|
-
bad.md: 3: MD010/no-hard-tabs Hard tabs [Column: 17]
|
|
884
|
-
bad.md: 1: MD018/no-missing-space-atx No space after hash on atx style heading [Context: "#bad.md"]
|
|
885
|
-
bad.md: 3: MD018/no-missing-space-atx No space after hash on atx style heading [Context: "#This file fails some rules."]
|
|
886
|
-
bad.md: 1: MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "#bad.md"]
|
|
887
|
-
[00:00:00] Finished 'markdownlint' after 10 ms
|
|
888
|
-
```
|
|
889
|
-
|
|
890
|
-
Integration with the [Grunt](https://gruntjs.com/) build system is similar:
|
|
891
|
-
|
|
892
|
-
```javascript
|
|
893
|
-
const markdownlint = require("markdownlint");
|
|
894
|
-
|
|
895
|
-
module.exports = function wrapper(grunt) {
|
|
896
|
-
grunt.initConfig({
|
|
897
|
-
"markdownlint": {
|
|
898
|
-
"example": {
|
|
899
|
-
"src": [ "*.md" ]
|
|
900
|
-
}
|
|
901
|
-
}
|
|
902
|
-
});
|
|
903
|
-
|
|
904
|
-
grunt.registerMultiTask("markdownlint", function task() {
|
|
905
|
-
const done = this.async();
|
|
906
|
-
markdownlint(
|
|
907
|
-
{ "files": this.filesSrc },
|
|
908
|
-
function callback(err, result) {
|
|
909
|
-
const resultString = err || ((result || "").toString());
|
|
910
|
-
if (resultString) {
|
|
911
|
-
grunt.fail.warn("\n" + resultString + "\n");
|
|
912
|
-
}
|
|
913
|
-
done(!err || !resultString);
|
|
914
|
-
});
|
|
915
|
-
});
|
|
916
|
-
};
|
|
917
|
-
```
|
|
918
|
-
|
|
919
|
-
Output:
|
|
920
|
-
|
|
921
|
-
```text
|
|
922
|
-
Running "markdownlint:example" (markdownlint) task
|
|
923
|
-
Warning:
|
|
924
|
-
bad.md: 3: MD010/no-hard-tabs Hard tabs [Column: 17]
|
|
925
|
-
bad.md: 1: MD018/no-missing-space-atx No space after hash on atx style heading [Context: "#bad.md"]
|
|
926
|
-
bad.md: 3: MD018/no-missing-space-atx No space after hash on atx style heading [Context: "#This file fails some rules."]
|
|
927
|
-
bad.md: 1: MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "#bad.md"]
|
|
928
|
-
Use --force to continue.
|
|
929
|
-
```
|
|
930
|
-
|
|
931
|
-
### Fixing
|
|
932
|
-
|
|
933
|
-
Rules that can be fixed automatically include a `fixInfo` property which is
|
|
934
|
-
outlined in the [documentation for custom rules](doc/CustomRules.md#authoring).
|
|
935
|
-
To apply those fixes more easily, the `applyFixes` method in
|
|
936
|
-
[markdownlint-rule-helpers](helpers/README.md#applying-recommended-fixes) may
|
|
937
|
-
be used.
|
|
938
|
-
|
|
939
|
-
## Browser
|
|
940
|
-
|
|
941
|
-
`markdownlint` also works in the browser.
|
|
942
|
-
|
|
943
|
-
Generate normal and minified scripts with:
|
|
944
|
-
|
|
945
|
-
```bash
|
|
946
|
-
npm run build-demo
|
|
947
|
-
```
|
|
948
|
-
|
|
949
|
-
Then reference `markdown-it` and `markdownlint`:
|
|
950
|
-
|
|
951
|
-
```html
|
|
952
|
-
<script src="demo/markdown-it.min.js"></script>
|
|
953
|
-
<script src="demo/markdownlint-browser.min.js"></script>
|
|
954
|
-
```
|
|
955
|
-
|
|
956
|
-
And call it like so:
|
|
957
|
-
|
|
958
|
-
```javascript
|
|
959
|
-
const options = {
|
|
960
|
-
"strings": {
|
|
961
|
-
"content": "Some Markdown to lint."
|
|
962
|
-
}
|
|
963
|
-
};
|
|
964
|
-
const results = window.markdownlint.sync(options).toString();
|
|
965
|
-
```
|
|
966
|
-
|
|
967
|
-
## Examples
|
|
968
|
-
|
|
969
|
-
For ideas how to integrate `markdownlint` into your workflow, refer to the
|
|
970
|
-
following projects or one of the tools in the [Related section](#related):
|
|
971
|
-
|
|
972
|
-
- [.NET Documentation][dot-net-doc] ([Search repository][dot-net-doc-search])
|
|
973
|
-
- [ally.js][ally-js] ([Search repository][ally-js-search])
|
|
974
|
-
- [Apache Airflow][airflow] ([Search repository][airflow-search])
|
|
975
|
-
- [Boostnote][boostnote] ([Search repository][boostnote-search])
|
|
976
|
-
- [CodiMD][codimd] ([Search repository][codimd-search])
|
|
977
|
-
- [Electron][electron] ([Search repository][electron-search])
|
|
978
|
-
- [ESLint][eslint] ([Search repository][eslint-search])
|
|
979
|
-
- [Garden React Components][garden] ([Search repository][garden-search])
|
|
980
|
-
- [MDN Web Docs][mdn] ([Search repository][mdn-search])
|
|
981
|
-
- [MkDocs][mkdocs] ([Search repository][mkdocs-search])
|
|
982
|
-
- [Mocha][mocha] ([Search repository][mocha-search])
|
|
983
|
-
- [Pi-hole documentation][pi-hole] ([Search repository][pi-hole-search])
|
|
984
|
-
- [Reactable][reactable] ([Search repository][reactable-search])
|
|
985
|
-
- [V8][v8] ([Search repository][v8-search])
|
|
986
|
-
- [webhint][webhint] ([Search repository][webhint-search])
|
|
987
|
-
- [webpack][webpack] ([Search repository][webpack-search])
|
|
988
|
-
- [WordPress][wordpress] ([Search repository][wordpress-search])
|
|
989
|
-
|
|
990
|
-
For more advanced integration scenarios:
|
|
991
|
-
|
|
992
|
-
- [GitHub Docs content linter][content-linter]
|
|
993
|
-
- [GitHub's `markdownlint-github` repository][markdownlint-github]
|
|
994
|
-
|
|
995
|
-
[ally-js]: https://allyjs.io/
|
|
996
|
-
[ally-js-search]: https://github.com/medialize/ally.js/search?q=markdownlint
|
|
997
|
-
[airflow]: https://airflow.apache.org
|
|
998
|
-
[airflow-search]: https://github.com/apache/airflow/search?q=markdownlint
|
|
999
|
-
[boostnote]: https://boostnote.io/
|
|
1000
|
-
[boostnote-search]: https://github.com/BoostIO/Boostnote/search?q=markdownlint
|
|
1001
|
-
[codimd]: https://github.com/hackmdio/codimd
|
|
1002
|
-
[codimd-search]: https://github.com/hackmdio/codimd/search?q=markdownlint
|
|
1003
|
-
[content-linter]: https://docs.github.com/en/contributing/collaborating-on-github-docs/using-the-content-linter
|
|
1004
|
-
[dot-net-doc]: https://docs.microsoft.com/en-us/dotnet/
|
|
1005
|
-
[dot-net-doc-search]: https://github.com/dotnet/docs/search?q=markdownlint
|
|
1006
|
-
[electron]: https://www.electronjs.org
|
|
1007
|
-
[electron-search]: https://github.com/electron/electron/search?q=markdownlint
|
|
1008
|
-
[eslint]: https://eslint.org/
|
|
1009
|
-
[eslint-search]: https://github.com/eslint/eslint/search?q=markdownlint
|
|
1010
|
-
[garden]: https://zendeskgarden.github.io/react-components/
|
|
1011
|
-
[garden-search]: https://github.com/zendeskgarden/react-components/search?q=markdownlint
|
|
1012
|
-
[markdownlint-github]: https://github.com/github/markdownlint-github
|
|
1013
|
-
[mdn]: https://developer.mozilla.org/
|
|
1014
|
-
[mdn-search]: https://github.com/mdn/content/search?q=markdownlint
|
|
1015
|
-
[mkdocs]: https://www.mkdocs.org/
|
|
1016
|
-
[mkdocs-search]: https://github.com/mkdocs/mkdocs/search?q=markdownlint
|
|
1017
|
-
[mocha]: https://mochajs.org/
|
|
1018
|
-
[mocha-search]: https://github.com/mochajs/mocha/search?q=markdownlint
|
|
1019
|
-
[pi-hole]: https://docs.pi-hole.net
|
|
1020
|
-
[pi-hole-search]: https://github.com/pi-hole/docs/search?q=markdownlint
|
|
1021
|
-
[reactable]: https://glittershark.github.io/reactable/
|
|
1022
|
-
[reactable-search]: https://github.com/glittershark/reactable/search?q=markdownlint
|
|
1023
|
-
[v8]: https://v8.dev/
|
|
1024
|
-
[v8-search]: https://github.com/v8/v8.dev/search?q=markdownlint
|
|
1025
|
-
[webhint]: https://webhint.io/
|
|
1026
|
-
[webhint-search]: https://github.com/webhintio/hint/search?q=markdownlint
|
|
1027
|
-
[webpack]: https://webpack.js.org/
|
|
1028
|
-
[webpack-search]: https://github.com/webpack/webpack.js.org/search?q=markdownlint
|
|
1029
|
-
[wordpress]: https://wordpress.org/gutenberg/
|
|
1030
|
-
[wordpress-search]: https://github.com/WordPress/gutenberg/search?q=markdownlint
|
|
1031
|
-
|
|
1032
|
-
## Contributing
|
|
1033
|
-
|
|
1034
|
-
See [CONTRIBUTING.md](CONTRIBUTING.md) for more information.
|
|
1035
|
-
|
|
1036
|
-
## Releasing
|
|
1037
|
-
|
|
1038
|
-
See [ReleaseProcess.md](doc/ReleaseProcess.md) for more information.
|
|
1039
|
-
|
|
1040
|
-
## History
|
|
1041
|
-
|
|
1042
|
-
See [CHANGELOG.md](CHANGELOG.md).
|
|
1043
|
-
|
|
1044
|
-
[npm-image]: https://img.shields.io/npm/v/markdownlint.svg
|
|
1045
|
-
[npm-url]: https://www.npmjs.com/package/markdownlint
|
|
1046
|
-
[license-image]: https://img.shields.io/npm/l/markdownlint.svg
|
|
1047
|
-
[license-url]: https://opensource.org/licenses/MIT
|