├── .github ├── dependabot.yml └── workflows │ ├── ci.yml │ └── codeql.yml ├── .gitignore ├── .npmignore ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── biome.json ├── err.md ├── esbuild.mjs ├── generate-config-schema.js ├── ok.md ├── package-lock.json ├── package.json ├── snippets └── snippets.json ├── src ├── engine.ts └── index.ts └── tsconfig.json /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: npm 4 | open-pull-requests-limit: 10 5 | directory: "/" 6 | schedule: 7 | interval: monthly 8 | groups: 9 | dev-dependencies-js-yaml: 10 | patterns: 11 | - "@types/js-yaml" 12 | - "js-yaml" 13 | dev-dependencies-deep-extend: 14 | patterns: 15 | - "@types/deep-extend" 16 | - "deep-extend" 17 | dev-dependencies-rc: 18 | patterns: 19 | - "@types/rc" 20 | - "rc" 21 | reviewers: 22 | - fannheyward 23 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: build 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | pull_request: 8 | branches: 9 | - master 10 | 11 | jobs: 12 | build: 13 | runs-on: ubuntu-latest 14 | 15 | strategy: 16 | fail-fast: false 17 | matrix: 18 | node-version: [18] 19 | 20 | env: 21 | NODE_ENV: test 22 | 23 | steps: 24 | - uses: actions/checkout@v3 25 | - name: Use Node.js ${{ matrix.node-version }} 26 | uses: actions/setup-node@v3 27 | with: 28 | node-version: ${{ matrix.node-version }} 29 | - name: npm ci 30 | run: | 31 | npm ci 32 | - name: npm lint 33 | run: | 34 | npm run lint 35 | - name: npm format 36 | run: | 37 | npm run format 38 | -------------------------------------------------------------------------------- /.github/workflows/codeql.yml: -------------------------------------------------------------------------------- 1 | name: "CodeQL" 2 | 3 | on: 4 | push: 5 | branches: [ "master" ] 6 | pull_request: 7 | branches: [ "master" ] 8 | schedule: 9 | - cron: "36 8 * * 3" 10 | 11 | jobs: 12 | analyze: 13 | name: Analyze 14 | runs-on: ubuntu-latest 15 | permissions: 16 | actions: read 17 | contents: read 18 | security-events: write 19 | 20 | strategy: 21 | fail-fast: false 22 | matrix: 23 | language: [ javascript ] 24 | 25 | steps: 26 | - name: Checkout 27 | uses: actions/checkout@v3 28 | 29 | - name: Initialize CodeQL 30 | uses: github/codeql-action/init@v2 31 | with: 32 | languages: ${{ matrix.language }} 33 | queries: +security-and-quality 34 | 35 | - name: Autobuild 36 | uses: github/codeql-action/autobuild@v2 37 | 38 | - name: Perform CodeQL Analysis 39 | uses: github/codeql-action/analyze@v2 40 | with: 41 | category: "/language:${{ matrix.language }}" 42 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | lib 2 | node_modules/ 3 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | src 2 | node_modules 3 | tsconfig.json 4 | *.map 5 | .tags 6 | .DS_Store 7 | webpack.config.js 8 | yarn.lock 9 | yarn-error.log 10 | err.md 11 | ok.md 12 | .github 13 | .eslintrc.js 14 | esbuild.js 15 | esbuild.mjs 16 | biome.json 17 | CONTRIBUTING.md 18 | generate-config-schema.js 19 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | ## Testing a change in coc.nvim 4 | 5 | If you build a change and want to test it, you can do the following: 6 | 7 | - Raise your PR 8 | - Fork the repo 9 | - Create a PR branch, e.g. `my-pr-branch` 10 | - Make your change 11 | - Raise a PR from that branch 12 | - Create another branch, e.g. `prebuilt`, based on `my-pr-branch` 13 | - Build the code with `yarn build`. 14 | - Comment out the `lib/` line in the `.gitignore` file. 15 | - Add `lib/index.js` 16 | - Work around [this issue][] by replacing `new URL` with `new (require("url").URL)` in `lib/index.js` 17 | - commit, push 18 | - Change your fork's default branch to `prebuilt` 19 | - Run `:CocUninstall coc-markdownlint` 20 | - Run `:CocInstall https://github.com//coc-markdownlint` 21 | 22 | [this issue]: https://github.com/fannheyward/coc-markdownlint/issues/446#issuecomment-928576266 23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Heyward Fann 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # coc-markdownlint 2 | 3 | [markdownlint](https://github.com/DavidAnson/markdownlint) for Vim/Neovim, works as coc.nvim extension. 4 | 5 | image 6 | 7 | ## Features 8 | 9 | - Style lint 10 | - Autofix 11 | 12 | `(coc-codeaction)` on current diagnostic, you will find available codeAction, choose by number to fix. 13 | 14 | ![autofix](https://user-images.githubusercontent.com/345274/66532165-f0afd400-eb40-11e9-99a7-2b30fb03e258.gif) 15 | 16 | ## Install 17 | 18 | `:CocInstall coc-markdownlint` 19 | 20 | ## Configurations 21 | 22 | - `markdownlint.onOpen`: lint on open a file, default `true` 23 | - `markdownlint.onChange`: lint on changing a file, default `true` 24 | - `markdownlint.onSave`: lint on saving a file, default `true` 25 | - `markdownlint.config`: configurations rules used by markdownlint, default `{}` 26 | 27 | ## Commands 28 | 29 | - `markdownlint.fixAll`: fix all errors in current file found by markdownlint 30 | 31 | ## CodeActions 32 | 33 | Provides codeAction for current file or line to disable markdownlint, triggered 34 | by `(coc-codeaction)` and `(coc-codeaction-line)` 35 | 36 | - `` 37 | - `` 38 | 39 | ## Rules 40 | 41 | You can configures the markdownlint rules to use, for example: 42 | 43 | ```json 44 | { 45 | "default": true, 46 | "line_length": false 47 | } 48 | ``` 49 | 50 | `coc-markdownlint` can read configurations from: 51 | 52 | 1. Global configuration file that [rc](https://www.npmjs.com/package/rc#standards) can find, for example `$HOME/.markdownlintrc`. Checkout `rc` for more examples. 53 | 2. `markdownlint.config` section in `coc-settings.json` 54 | 3. `.markdownlint.{json, yaml}` in local workspace root 55 | 56 | ## License 57 | 58 | MIT 59 | 60 | --- 61 | > This extension is created with [create-coc-extension](https://github.com/fannheyward/create-coc-extension) 62 | -------------------------------------------------------------------------------- /biome.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://biomejs.dev/schemas/1.6.3/schema.json", 3 | "organizeImports": { 4 | "enabled": false 5 | }, 6 | "formatter": { 7 | "enabled": true, 8 | "lineWidth": 120, 9 | "indentStyle": "space" 10 | }, 11 | "linter": { 12 | "enabled": true, 13 | "rules": { 14 | "recommended": true 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /err.md: -------------------------------------------------------------------------------- 1 | #Test 2 | 3 | Test 4 | ## Heading 2 5 | 6 | ## This is a heading. 7 | 8 | For more information, see https://www.example.com/. 9 | 10 | (Incorrect link syntax)[https://www.example.com/] 11 | 12 | Some text 13 | * Some 14 | * List 15 | 16 | Here is some ** bold ** text. 17 | 18 | Here is some * italic * text. 19 | 20 | Here is some more __ bold __ text. 21 | 22 | Here is some more _ italic _ text. 23 | 24 | ` some text ` 25 | 26 | [ a link ](https://www.example.com/) 27 | 28 | ## Item 29 | ### Detail 30 | 31 | * List item 32 | 33 | Sapce: 34 | 35 | * list item text 36 | 37 | * list item text 38 | 39 | Quote: 40 | 41 | > This is a block quote with bad indentation 42 | > there should only be one. 43 | 44 | Code text 45 | ```sh 46 | Code block 47 | ``` 48 | 49 | Some text here 50 | 51 | 52 | Some more text here 53 | 54 | Text * emphasis 55 | emphasis * text 56 | 57 | -------------------------------------------------------------------------------- /esbuild.mjs: -------------------------------------------------------------------------------- 1 | import * as esbuild from "esbuild"; 2 | 3 | const options = { 4 | entryPoints: ["src/index.ts"], 5 | bundle: true, 6 | minify: true, 7 | sourcemap: process.env.NODE_ENV === "development", 8 | mainFields: ["module", "main"], 9 | external: ["coc.nvim"], 10 | platform: "node", 11 | target: "node16.18", 12 | outfile: "lib/index.js", 13 | }; 14 | 15 | if (process.argv.length > 2 && process.argv[2] === "--watch") { 16 | const ctx = await esbuild.context(options); 17 | await ctx.watch(); 18 | console.log("watching..."); 19 | } else { 20 | const result = await esbuild.build(options); 21 | if (result.errors.length) { 22 | console.error(result.errors); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /generate-config-schema.js: -------------------------------------------------------------------------------- 1 | // via https://github.com/DavidAnson/vscode-markdownlint/blob/master/generate-config-schema.js 2 | 3 | const fs = require("node:fs"); 4 | const packageJsonPath = "./package.json"; 5 | const packageJson = require(packageJsonPath); 6 | const configurationSchema = require("./node_modules/markdownlint/schema/markdownlint-config-schema.json"); 7 | const properties = configurationSchema.properties; 8 | for (const k of Object.keys(properties)) { 9 | const v = properties[k]; 10 | if (v.$ref) { 11 | const kk = v.$ref.split("/").pop(); 12 | properties[k] = properties[kk]; 13 | } 14 | } 15 | configurationSchema.properties = properties; 16 | 17 | // Update package.json 18 | const configurationRoot = packageJson.contributes.configuration.properties["markdownlint.config"]; 19 | configurationRoot.properties = configurationSchema.properties; 20 | fs.writeFileSync(packageJsonPath, `${JSON.stringify(packageJson, null, 2)}\n`); 21 | -------------------------------------------------------------------------------- /ok.md: -------------------------------------------------------------------------------- 1 | # Test 2 | 3 | Test 4 | 5 | ## Heading 2 6 | 7 | ## This is a heading 8 | 9 | For more information, see 10 | 11 | [Incorrect link syntax](https://www.example.com/) 12 | 13 | Some text 14 | 15 | - Some 16 | - List 17 | 18 | Here is some **bold** text. 19 | 20 | Here is some _italic_ text. 21 | 22 | Here is some more **bold** text. 23 | 24 | Here is some more _italic_ text. 25 | 26 | `some text` 27 | 28 | [a link](https://www.example.com/) 29 | 30 | ## Item 31 | 32 | ### Detail 33 | 34 | - List item 35 | 36 | Sapce: 37 | 38 | - list item text 39 | 40 | - list item text 41 | 42 | Quote: 43 | 44 | > This is a block quote with bad indentation 45 | > there should only be one. 46 | 47 | Code text 48 | 49 | ```sh 50 | Code block 51 | ``` 52 | 53 | Some text here 54 | 55 | Some more text here 56 | 57 | Text _emphasis 58 | emphasis_ text 59 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "coc-markdownlint", 3 | "version": "1.36.0", 4 | "lockfileVersion": 3, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "coc-markdownlint", 9 | "version": "1.36.0", 10 | "license": "MIT", 11 | "devDependencies": { 12 | "@biomejs/biome": "^1.6.3", 13 | "@types/deep-extend": "^0.6.2", 14 | "@types/js-yaml": "^4.0.9", 15 | "@types/node": "16", 16 | "@types/rc": "^1.2.4", 17 | "coc.nvim": "^0.0.83-next.18", 18 | "deep-extend": "^0.6.0", 19 | "esbuild": "^0.25.0", 20 | "js-yaml": "^4.1.0", 21 | "markdownlint": "^0.36.1", 22 | "rc": "^1.2.8", 23 | "typescript": "^5.3.3" 24 | }, 25 | "engines": { 26 | "coc": "^0.0.80" 27 | } 28 | }, 29 | "node_modules/@biomejs/biome": { 30 | "version": "1.9.4", 31 | "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-1.9.4.tgz", 32 | "integrity": "sha512-1rkd7G70+o9KkTn5KLmDYXihGoTaIGO9PIIN2ZB7UJxFrWw04CZHPYiMRjYsaDvVV7hP1dYNRLxSANLaBFGpog==", 33 | "dev": true, 34 | "hasInstallScript": true, 35 | "bin": { 36 | "biome": "bin/biome" 37 | }, 38 | "engines": { 39 | "node": ">=14.21.3" 40 | }, 41 | "funding": { 42 | "type": "opencollective", 43 | "url": "https://opencollective.com/biome" 44 | }, 45 | "optionalDependencies": { 46 | "@biomejs/cli-darwin-arm64": "1.9.4", 47 | "@biomejs/cli-darwin-x64": "1.9.4", 48 | "@biomejs/cli-linux-arm64": "1.9.4", 49 | "@biomejs/cli-linux-arm64-musl": "1.9.4", 50 | "@biomejs/cli-linux-x64": "1.9.4", 51 | "@biomejs/cli-linux-x64-musl": "1.9.4", 52 | "@biomejs/cli-win32-arm64": "1.9.4", 53 | "@biomejs/cli-win32-x64": "1.9.4" 54 | } 55 | }, 56 | "node_modules/@biomejs/cli-darwin-arm64": { 57 | "version": "1.9.4", 58 | "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-1.9.4.tgz", 59 | "integrity": "sha512-bFBsPWrNvkdKrNCYeAp+xo2HecOGPAy9WyNyB/jKnnedgzl4W4Hb9ZMzYNbf8dMCGmUdSavlYHiR01QaYR58cw==", 60 | "cpu": [ 61 | "arm64" 62 | ], 63 | "dev": true, 64 | "optional": true, 65 | "os": [ 66 | "darwin" 67 | ], 68 | "engines": { 69 | "node": ">=14.21.3" 70 | } 71 | }, 72 | "node_modules/@biomejs/cli-darwin-x64": { 73 | "version": "1.9.4", 74 | "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-1.9.4.tgz", 75 | "integrity": "sha512-ngYBh/+bEedqkSevPVhLP4QfVPCpb+4BBe2p7Xs32dBgs7rh9nY2AIYUL6BgLw1JVXV8GlpKmb/hNiuIxfPfZg==", 76 | "cpu": [ 77 | "x64" 78 | ], 79 | "dev": true, 80 | "optional": true, 81 | "os": [ 82 | "darwin" 83 | ], 84 | "engines": { 85 | "node": ">=14.21.3" 86 | } 87 | }, 88 | "node_modules/@biomejs/cli-linux-arm64": { 89 | "version": "1.9.4", 90 | "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-1.9.4.tgz", 91 | "integrity": "sha512-fJIW0+LYujdjUgJJuwesP4EjIBl/N/TcOX3IvIHJQNsAqvV2CHIogsmA94BPG6jZATS4Hi+xv4SkBBQSt1N4/g==", 92 | "cpu": [ 93 | "arm64" 94 | ], 95 | "dev": true, 96 | "optional": true, 97 | "os": [ 98 | "linux" 99 | ], 100 | "engines": { 101 | "node": ">=14.21.3" 102 | } 103 | }, 104 | "node_modules/@biomejs/cli-linux-arm64-musl": { 105 | "version": "1.9.4", 106 | "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-1.9.4.tgz", 107 | "integrity": "sha512-v665Ct9WCRjGa8+kTr0CzApU0+XXtRgwmzIf1SeKSGAv+2scAlW6JR5PMFo6FzqqZ64Po79cKODKf3/AAmECqA==", 108 | "cpu": [ 109 | "arm64" 110 | ], 111 | "dev": true, 112 | "optional": true, 113 | "os": [ 114 | "linux" 115 | ], 116 | "engines": { 117 | "node": ">=14.21.3" 118 | } 119 | }, 120 | "node_modules/@biomejs/cli-linux-x64": { 121 | "version": "1.9.4", 122 | "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-1.9.4.tgz", 123 | "integrity": "sha512-lRCJv/Vi3Vlwmbd6K+oQ0KhLHMAysN8lXoCI7XeHlxaajk06u7G+UsFSO01NAs5iYuWKmVZjmiOzJ0OJmGsMwg==", 124 | "cpu": [ 125 | "x64" 126 | ], 127 | "dev": true, 128 | "optional": true, 129 | "os": [ 130 | "linux" 131 | ], 132 | "engines": { 133 | "node": ">=14.21.3" 134 | } 135 | }, 136 | "node_modules/@biomejs/cli-linux-x64-musl": { 137 | "version": "1.9.4", 138 | "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-1.9.4.tgz", 139 | "integrity": "sha512-gEhi/jSBhZ2m6wjV530Yy8+fNqG8PAinM3oV7CyO+6c3CEh16Eizm21uHVsyVBEB6RIM8JHIl6AGYCv6Q6Q9Tg==", 140 | "cpu": [ 141 | "x64" 142 | ], 143 | "dev": true, 144 | "optional": true, 145 | "os": [ 146 | "linux" 147 | ], 148 | "engines": { 149 | "node": ">=14.21.3" 150 | } 151 | }, 152 | "node_modules/@biomejs/cli-win32-arm64": { 153 | "version": "1.9.4", 154 | "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-1.9.4.tgz", 155 | "integrity": "sha512-tlbhLk+WXZmgwoIKwHIHEBZUwxml7bRJgk0X2sPyNR3S93cdRq6XulAZRQJ17FYGGzWne0fgrXBKpl7l4M87Hg==", 156 | "cpu": [ 157 | "arm64" 158 | ], 159 | "dev": true, 160 | "optional": true, 161 | "os": [ 162 | "win32" 163 | ], 164 | "engines": { 165 | "node": ">=14.21.3" 166 | } 167 | }, 168 | "node_modules/@biomejs/cli-win32-x64": { 169 | "version": "1.9.4", 170 | "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-1.9.4.tgz", 171 | "integrity": "sha512-8Y5wMhVIPaWe6jw2H+KlEm4wP/f7EW3810ZLmDlrEEy5KvBsb9ECEfu/kMWD484ijfQ8+nIi0giMgu9g1UAuuA==", 172 | "cpu": [ 173 | "x64" 174 | ], 175 | "dev": true, 176 | "optional": true, 177 | "os": [ 178 | "win32" 179 | ], 180 | "engines": { 181 | "node": ">=14.21.3" 182 | } 183 | }, 184 | "node_modules/@esbuild/aix-ppc64": { 185 | "version": "0.25.5", 186 | "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.5.tgz", 187 | "integrity": "sha512-9o3TMmpmftaCMepOdA5k/yDw8SfInyzWWTjYTFCX3kPSDJMROQTb8jg+h9Cnwnmm1vOzvxN7gIfB5V2ewpjtGA==", 188 | "cpu": [ 189 | "ppc64" 190 | ], 191 | "dev": true, 192 | "license": "MIT", 193 | "optional": true, 194 | "os": [ 195 | "aix" 196 | ], 197 | "engines": { 198 | "node": ">=18" 199 | } 200 | }, 201 | "node_modules/@esbuild/android-arm": { 202 | "version": "0.25.5", 203 | "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.5.tgz", 204 | "integrity": "sha512-AdJKSPeEHgi7/ZhuIPtcQKr5RQdo6OO2IL87JkianiMYMPbCtot9fxPbrMiBADOWWm3T2si9stAiVsGbTQFkbA==", 205 | "cpu": [ 206 | "arm" 207 | ], 208 | "dev": true, 209 | "license": "MIT", 210 | "optional": true, 211 | "os": [ 212 | "android" 213 | ], 214 | "engines": { 215 | "node": ">=18" 216 | } 217 | }, 218 | "node_modules/@esbuild/android-arm64": { 219 | "version": "0.25.5", 220 | "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.5.tgz", 221 | "integrity": "sha512-VGzGhj4lJO+TVGV1v8ntCZWJktV7SGCs3Pn1GRWI1SBFtRALoomm8k5E9Pmwg3HOAal2VDc2F9+PM/rEY6oIDg==", 222 | "cpu": [ 223 | "arm64" 224 | ], 225 | "dev": true, 226 | "license": "MIT", 227 | "optional": true, 228 | "os": [ 229 | "android" 230 | ], 231 | "engines": { 232 | "node": ">=18" 233 | } 234 | }, 235 | "node_modules/@esbuild/android-x64": { 236 | "version": "0.25.5", 237 | "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.5.tgz", 238 | "integrity": "sha512-D2GyJT1kjvO//drbRT3Hib9XPwQeWd9vZoBJn+bu/lVsOZ13cqNdDeqIF/xQ5/VmWvMduP6AmXvylO/PIc2isw==", 239 | "cpu": [ 240 | "x64" 241 | ], 242 | "dev": true, 243 | "license": "MIT", 244 | "optional": true, 245 | "os": [ 246 | "android" 247 | ], 248 | "engines": { 249 | "node": ">=18" 250 | } 251 | }, 252 | "node_modules/@esbuild/darwin-arm64": { 253 | "version": "0.25.5", 254 | "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.5.tgz", 255 | "integrity": "sha512-GtaBgammVvdF7aPIgH2jxMDdivezgFu6iKpmT+48+F8Hhg5J/sfnDieg0aeG/jfSvkYQU2/pceFPDKlqZzwnfQ==", 256 | "cpu": [ 257 | "arm64" 258 | ], 259 | "dev": true, 260 | "license": "MIT", 261 | "optional": true, 262 | "os": [ 263 | "darwin" 264 | ], 265 | "engines": { 266 | "node": ">=18" 267 | } 268 | }, 269 | "node_modules/@esbuild/darwin-x64": { 270 | "version": "0.25.5", 271 | "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.5.tgz", 272 | "integrity": "sha512-1iT4FVL0dJ76/q1wd7XDsXrSW+oLoquptvh4CLR4kITDtqi2e/xwXwdCVH8hVHU43wgJdsq7Gxuzcs6Iq/7bxQ==", 273 | "cpu": [ 274 | "x64" 275 | ], 276 | "dev": true, 277 | "license": "MIT", 278 | "optional": true, 279 | "os": [ 280 | "darwin" 281 | ], 282 | "engines": { 283 | "node": ">=18" 284 | } 285 | }, 286 | "node_modules/@esbuild/freebsd-arm64": { 287 | "version": "0.25.5", 288 | "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.5.tgz", 289 | "integrity": "sha512-nk4tGP3JThz4La38Uy/gzyXtpkPW8zSAmoUhK9xKKXdBCzKODMc2adkB2+8om9BDYugz+uGV7sLmpTYzvmz6Sw==", 290 | "cpu": [ 291 | "arm64" 292 | ], 293 | "dev": true, 294 | "license": "MIT", 295 | "optional": true, 296 | "os": [ 297 | "freebsd" 298 | ], 299 | "engines": { 300 | "node": ">=18" 301 | } 302 | }, 303 | "node_modules/@esbuild/freebsd-x64": { 304 | "version": "0.25.5", 305 | "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.5.tgz", 306 | "integrity": "sha512-PrikaNjiXdR2laW6OIjlbeuCPrPaAl0IwPIaRv+SMV8CiM8i2LqVUHFC1+8eORgWyY7yhQY+2U2fA55mBzReaw==", 307 | "cpu": [ 308 | "x64" 309 | ], 310 | "dev": true, 311 | "license": "MIT", 312 | "optional": true, 313 | "os": [ 314 | "freebsd" 315 | ], 316 | "engines": { 317 | "node": ">=18" 318 | } 319 | }, 320 | "node_modules/@esbuild/linux-arm": { 321 | "version": "0.25.5", 322 | "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.5.tgz", 323 | "integrity": "sha512-cPzojwW2okgh7ZlRpcBEtsX7WBuqbLrNXqLU89GxWbNt6uIg78ET82qifUy3W6OVww6ZWobWub5oqZOVtwolfw==", 324 | "cpu": [ 325 | "arm" 326 | ], 327 | "dev": true, 328 | "license": "MIT", 329 | "optional": true, 330 | "os": [ 331 | "linux" 332 | ], 333 | "engines": { 334 | "node": ">=18" 335 | } 336 | }, 337 | "node_modules/@esbuild/linux-arm64": { 338 | "version": "0.25.5", 339 | "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.5.tgz", 340 | "integrity": "sha512-Z9kfb1v6ZlGbWj8EJk9T6czVEjjq2ntSYLY2cw6pAZl4oKtfgQuS4HOq41M/BcoLPzrUbNd+R4BXFyH//nHxVg==", 341 | "cpu": [ 342 | "arm64" 343 | ], 344 | "dev": true, 345 | "license": "MIT", 346 | "optional": true, 347 | "os": [ 348 | "linux" 349 | ], 350 | "engines": { 351 | "node": ">=18" 352 | } 353 | }, 354 | "node_modules/@esbuild/linux-ia32": { 355 | "version": "0.25.5", 356 | "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.5.tgz", 357 | "integrity": "sha512-sQ7l00M8bSv36GLV95BVAdhJ2QsIbCuCjh/uYrWiMQSUuV+LpXwIqhgJDcvMTj+VsQmqAHL2yYaasENvJ7CDKA==", 358 | "cpu": [ 359 | "ia32" 360 | ], 361 | "dev": true, 362 | "license": "MIT", 363 | "optional": true, 364 | "os": [ 365 | "linux" 366 | ], 367 | "engines": { 368 | "node": ">=18" 369 | } 370 | }, 371 | "node_modules/@esbuild/linux-loong64": { 372 | "version": "0.25.5", 373 | "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.5.tgz", 374 | "integrity": "sha512-0ur7ae16hDUC4OL5iEnDb0tZHDxYmuQyhKhsPBV8f99f6Z9KQM02g33f93rNH5A30agMS46u2HP6qTdEt6Q1kg==", 375 | "cpu": [ 376 | "loong64" 377 | ], 378 | "dev": true, 379 | "license": "MIT", 380 | "optional": true, 381 | "os": [ 382 | "linux" 383 | ], 384 | "engines": { 385 | "node": ">=18" 386 | } 387 | }, 388 | "node_modules/@esbuild/linux-mips64el": { 389 | "version": "0.25.5", 390 | "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.5.tgz", 391 | "integrity": "sha512-kB/66P1OsHO5zLz0i6X0RxlQ+3cu0mkxS3TKFvkb5lin6uwZ/ttOkP3Z8lfR9mJOBk14ZwZ9182SIIWFGNmqmg==", 392 | "cpu": [ 393 | "mips64el" 394 | ], 395 | "dev": true, 396 | "license": "MIT", 397 | "optional": true, 398 | "os": [ 399 | "linux" 400 | ], 401 | "engines": { 402 | "node": ">=18" 403 | } 404 | }, 405 | "node_modules/@esbuild/linux-ppc64": { 406 | "version": "0.25.5", 407 | "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.5.tgz", 408 | "integrity": "sha512-UZCmJ7r9X2fe2D6jBmkLBMQetXPXIsZjQJCjgwpVDz+YMcS6oFR27alkgGv3Oqkv07bxdvw7fyB71/olceJhkQ==", 409 | "cpu": [ 410 | "ppc64" 411 | ], 412 | "dev": true, 413 | "license": "MIT", 414 | "optional": true, 415 | "os": [ 416 | "linux" 417 | ], 418 | "engines": { 419 | "node": ">=18" 420 | } 421 | }, 422 | "node_modules/@esbuild/linux-riscv64": { 423 | "version": "0.25.5", 424 | "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.5.tgz", 425 | "integrity": "sha512-kTxwu4mLyeOlsVIFPfQo+fQJAV9mh24xL+y+Bm6ej067sYANjyEw1dNHmvoqxJUCMnkBdKpvOn0Ahql6+4VyeA==", 426 | "cpu": [ 427 | "riscv64" 428 | ], 429 | "dev": true, 430 | "license": "MIT", 431 | "optional": true, 432 | "os": [ 433 | "linux" 434 | ], 435 | "engines": { 436 | "node": ">=18" 437 | } 438 | }, 439 | "node_modules/@esbuild/linux-s390x": { 440 | "version": "0.25.5", 441 | "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.5.tgz", 442 | "integrity": "sha512-K2dSKTKfmdh78uJ3NcWFiqyRrimfdinS5ErLSn3vluHNeHVnBAFWC8a4X5N+7FgVE1EjXS1QDZbpqZBjfrqMTQ==", 443 | "cpu": [ 444 | "s390x" 445 | ], 446 | "dev": true, 447 | "license": "MIT", 448 | "optional": true, 449 | "os": [ 450 | "linux" 451 | ], 452 | "engines": { 453 | "node": ">=18" 454 | } 455 | }, 456 | "node_modules/@esbuild/linux-x64": { 457 | "version": "0.25.5", 458 | "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.5.tgz", 459 | "integrity": "sha512-uhj8N2obKTE6pSZ+aMUbqq+1nXxNjZIIjCjGLfsWvVpy7gKCOL6rsY1MhRh9zLtUtAI7vpgLMK6DxjO8Qm9lJw==", 460 | "cpu": [ 461 | "x64" 462 | ], 463 | "dev": true, 464 | "license": "MIT", 465 | "optional": true, 466 | "os": [ 467 | "linux" 468 | ], 469 | "engines": { 470 | "node": ">=18" 471 | } 472 | }, 473 | "node_modules/@esbuild/netbsd-arm64": { 474 | "version": "0.25.5", 475 | "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.5.tgz", 476 | "integrity": "sha512-pwHtMP9viAy1oHPvgxtOv+OkduK5ugofNTVDilIzBLpoWAM16r7b/mxBvfpuQDpRQFMfuVr5aLcn4yveGvBZvw==", 477 | "cpu": [ 478 | "arm64" 479 | ], 480 | "dev": true, 481 | "license": "MIT", 482 | "optional": true, 483 | "os": [ 484 | "netbsd" 485 | ], 486 | "engines": { 487 | "node": ">=18" 488 | } 489 | }, 490 | "node_modules/@esbuild/netbsd-x64": { 491 | "version": "0.25.5", 492 | "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.5.tgz", 493 | "integrity": "sha512-WOb5fKrvVTRMfWFNCroYWWklbnXH0Q5rZppjq0vQIdlsQKuw6mdSihwSo4RV/YdQ5UCKKvBy7/0ZZYLBZKIbwQ==", 494 | "cpu": [ 495 | "x64" 496 | ], 497 | "dev": true, 498 | "license": "MIT", 499 | "optional": true, 500 | "os": [ 501 | "netbsd" 502 | ], 503 | "engines": { 504 | "node": ">=18" 505 | } 506 | }, 507 | "node_modules/@esbuild/openbsd-arm64": { 508 | "version": "0.25.5", 509 | "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.5.tgz", 510 | "integrity": "sha512-7A208+uQKgTxHd0G0uqZO8UjK2R0DDb4fDmERtARjSHWxqMTye4Erz4zZafx7Di9Cv+lNHYuncAkiGFySoD+Mw==", 511 | "cpu": [ 512 | "arm64" 513 | ], 514 | "dev": true, 515 | "license": "MIT", 516 | "optional": true, 517 | "os": [ 518 | "openbsd" 519 | ], 520 | "engines": { 521 | "node": ">=18" 522 | } 523 | }, 524 | "node_modules/@esbuild/openbsd-x64": { 525 | "version": "0.25.5", 526 | "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.5.tgz", 527 | "integrity": "sha512-G4hE405ErTWraiZ8UiSoesH8DaCsMm0Cay4fsFWOOUcz8b8rC6uCvnagr+gnioEjWn0wC+o1/TAHt+It+MpIMg==", 528 | "cpu": [ 529 | "x64" 530 | ], 531 | "dev": true, 532 | "license": "MIT", 533 | "optional": true, 534 | "os": [ 535 | "openbsd" 536 | ], 537 | "engines": { 538 | "node": ">=18" 539 | } 540 | }, 541 | "node_modules/@esbuild/sunos-x64": { 542 | "version": "0.25.5", 543 | "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.5.tgz", 544 | "integrity": "sha512-l+azKShMy7FxzY0Rj4RCt5VD/q8mG/e+mDivgspo+yL8zW7qEwctQ6YqKX34DTEleFAvCIUviCFX1SDZRSyMQA==", 545 | "cpu": [ 546 | "x64" 547 | ], 548 | "dev": true, 549 | "license": "MIT", 550 | "optional": true, 551 | "os": [ 552 | "sunos" 553 | ], 554 | "engines": { 555 | "node": ">=18" 556 | } 557 | }, 558 | "node_modules/@esbuild/win32-arm64": { 559 | "version": "0.25.5", 560 | "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.5.tgz", 561 | "integrity": "sha512-O2S7SNZzdcFG7eFKgvwUEZ2VG9D/sn/eIiz8XRZ1Q/DO5a3s76Xv0mdBzVM5j5R639lXQmPmSo0iRpHqUUrsxw==", 562 | "cpu": [ 563 | "arm64" 564 | ], 565 | "dev": true, 566 | "license": "MIT", 567 | "optional": true, 568 | "os": [ 569 | "win32" 570 | ], 571 | "engines": { 572 | "node": ">=18" 573 | } 574 | }, 575 | "node_modules/@esbuild/win32-ia32": { 576 | "version": "0.25.5", 577 | "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.5.tgz", 578 | "integrity": "sha512-onOJ02pqs9h1iMJ1PQphR+VZv8qBMQ77Klcsqv9CNW2w6yLqoURLcgERAIurY6QE63bbLuqgP9ATqajFLK5AMQ==", 579 | "cpu": [ 580 | "ia32" 581 | ], 582 | "dev": true, 583 | "license": "MIT", 584 | "optional": true, 585 | "os": [ 586 | "win32" 587 | ], 588 | "engines": { 589 | "node": ">=18" 590 | } 591 | }, 592 | "node_modules/@esbuild/win32-x64": { 593 | "version": "0.25.5", 594 | "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.5.tgz", 595 | "integrity": "sha512-TXv6YnJ8ZMVdX+SXWVBo/0p8LTcrUYngpWjvm91TMjjBQii7Oz11Lw5lbDV5Y0TzuhSJHwiH4hEtC1I42mMS0g==", 596 | "cpu": [ 597 | "x64" 598 | ], 599 | "dev": true, 600 | "license": "MIT", 601 | "optional": true, 602 | "os": [ 603 | "win32" 604 | ], 605 | "engines": { 606 | "node": ">=18" 607 | } 608 | }, 609 | "node_modules/@types/deep-extend": { 610 | "version": "0.6.2", 611 | "resolved": "https://registry.npmjs.org/@types/deep-extend/-/deep-extend-0.6.2.tgz", 612 | "integrity": "sha512-SXvrJf/OSxNJVyzPCocXkrOjn9see3FyeksyYvs201vjROikZTccZLqGbtnjfaEhgj4UG3yFo/OXcIoCiUn/Lw==", 613 | "dev": true 614 | }, 615 | "node_modules/@types/js-yaml": { 616 | "version": "4.0.9", 617 | "resolved": "https://registry.npmjs.org/@types/js-yaml/-/js-yaml-4.0.9.tgz", 618 | "integrity": "sha512-k4MGaQl5TGo/iipqb2UDG2UwjXziSWkh0uysQelTlJpX1qGlpUZYm8PnO4DxG1qBomtJUdYJ6qR6xdIah10JLg==", 619 | "dev": true 620 | }, 621 | "node_modules/@types/minimist": { 622 | "version": "1.2.2", 623 | "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.2.tgz", 624 | "integrity": "sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==", 625 | "dev": true 626 | }, 627 | "node_modules/@types/node": { 628 | "version": "16.18.123", 629 | "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.123.tgz", 630 | "integrity": "sha512-/n7I6V/4agSpJtFDKKFEa763Hc1z3hmvchobHS1TisCOTKD5nxq8NJ2iK7SRIMYL276Q9mgWOx2AWp5n2XI6eA==", 631 | "dev": true 632 | }, 633 | "node_modules/@types/rc": { 634 | "version": "1.2.4", 635 | "resolved": "https://registry.npmjs.org/@types/rc/-/rc-1.2.4.tgz", 636 | "integrity": "sha512-xD6+epQoMH79A1uwmJIq25D+XZ57jUzCQ1DGSvs3tGKdx7QDYOOaMh6m5KBkEIW4+Cy5++bZ7NLDfdpNiYVKYA==", 637 | "dev": true, 638 | "dependencies": { 639 | "@types/minimist": "*" 640 | } 641 | }, 642 | "node_modules/argparse": { 643 | "version": "2.0.1", 644 | "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", 645 | "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", 646 | "dev": true 647 | }, 648 | "node_modules/coc.nvim": { 649 | "version": "0.0.83-next.22", 650 | "resolved": "https://registry.npmjs.org/coc.nvim/-/coc.nvim-0.0.83-next.22.tgz", 651 | "integrity": "sha512-Ru9LOZp/Cz7et51cq+LEEWrM2MaT3u2xBcITn+NKQBk2uxbQcV81zTwOa4e3YWnbLpgmqSeVJ5tVnNlmTrMC2Q==", 652 | "dev": true, 653 | "license": "MIT", 654 | "engines": { 655 | "node": ">=16.18.0" 656 | }, 657 | "funding": { 658 | "type": "opencollective", 659 | "url": "https://opencollective.com/cocnvim" 660 | }, 661 | "peerDependencies": { 662 | "@types/node": "^16.18.0" 663 | } 664 | }, 665 | "node_modules/deep-extend": { 666 | "version": "0.6.0", 667 | "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", 668 | "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", 669 | "dev": true, 670 | "engines": { 671 | "node": ">=4.0.0" 672 | } 673 | }, 674 | "node_modules/entities": { 675 | "version": "4.5.0", 676 | "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", 677 | "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", 678 | "dev": true, 679 | "engines": { 680 | "node": ">=0.12" 681 | }, 682 | "funding": { 683 | "url": "https://github.com/fb55/entities?sponsor=1" 684 | } 685 | }, 686 | "node_modules/esbuild": { 687 | "version": "0.25.5", 688 | "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.5.tgz", 689 | "integrity": "sha512-P8OtKZRv/5J5hhz0cUAdu/cLuPIKXpQl1R9pZtvmHWQvrAUVd0UNIPT4IB4W3rNOqVO0rlqHmCIbSwxh/c9yUQ==", 690 | "dev": true, 691 | "hasInstallScript": true, 692 | "license": "MIT", 693 | "bin": { 694 | "esbuild": "bin/esbuild" 695 | }, 696 | "engines": { 697 | "node": ">=18" 698 | }, 699 | "optionalDependencies": { 700 | "@esbuild/aix-ppc64": "0.25.5", 701 | "@esbuild/android-arm": "0.25.5", 702 | "@esbuild/android-arm64": "0.25.5", 703 | "@esbuild/android-x64": "0.25.5", 704 | "@esbuild/darwin-arm64": "0.25.5", 705 | "@esbuild/darwin-x64": "0.25.5", 706 | "@esbuild/freebsd-arm64": "0.25.5", 707 | "@esbuild/freebsd-x64": "0.25.5", 708 | "@esbuild/linux-arm": "0.25.5", 709 | "@esbuild/linux-arm64": "0.25.5", 710 | "@esbuild/linux-ia32": "0.25.5", 711 | "@esbuild/linux-loong64": "0.25.5", 712 | "@esbuild/linux-mips64el": "0.25.5", 713 | "@esbuild/linux-ppc64": "0.25.5", 714 | "@esbuild/linux-riscv64": "0.25.5", 715 | "@esbuild/linux-s390x": "0.25.5", 716 | "@esbuild/linux-x64": "0.25.5", 717 | "@esbuild/netbsd-arm64": "0.25.5", 718 | "@esbuild/netbsd-x64": "0.25.5", 719 | "@esbuild/openbsd-arm64": "0.25.5", 720 | "@esbuild/openbsd-x64": "0.25.5", 721 | "@esbuild/sunos-x64": "0.25.5", 722 | "@esbuild/win32-arm64": "0.25.5", 723 | "@esbuild/win32-ia32": "0.25.5", 724 | "@esbuild/win32-x64": "0.25.5" 725 | } 726 | }, 727 | "node_modules/ini": { 728 | "version": "1.3.7", 729 | "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.7.tgz", 730 | "integrity": "sha512-iKpRpXP+CrP2jyrxvg1kMUpXDyRUFDWurxbnVT1vQPx+Wz9uCYsMIqYuSBLV+PAaZG/d7kRLKRFc9oDMsH+mFQ==", 731 | "dev": true 732 | }, 733 | "node_modules/js-yaml": { 734 | "version": "4.1.0", 735 | "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", 736 | "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", 737 | "dev": true, 738 | "dependencies": { 739 | "argparse": "^2.0.1" 740 | }, 741 | "bin": { 742 | "js-yaml": "bin/js-yaml.js" 743 | } 744 | }, 745 | "node_modules/linkify-it": { 746 | "version": "5.0.0", 747 | "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-5.0.0.tgz", 748 | "integrity": "sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==", 749 | "dev": true, 750 | "dependencies": { 751 | "uc.micro": "^2.0.0" 752 | } 753 | }, 754 | "node_modules/markdown-it": { 755 | "version": "14.1.0", 756 | "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-14.1.0.tgz", 757 | "integrity": "sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg==", 758 | "dev": true, 759 | "dependencies": { 760 | "argparse": "^2.0.1", 761 | "entities": "^4.4.0", 762 | "linkify-it": "^5.0.0", 763 | "mdurl": "^2.0.0", 764 | "punycode.js": "^2.3.1", 765 | "uc.micro": "^2.1.0" 766 | }, 767 | "bin": { 768 | "markdown-it": "bin/markdown-it.mjs" 769 | } 770 | }, 771 | "node_modules/markdownlint": { 772 | "version": "0.36.1", 773 | "resolved": "https://registry.npmjs.org/markdownlint/-/markdownlint-0.36.1.tgz", 774 | "integrity": "sha512-s73fU2CQN7WCgjhaQUQ8wYESQNzGRNOKDd+3xgVqu8kuTEhmwepd/mxOv1LR2oV046ONrTLBFsM7IoKWNvmy5g==", 775 | "dev": true, 776 | "dependencies": { 777 | "markdown-it": "14.1.0", 778 | "markdownlint-micromark": "0.1.12" 779 | }, 780 | "engines": { 781 | "node": ">=18" 782 | }, 783 | "funding": { 784 | "url": "https://github.com/sponsors/DavidAnson" 785 | } 786 | }, 787 | "node_modules/markdownlint-micromark": { 788 | "version": "0.1.12", 789 | "resolved": "https://registry.npmjs.org/markdownlint-micromark/-/markdownlint-micromark-0.1.12.tgz", 790 | "integrity": "sha512-RlB6EwMGgc0sxcIhOQ2+aq7Zw1V2fBnzbXKGgYK/mVWdT7cz34fteKSwfYeo4rL6+L/q2tyC9QtD/PgZbkdyJQ==", 791 | "dev": true, 792 | "engines": { 793 | "node": ">=18" 794 | }, 795 | "funding": { 796 | "url": "https://github.com/sponsors/DavidAnson" 797 | } 798 | }, 799 | "node_modules/mdurl": { 800 | "version": "2.0.0", 801 | "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-2.0.0.tgz", 802 | "integrity": "sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==", 803 | "dev": true 804 | }, 805 | "node_modules/minimist": { 806 | "version": "1.2.6", 807 | "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", 808 | "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", 809 | "dev": true 810 | }, 811 | "node_modules/punycode.js": { 812 | "version": "2.3.1", 813 | "resolved": "https://registry.npmjs.org/punycode.js/-/punycode.js-2.3.1.tgz", 814 | "integrity": "sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==", 815 | "dev": true, 816 | "engines": { 817 | "node": ">=6" 818 | } 819 | }, 820 | "node_modules/rc": { 821 | "version": "1.2.8", 822 | "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", 823 | "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", 824 | "dev": true, 825 | "dependencies": { 826 | "deep-extend": "^0.6.0", 827 | "ini": "~1.3.0", 828 | "minimist": "^1.2.0", 829 | "strip-json-comments": "~2.0.1" 830 | }, 831 | "bin": { 832 | "rc": "cli.js" 833 | } 834 | }, 835 | "node_modules/strip-json-comments": { 836 | "version": "2.0.1", 837 | "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", 838 | "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo= sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", 839 | "dev": true, 840 | "engines": { 841 | "node": ">=0.10.0" 842 | } 843 | }, 844 | "node_modules/typescript": { 845 | "version": "5.8.3", 846 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", 847 | "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", 848 | "dev": true, 849 | "license": "Apache-2.0", 850 | "bin": { 851 | "tsc": "bin/tsc", 852 | "tsserver": "bin/tsserver" 853 | }, 854 | "engines": { 855 | "node": ">=14.17" 856 | } 857 | }, 858 | "node_modules/uc.micro": { 859 | "version": "2.1.0", 860 | "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-2.1.0.tgz", 861 | "integrity": "sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==", 862 | "dev": true 863 | } 864 | } 865 | } 866 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "coc-markdownlint", 3 | "version": "1.36.0", 4 | "description": "Markdownlint extension for coc.nvim", 5 | "author": "Heyward Fann ", 6 | "license": "MIT", 7 | "main": "lib/index.js", 8 | "keywords": [ 9 | "coc.nvim" 10 | ], 11 | "engines": { 12 | "coc": "^0.0.80" 13 | }, 14 | "scripts": { 15 | "lint": "biome check src/*.ts", 16 | "format": "biome format --write src/*.ts", 17 | "schema": "node generate-config-schema.js", 18 | "build": "node esbuild.mjs", 19 | "prepare": "node esbuild.mjs" 20 | }, 21 | "repository": { 22 | "type": "git", 23 | "url": "git+https://github.com/fannheyward/coc-markdownlint.git" 24 | }, 25 | "devDependencies": { 26 | "@biomejs/biome": "^1.6.3", 27 | "@types/deep-extend": "^0.6.2", 28 | "@types/js-yaml": "^4.0.9", 29 | "@types/node": "16", 30 | "@types/rc": "^1.2.4", 31 | "coc.nvim": "^0.0.83-next.18", 32 | "deep-extend": "^0.6.0", 33 | "esbuild": "^0.25.0", 34 | "js-yaml": "^4.1.0", 35 | "markdownlint": "^0.36.1", 36 | "rc": "^1.2.8", 37 | "typescript": "^5.3.3" 38 | }, 39 | "activationEvents": [ 40 | "onLanguage:markdown" 41 | ], 42 | "contributes": { 43 | "jsonValidation": [ 44 | { 45 | "fileMatch": ".markdownlint.json", 46 | "url": "https://raw.githubusercontent.com/DavidAnson/markdownlint/main/schema/markdownlint-config-schema.json" 47 | } 48 | ], 49 | "snippets": [ 50 | { 51 | "language": "markdown", 52 | "path": "./snippets/snippets.json" 53 | } 54 | ], 55 | "configuration": { 56 | "type": "object", 57 | "title": "coc-markdownlint configuration", 58 | "properties": { 59 | "markdownlint.onOpen": { 60 | "type": "boolean", 61 | "default": true, 62 | "description": "Lint on open a file" 63 | }, 64 | "markdownlint.onSave": { 65 | "type": "boolean", 66 | "default": true, 67 | "description": "Lint on saving a file" 68 | }, 69 | "markdownlint.onChange": { 70 | "type": "boolean", 71 | "default": true, 72 | "description": "Lint on changing a file" 73 | }, 74 | "markdownlint.config": { 75 | "properties": { 76 | "$schema": { 77 | "description": "JSON Schema URI (expected by some editors)", 78 | "type": "string", 79 | "default": "https://raw.githubusercontent.com/DavidAnson/markdownlint/v0.36.1/schema/markdownlint-config-schema.json" 80 | }, 81 | "default": { 82 | "description": "Default state for all rules", 83 | "type": "boolean", 84 | "default": true 85 | }, 86 | "extends": { 87 | "description": "Path to configuration file to extend", 88 | "type": [ 89 | "string", 90 | "null" 91 | ], 92 | "default": null 93 | }, 94 | "MD001": { 95 | "description": "MD001/heading-increment : Heading levels should only increment by one level at a time : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md001.md", 96 | "type": "boolean", 97 | "default": true 98 | }, 99 | "heading-increment": { 100 | "description": "MD001/heading-increment : Heading levels should only increment by one level at a time : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md001.md", 101 | "type": "boolean", 102 | "default": true 103 | }, 104 | "MD003": { 105 | "description": "MD003/heading-style : Heading style : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md003.md", 106 | "type": [ 107 | "boolean", 108 | "object" 109 | ], 110 | "default": true, 111 | "properties": { 112 | "style": { 113 | "description": "Heading style", 114 | "type": "string", 115 | "enum": [ 116 | "consistent", 117 | "atx", 118 | "atx_closed", 119 | "setext", 120 | "setext_with_atx", 121 | "setext_with_atx_closed" 122 | ], 123 | "default": "consistent" 124 | } 125 | }, 126 | "additionalProperties": false 127 | }, 128 | "heading-style": { 129 | "description": "MD003/heading-style : Heading style : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md003.md", 130 | "type": [ 131 | "boolean", 132 | "object" 133 | ], 134 | "default": true, 135 | "properties": { 136 | "style": { 137 | "description": "Heading style", 138 | "type": "string", 139 | "enum": [ 140 | "consistent", 141 | "atx", 142 | "atx_closed", 143 | "setext", 144 | "setext_with_atx", 145 | "setext_with_atx_closed" 146 | ], 147 | "default": "consistent" 148 | } 149 | }, 150 | "additionalProperties": false 151 | }, 152 | "MD004": { 153 | "description": "MD004/ul-style : Unordered list style : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md004.md", 154 | "type": [ 155 | "boolean", 156 | "object" 157 | ], 158 | "default": true, 159 | "properties": { 160 | "style": { 161 | "description": "List style", 162 | "type": "string", 163 | "enum": [ 164 | "consistent", 165 | "asterisk", 166 | "plus", 167 | "dash", 168 | "sublist" 169 | ], 170 | "default": "consistent" 171 | } 172 | }, 173 | "additionalProperties": false 174 | }, 175 | "ul-style": { 176 | "description": "MD004/ul-style : Unordered list style : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md004.md", 177 | "type": [ 178 | "boolean", 179 | "object" 180 | ], 181 | "default": true, 182 | "properties": { 183 | "style": { 184 | "description": "List style", 185 | "type": "string", 186 | "enum": [ 187 | "consistent", 188 | "asterisk", 189 | "plus", 190 | "dash", 191 | "sublist" 192 | ], 193 | "default": "consistent" 194 | } 195 | }, 196 | "additionalProperties": false 197 | }, 198 | "MD005": { 199 | "description": "MD005/list-indent : Inconsistent indentation for list items at the same level : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md005.md", 200 | "type": "boolean", 201 | "default": true 202 | }, 203 | "list-indent": { 204 | "description": "MD005/list-indent : Inconsistent indentation for list items at the same level : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md005.md", 205 | "type": "boolean", 206 | "default": true 207 | }, 208 | "MD007": { 209 | "description": "MD007/ul-indent : Unordered list indentation : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md007.md", 210 | "type": [ 211 | "boolean", 212 | "object" 213 | ], 214 | "default": true, 215 | "properties": { 216 | "indent": { 217 | "description": "Spaces for indent", 218 | "type": "integer", 219 | "minimum": 1, 220 | "default": 2 221 | }, 222 | "start_indented": { 223 | "description": "Whether to indent the first level of the list", 224 | "type": "boolean", 225 | "default": false 226 | }, 227 | "start_indent": { 228 | "description": "Spaces for first level indent (when start_indented is set)", 229 | "type": "integer", 230 | "minimum": 1, 231 | "default": 2 232 | } 233 | }, 234 | "additionalProperties": false 235 | }, 236 | "ul-indent": { 237 | "description": "MD007/ul-indent : Unordered list indentation : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md007.md", 238 | "type": [ 239 | "boolean", 240 | "object" 241 | ], 242 | "default": true, 243 | "properties": { 244 | "indent": { 245 | "description": "Spaces for indent", 246 | "type": "integer", 247 | "minimum": 1, 248 | "default": 2 249 | }, 250 | "start_indented": { 251 | "description": "Whether to indent the first level of the list", 252 | "type": "boolean", 253 | "default": false 254 | }, 255 | "start_indent": { 256 | "description": "Spaces for first level indent (when start_indented is set)", 257 | "type": "integer", 258 | "minimum": 1, 259 | "default": 2 260 | } 261 | }, 262 | "additionalProperties": false 263 | }, 264 | "MD009": { 265 | "description": "MD009/no-trailing-spaces : Trailing spaces : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md009.md", 266 | "type": [ 267 | "boolean", 268 | "object" 269 | ], 270 | "default": true, 271 | "properties": { 272 | "br_spaces": { 273 | "description": "Spaces for line break", 274 | "type": "integer", 275 | "minimum": 0, 276 | "default": 2 277 | }, 278 | "list_item_empty_lines": { 279 | "description": "Allow spaces for empty lines in list items", 280 | "type": "boolean", 281 | "default": false 282 | }, 283 | "strict": { 284 | "description": "Include unnecessary breaks", 285 | "type": "boolean", 286 | "default": false 287 | } 288 | }, 289 | "additionalProperties": false 290 | }, 291 | "no-trailing-spaces": { 292 | "description": "MD009/no-trailing-spaces : Trailing spaces : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md009.md", 293 | "type": [ 294 | "boolean", 295 | "object" 296 | ], 297 | "default": true, 298 | "properties": { 299 | "br_spaces": { 300 | "description": "Spaces for line break", 301 | "type": "integer", 302 | "minimum": 0, 303 | "default": 2 304 | }, 305 | "list_item_empty_lines": { 306 | "description": "Allow spaces for empty lines in list items", 307 | "type": "boolean", 308 | "default": false 309 | }, 310 | "strict": { 311 | "description": "Include unnecessary breaks", 312 | "type": "boolean", 313 | "default": false 314 | } 315 | }, 316 | "additionalProperties": false 317 | }, 318 | "MD010": { 319 | "description": "MD010/no-hard-tabs : Hard tabs : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md010.md", 320 | "type": [ 321 | "boolean", 322 | "object" 323 | ], 324 | "default": true, 325 | "properties": { 326 | "code_blocks": { 327 | "description": "Include code blocks", 328 | "type": "boolean", 329 | "default": true 330 | }, 331 | "ignore_code_languages": { 332 | "description": "Fenced code languages to ignore", 333 | "type": "array", 334 | "items": { 335 | "type": "string" 336 | }, 337 | "default": [] 338 | }, 339 | "spaces_per_tab": { 340 | "description": "Number of spaces for each hard tab", 341 | "type": "integer", 342 | "minimum": 0, 343 | "default": 1 344 | } 345 | }, 346 | "additionalProperties": false 347 | }, 348 | "no-hard-tabs": { 349 | "description": "MD010/no-hard-tabs : Hard tabs : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md010.md", 350 | "type": [ 351 | "boolean", 352 | "object" 353 | ], 354 | "default": true, 355 | "properties": { 356 | "code_blocks": { 357 | "description": "Include code blocks", 358 | "type": "boolean", 359 | "default": true 360 | }, 361 | "ignore_code_languages": { 362 | "description": "Fenced code languages to ignore", 363 | "type": "array", 364 | "items": { 365 | "type": "string" 366 | }, 367 | "default": [] 368 | }, 369 | "spaces_per_tab": { 370 | "description": "Number of spaces for each hard tab", 371 | "type": "integer", 372 | "minimum": 0, 373 | "default": 1 374 | } 375 | }, 376 | "additionalProperties": false 377 | }, 378 | "MD011": { 379 | "description": "MD011/no-reversed-links : Reversed link syntax : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md011.md", 380 | "type": "boolean", 381 | "default": true 382 | }, 383 | "no-reversed-links": { 384 | "description": "MD011/no-reversed-links : Reversed link syntax : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md011.md", 385 | "type": "boolean", 386 | "default": true 387 | }, 388 | "MD012": { 389 | "description": "MD012/no-multiple-blanks : Multiple consecutive blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md012.md", 390 | "type": [ 391 | "boolean", 392 | "object" 393 | ], 394 | "default": true, 395 | "properties": { 396 | "maximum": { 397 | "description": "Consecutive blank lines", 398 | "type": "integer", 399 | "minimum": 1, 400 | "default": 1 401 | } 402 | }, 403 | "additionalProperties": false 404 | }, 405 | "no-multiple-blanks": { 406 | "description": "MD012/no-multiple-blanks : Multiple consecutive blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md012.md", 407 | "type": [ 408 | "boolean", 409 | "object" 410 | ], 411 | "default": true, 412 | "properties": { 413 | "maximum": { 414 | "description": "Consecutive blank lines", 415 | "type": "integer", 416 | "minimum": 1, 417 | "default": 1 418 | } 419 | }, 420 | "additionalProperties": false 421 | }, 422 | "MD013": { 423 | "description": "MD013/line-length : Line length : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md013.md", 424 | "type": [ 425 | "boolean", 426 | "object" 427 | ], 428 | "default": true, 429 | "properties": { 430 | "line_length": { 431 | "description": "Number of characters", 432 | "type": "integer", 433 | "minimum": 1, 434 | "default": 80 435 | }, 436 | "heading_line_length": { 437 | "description": "Number of characters for headings", 438 | "type": "integer", 439 | "minimum": 1, 440 | "default": 80 441 | }, 442 | "code_block_line_length": { 443 | "description": "Number of characters for code blocks", 444 | "type": "integer", 445 | "minimum": 1, 446 | "default": 80 447 | }, 448 | "code_blocks": { 449 | "description": "Include code blocks", 450 | "type": "boolean", 451 | "default": true 452 | }, 453 | "tables": { 454 | "description": "Include tables", 455 | "type": "boolean", 456 | "default": true 457 | }, 458 | "headings": { 459 | "description": "Include headings", 460 | "type": "boolean", 461 | "default": true 462 | }, 463 | "strict": { 464 | "description": "Strict length checking", 465 | "type": "boolean", 466 | "default": false 467 | }, 468 | "stern": { 469 | "description": "Stern length checking", 470 | "type": "boolean", 471 | "default": false 472 | } 473 | }, 474 | "additionalProperties": false 475 | }, 476 | "line-length": { 477 | "description": "MD013/line-length : Line length : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md013.md", 478 | "type": [ 479 | "boolean", 480 | "object" 481 | ], 482 | "default": true, 483 | "properties": { 484 | "line_length": { 485 | "description": "Number of characters", 486 | "type": "integer", 487 | "minimum": 1, 488 | "default": 80 489 | }, 490 | "heading_line_length": { 491 | "description": "Number of characters for headings", 492 | "type": "integer", 493 | "minimum": 1, 494 | "default": 80 495 | }, 496 | "code_block_line_length": { 497 | "description": "Number of characters for code blocks", 498 | "type": "integer", 499 | "minimum": 1, 500 | "default": 80 501 | }, 502 | "code_blocks": { 503 | "description": "Include code blocks", 504 | "type": "boolean", 505 | "default": true 506 | }, 507 | "tables": { 508 | "description": "Include tables", 509 | "type": "boolean", 510 | "default": true 511 | }, 512 | "headings": { 513 | "description": "Include headings", 514 | "type": "boolean", 515 | "default": true 516 | }, 517 | "strict": { 518 | "description": "Strict length checking", 519 | "type": "boolean", 520 | "default": false 521 | }, 522 | "stern": { 523 | "description": "Stern length checking", 524 | "type": "boolean", 525 | "default": false 526 | } 527 | }, 528 | "additionalProperties": false 529 | }, 530 | "MD014": { 531 | "description": "MD014/commands-show-output : Dollar signs used before commands without showing output : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md014.md", 532 | "type": "boolean", 533 | "default": true 534 | }, 535 | "commands-show-output": { 536 | "description": "MD014/commands-show-output : Dollar signs used before commands without showing output : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md014.md", 537 | "type": "boolean", 538 | "default": true 539 | }, 540 | "MD018": { 541 | "description": "MD018/no-missing-space-atx : No space after hash on atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md018.md", 542 | "type": "boolean", 543 | "default": true 544 | }, 545 | "no-missing-space-atx": { 546 | "description": "MD018/no-missing-space-atx : No space after hash on atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md018.md", 547 | "type": "boolean", 548 | "default": true 549 | }, 550 | "MD019": { 551 | "description": "MD019/no-multiple-space-atx : Multiple spaces after hash on atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md019.md", 552 | "type": "boolean", 553 | "default": true 554 | }, 555 | "no-multiple-space-atx": { 556 | "description": "MD019/no-multiple-space-atx : Multiple spaces after hash on atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md019.md", 557 | "type": "boolean", 558 | "default": true 559 | }, 560 | "MD020": { 561 | "description": "MD020/no-missing-space-closed-atx : No space inside hashes on closed atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md020.md", 562 | "type": "boolean", 563 | "default": true 564 | }, 565 | "no-missing-space-closed-atx": { 566 | "description": "MD020/no-missing-space-closed-atx : No space inside hashes on closed atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md020.md", 567 | "type": "boolean", 568 | "default": true 569 | }, 570 | "MD021": { 571 | "description": "MD021/no-multiple-space-closed-atx : Multiple spaces inside hashes on closed atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md021.md", 572 | "type": "boolean", 573 | "default": true 574 | }, 575 | "no-multiple-space-closed-atx": { 576 | "description": "MD021/no-multiple-space-closed-atx : Multiple spaces inside hashes on closed atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md021.md", 577 | "type": "boolean", 578 | "default": true 579 | }, 580 | "MD022": { 581 | "description": "MD022/blanks-around-headings : Headings should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md022.md", 582 | "type": [ 583 | "boolean", 584 | "object" 585 | ], 586 | "default": true, 587 | "properties": { 588 | "lines_above": { 589 | "description": "Blank lines above heading", 590 | "type": [ 591 | "integer", 592 | "array" 593 | ], 594 | "items": { 595 | "type": "integer" 596 | }, 597 | "minimum": -1, 598 | "default": 1 599 | }, 600 | "lines_below": { 601 | "description": "Blank lines below heading", 602 | "type": [ 603 | "integer", 604 | "array" 605 | ], 606 | "items": { 607 | "type": "integer" 608 | }, 609 | "minimum": -1, 610 | "default": 1 611 | } 612 | }, 613 | "additionalProperties": false 614 | }, 615 | "blanks-around-headings": { 616 | "description": "MD022/blanks-around-headings : Headings should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md022.md", 617 | "type": [ 618 | "boolean", 619 | "object" 620 | ], 621 | "default": true, 622 | "properties": { 623 | "lines_above": { 624 | "description": "Blank lines above heading", 625 | "type": [ 626 | "integer", 627 | "array" 628 | ], 629 | "items": { 630 | "type": "integer" 631 | }, 632 | "minimum": -1, 633 | "default": 1 634 | }, 635 | "lines_below": { 636 | "description": "Blank lines below heading", 637 | "type": [ 638 | "integer", 639 | "array" 640 | ], 641 | "items": { 642 | "type": "integer" 643 | }, 644 | "minimum": -1, 645 | "default": 1 646 | } 647 | }, 648 | "additionalProperties": false 649 | }, 650 | "MD023": { 651 | "description": "MD023/heading-start-left : Headings must start at the beginning of the line : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md023.md", 652 | "type": "boolean", 653 | "default": true 654 | }, 655 | "heading-start-left": { 656 | "description": "MD023/heading-start-left : Headings must start at the beginning of the line : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md023.md", 657 | "type": "boolean", 658 | "default": true 659 | }, 660 | "MD024": { 661 | "description": "MD024/no-duplicate-heading : Multiple headings with the same content : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md024.md", 662 | "type": [ 663 | "boolean", 664 | "object" 665 | ], 666 | "default": true, 667 | "properties": { 668 | "siblings_only": { 669 | "description": "Only check sibling headings", 670 | "type": "boolean", 671 | "default": false 672 | } 673 | }, 674 | "additionalProperties": false 675 | }, 676 | "no-duplicate-heading": { 677 | "description": "MD024/no-duplicate-heading : Multiple headings with the same content : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md024.md", 678 | "type": [ 679 | "boolean", 680 | "object" 681 | ], 682 | "default": true, 683 | "properties": { 684 | "siblings_only": { 685 | "description": "Only check sibling headings", 686 | "type": "boolean", 687 | "default": false 688 | } 689 | }, 690 | "additionalProperties": false 691 | }, 692 | "MD025": { 693 | "description": "MD025/single-title/single-h1 : Multiple top-level headings in the same document : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md025.md", 694 | "type": [ 695 | "boolean", 696 | "object" 697 | ], 698 | "default": true, 699 | "properties": { 700 | "level": { 701 | "description": "Heading level", 702 | "type": "integer", 703 | "minimum": 1, 704 | "maximum": 6, 705 | "default": 1 706 | }, 707 | "front_matter_title": { 708 | "description": "RegExp for matching title in front matter", 709 | "type": "string", 710 | "default": "^\\s*title\\s*[:=]" 711 | } 712 | }, 713 | "additionalProperties": false 714 | }, 715 | "single-title": { 716 | "description": "MD025/single-title/single-h1 : Multiple top-level headings in the same document : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md025.md", 717 | "type": [ 718 | "boolean", 719 | "object" 720 | ], 721 | "default": true, 722 | "properties": { 723 | "level": { 724 | "description": "Heading level", 725 | "type": "integer", 726 | "minimum": 1, 727 | "maximum": 6, 728 | "default": 1 729 | }, 730 | "front_matter_title": { 731 | "description": "RegExp for matching title in front matter", 732 | "type": "string", 733 | "default": "^\\s*title\\s*[:=]" 734 | } 735 | }, 736 | "additionalProperties": false 737 | }, 738 | "single-h1": { 739 | "description": "MD025/single-title/single-h1 : Multiple top-level headings in the same document : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md025.md", 740 | "type": [ 741 | "boolean", 742 | "object" 743 | ], 744 | "default": true, 745 | "properties": { 746 | "level": { 747 | "description": "Heading level", 748 | "type": "integer", 749 | "minimum": 1, 750 | "maximum": 6, 751 | "default": 1 752 | }, 753 | "front_matter_title": { 754 | "description": "RegExp for matching title in front matter", 755 | "type": "string", 756 | "default": "^\\s*title\\s*[:=]" 757 | } 758 | }, 759 | "additionalProperties": false 760 | }, 761 | "MD026": { 762 | "description": "MD026/no-trailing-punctuation : Trailing punctuation in heading : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md026.md", 763 | "type": [ 764 | "boolean", 765 | "object" 766 | ], 767 | "default": true, 768 | "properties": { 769 | "punctuation": { 770 | "description": "Punctuation characters", 771 | "type": "string", 772 | "default": ".,;:!。,;:!" 773 | } 774 | }, 775 | "additionalProperties": false 776 | }, 777 | "no-trailing-punctuation": { 778 | "description": "MD026/no-trailing-punctuation : Trailing punctuation in heading : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md026.md", 779 | "type": [ 780 | "boolean", 781 | "object" 782 | ], 783 | "default": true, 784 | "properties": { 785 | "punctuation": { 786 | "description": "Punctuation characters", 787 | "type": "string", 788 | "default": ".,;:!。,;:!" 789 | } 790 | }, 791 | "additionalProperties": false 792 | }, 793 | "MD027": { 794 | "description": "MD027/no-multiple-space-blockquote : Multiple spaces after blockquote symbol : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md027.md", 795 | "type": "boolean", 796 | "default": true 797 | }, 798 | "no-multiple-space-blockquote": { 799 | "description": "MD027/no-multiple-space-blockquote : Multiple spaces after blockquote symbol : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md027.md", 800 | "type": "boolean", 801 | "default": true 802 | }, 803 | "MD028": { 804 | "description": "MD028/no-blanks-blockquote : Blank line inside blockquote : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md028.md", 805 | "type": "boolean", 806 | "default": true 807 | }, 808 | "no-blanks-blockquote": { 809 | "description": "MD028/no-blanks-blockquote : Blank line inside blockquote : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md028.md", 810 | "type": "boolean", 811 | "default": true 812 | }, 813 | "MD029": { 814 | "description": "MD029/ol-prefix : Ordered list item prefix : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md029.md", 815 | "type": [ 816 | "boolean", 817 | "object" 818 | ], 819 | "default": true, 820 | "properties": { 821 | "style": { 822 | "description": "List style", 823 | "type": "string", 824 | "enum": [ 825 | "one", 826 | "ordered", 827 | "one_or_ordered", 828 | "zero" 829 | ], 830 | "default": "one_or_ordered" 831 | } 832 | }, 833 | "additionalProperties": false 834 | }, 835 | "ol-prefix": { 836 | "description": "MD029/ol-prefix : Ordered list item prefix : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md029.md", 837 | "type": [ 838 | "boolean", 839 | "object" 840 | ], 841 | "default": true, 842 | "properties": { 843 | "style": { 844 | "description": "List style", 845 | "type": "string", 846 | "enum": [ 847 | "one", 848 | "ordered", 849 | "one_or_ordered", 850 | "zero" 851 | ], 852 | "default": "one_or_ordered" 853 | } 854 | }, 855 | "additionalProperties": false 856 | }, 857 | "MD030": { 858 | "description": "MD030/list-marker-space : Spaces after list markers : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md030.md", 859 | "type": [ 860 | "boolean", 861 | "object" 862 | ], 863 | "default": true, 864 | "properties": { 865 | "ul_single": { 866 | "description": "Spaces for single-line unordered list items", 867 | "type": "integer", 868 | "minimum": 1, 869 | "default": 1 870 | }, 871 | "ol_single": { 872 | "description": "Spaces for single-line ordered list items", 873 | "type": "integer", 874 | "minimum": 1, 875 | "default": 1 876 | }, 877 | "ul_multi": { 878 | "description": "Spaces for multi-line unordered list items", 879 | "type": "integer", 880 | "minimum": 1, 881 | "default": 1 882 | }, 883 | "ol_multi": { 884 | "description": "Spaces for multi-line ordered list items", 885 | "type": "integer", 886 | "minimum": 1, 887 | "default": 1 888 | } 889 | }, 890 | "additionalProperties": false 891 | }, 892 | "list-marker-space": { 893 | "description": "MD030/list-marker-space : Spaces after list markers : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md030.md", 894 | "type": [ 895 | "boolean", 896 | "object" 897 | ], 898 | "default": true, 899 | "properties": { 900 | "ul_single": { 901 | "description": "Spaces for single-line unordered list items", 902 | "type": "integer", 903 | "minimum": 1, 904 | "default": 1 905 | }, 906 | "ol_single": { 907 | "description": "Spaces for single-line ordered list items", 908 | "type": "integer", 909 | "minimum": 1, 910 | "default": 1 911 | }, 912 | "ul_multi": { 913 | "description": "Spaces for multi-line unordered list items", 914 | "type": "integer", 915 | "minimum": 1, 916 | "default": 1 917 | }, 918 | "ol_multi": { 919 | "description": "Spaces for multi-line ordered list items", 920 | "type": "integer", 921 | "minimum": 1, 922 | "default": 1 923 | } 924 | }, 925 | "additionalProperties": false 926 | }, 927 | "MD031": { 928 | "description": "MD031/blanks-around-fences : Fenced code blocks should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md031.md", 929 | "type": [ 930 | "boolean", 931 | "object" 932 | ], 933 | "default": true, 934 | "properties": { 935 | "list_items": { 936 | "description": "Include list items", 937 | "type": "boolean", 938 | "default": true 939 | } 940 | }, 941 | "additionalProperties": false 942 | }, 943 | "blanks-around-fences": { 944 | "description": "MD031/blanks-around-fences : Fenced code blocks should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md031.md", 945 | "type": [ 946 | "boolean", 947 | "object" 948 | ], 949 | "default": true, 950 | "properties": { 951 | "list_items": { 952 | "description": "Include list items", 953 | "type": "boolean", 954 | "default": true 955 | } 956 | }, 957 | "additionalProperties": false 958 | }, 959 | "MD032": { 960 | "description": "MD032/blanks-around-lists : Lists should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md032.md", 961 | "type": "boolean", 962 | "default": true 963 | }, 964 | "blanks-around-lists": { 965 | "description": "MD032/blanks-around-lists : Lists should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md032.md", 966 | "type": "boolean", 967 | "default": true 968 | }, 969 | "MD033": { 970 | "description": "MD033/no-inline-html : Inline HTML : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md033.md", 971 | "type": [ 972 | "boolean", 973 | "object" 974 | ], 975 | "default": true, 976 | "properties": { 977 | "allowed_elements": { 978 | "description": "Allowed elements", 979 | "type": "array", 980 | "items": { 981 | "type": "string" 982 | }, 983 | "default": [] 984 | } 985 | }, 986 | "additionalProperties": false 987 | }, 988 | "no-inline-html": { 989 | "description": "MD033/no-inline-html : Inline HTML : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md033.md", 990 | "type": [ 991 | "boolean", 992 | "object" 993 | ], 994 | "default": true, 995 | "properties": { 996 | "allowed_elements": { 997 | "description": "Allowed elements", 998 | "type": "array", 999 | "items": { 1000 | "type": "string" 1001 | }, 1002 | "default": [] 1003 | } 1004 | }, 1005 | "additionalProperties": false 1006 | }, 1007 | "MD034": { 1008 | "description": "MD034/no-bare-urls : Bare URL used : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md034.md", 1009 | "type": "boolean", 1010 | "default": true 1011 | }, 1012 | "no-bare-urls": { 1013 | "description": "MD034/no-bare-urls : Bare URL used : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md034.md", 1014 | "type": "boolean", 1015 | "default": true 1016 | }, 1017 | "MD035": { 1018 | "description": "MD035/hr-style : Horizontal rule style : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md035.md", 1019 | "type": [ 1020 | "boolean", 1021 | "object" 1022 | ], 1023 | "default": true, 1024 | "properties": { 1025 | "style": { 1026 | "description": "Horizontal rule style", 1027 | "type": "string", 1028 | "default": "consistent" 1029 | } 1030 | }, 1031 | "additionalProperties": false 1032 | }, 1033 | "hr-style": { 1034 | "description": "MD035/hr-style : Horizontal rule style : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md035.md", 1035 | "type": [ 1036 | "boolean", 1037 | "object" 1038 | ], 1039 | "default": true, 1040 | "properties": { 1041 | "style": { 1042 | "description": "Horizontal rule style", 1043 | "type": "string", 1044 | "default": "consistent" 1045 | } 1046 | }, 1047 | "additionalProperties": false 1048 | }, 1049 | "MD036": { 1050 | "description": "MD036/no-emphasis-as-heading : Emphasis used instead of a heading : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md036.md", 1051 | "type": [ 1052 | "boolean", 1053 | "object" 1054 | ], 1055 | "default": true, 1056 | "properties": { 1057 | "punctuation": { 1058 | "description": "Punctuation characters", 1059 | "type": "string", 1060 | "default": ".,;:!?。,;:!?" 1061 | } 1062 | }, 1063 | "additionalProperties": false 1064 | }, 1065 | "no-emphasis-as-heading": { 1066 | "description": "MD036/no-emphasis-as-heading : Emphasis used instead of a heading : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md036.md", 1067 | "type": [ 1068 | "boolean", 1069 | "object" 1070 | ], 1071 | "default": true, 1072 | "properties": { 1073 | "punctuation": { 1074 | "description": "Punctuation characters", 1075 | "type": "string", 1076 | "default": ".,;:!?。,;:!?" 1077 | } 1078 | }, 1079 | "additionalProperties": false 1080 | }, 1081 | "MD037": { 1082 | "description": "MD037/no-space-in-emphasis : Spaces inside emphasis markers : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md037.md", 1083 | "type": "boolean", 1084 | "default": true 1085 | }, 1086 | "no-space-in-emphasis": { 1087 | "description": "MD037/no-space-in-emphasis : Spaces inside emphasis markers : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md037.md", 1088 | "type": "boolean", 1089 | "default": true 1090 | }, 1091 | "MD038": { 1092 | "description": "MD038/no-space-in-code : Spaces inside code span elements : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md038.md", 1093 | "type": "boolean", 1094 | "default": true 1095 | }, 1096 | "no-space-in-code": { 1097 | "description": "MD038/no-space-in-code : Spaces inside code span elements : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md038.md", 1098 | "type": "boolean", 1099 | "default": true 1100 | }, 1101 | "MD039": { 1102 | "description": "MD039/no-space-in-links : Spaces inside link text : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md039.md", 1103 | "type": "boolean", 1104 | "default": true 1105 | }, 1106 | "no-space-in-links": { 1107 | "description": "MD039/no-space-in-links : Spaces inside link text : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md039.md", 1108 | "type": "boolean", 1109 | "default": true 1110 | }, 1111 | "MD040": { 1112 | "description": "MD040/fenced-code-language : Fenced code blocks should have a language specified : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md040.md", 1113 | "type": [ 1114 | "boolean", 1115 | "object" 1116 | ], 1117 | "default": true, 1118 | "properties": { 1119 | "allowed_languages": { 1120 | "description": "List of languages", 1121 | "type": "array", 1122 | "items": { 1123 | "type": "string" 1124 | }, 1125 | "default": [] 1126 | }, 1127 | "language_only": { 1128 | "description": "Require language only", 1129 | "type": "boolean", 1130 | "default": false 1131 | } 1132 | }, 1133 | "additionalProperties": false 1134 | }, 1135 | "fenced-code-language": { 1136 | "description": "MD040/fenced-code-language : Fenced code blocks should have a language specified : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md040.md", 1137 | "type": [ 1138 | "boolean", 1139 | "object" 1140 | ], 1141 | "default": true, 1142 | "properties": { 1143 | "allowed_languages": { 1144 | "description": "List of languages", 1145 | "type": "array", 1146 | "items": { 1147 | "type": "string" 1148 | }, 1149 | "default": [] 1150 | }, 1151 | "language_only": { 1152 | "description": "Require language only", 1153 | "type": "boolean", 1154 | "default": false 1155 | } 1156 | }, 1157 | "additionalProperties": false 1158 | }, 1159 | "MD041": { 1160 | "description": "MD041/first-line-heading/first-line-h1 : First line in a file should be a top-level heading : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md041.md", 1161 | "type": [ 1162 | "boolean", 1163 | "object" 1164 | ], 1165 | "default": true, 1166 | "properties": { 1167 | "level": { 1168 | "description": "Heading level", 1169 | "type": "integer", 1170 | "minimum": 1, 1171 | "maximum": 6, 1172 | "default": 1 1173 | }, 1174 | "front_matter_title": { 1175 | "description": "RegExp for matching title in front matter", 1176 | "type": "string", 1177 | "default": "^\\s*title\\s*[:=]" 1178 | } 1179 | }, 1180 | "additionalProperties": false 1181 | }, 1182 | "first-line-heading": { 1183 | "description": "MD041/first-line-heading/first-line-h1 : First line in a file should be a top-level heading : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md041.md", 1184 | "type": [ 1185 | "boolean", 1186 | "object" 1187 | ], 1188 | "default": true, 1189 | "properties": { 1190 | "level": { 1191 | "description": "Heading level", 1192 | "type": "integer", 1193 | "minimum": 1, 1194 | "maximum": 6, 1195 | "default": 1 1196 | }, 1197 | "front_matter_title": { 1198 | "description": "RegExp for matching title in front matter", 1199 | "type": "string", 1200 | "default": "^\\s*title\\s*[:=]" 1201 | } 1202 | }, 1203 | "additionalProperties": false 1204 | }, 1205 | "first-line-h1": { 1206 | "description": "MD041/first-line-heading/first-line-h1 : First line in a file should be a top-level heading : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md041.md", 1207 | "type": [ 1208 | "boolean", 1209 | "object" 1210 | ], 1211 | "default": true, 1212 | "properties": { 1213 | "level": { 1214 | "description": "Heading level", 1215 | "type": "integer", 1216 | "minimum": 1, 1217 | "maximum": 6, 1218 | "default": 1 1219 | }, 1220 | "front_matter_title": { 1221 | "description": "RegExp for matching title in front matter", 1222 | "type": "string", 1223 | "default": "^\\s*title\\s*[:=]" 1224 | } 1225 | }, 1226 | "additionalProperties": false 1227 | }, 1228 | "MD042": { 1229 | "description": "MD042/no-empty-links : No empty links : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md042.md", 1230 | "type": "boolean", 1231 | "default": true 1232 | }, 1233 | "no-empty-links": { 1234 | "description": "MD042/no-empty-links : No empty links : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md042.md", 1235 | "type": "boolean", 1236 | "default": true 1237 | }, 1238 | "MD043": { 1239 | "description": "MD043/required-headings : Required heading structure : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md043.md", 1240 | "type": [ 1241 | "boolean", 1242 | "object" 1243 | ], 1244 | "default": true, 1245 | "properties": { 1246 | "headings": { 1247 | "description": "List of headings", 1248 | "type": "array", 1249 | "items": { 1250 | "type": "string", 1251 | "pattern": "^(\\*|\\+|#{1,6} .*)$" 1252 | }, 1253 | "default": [] 1254 | }, 1255 | "match_case": { 1256 | "description": "Match case of headings", 1257 | "type": "boolean", 1258 | "default": false 1259 | } 1260 | }, 1261 | "additionalProperties": false 1262 | }, 1263 | "required-headings": { 1264 | "description": "MD043/required-headings : Required heading structure : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md043.md", 1265 | "type": [ 1266 | "boolean", 1267 | "object" 1268 | ], 1269 | "default": true, 1270 | "properties": { 1271 | "headings": { 1272 | "description": "List of headings", 1273 | "type": "array", 1274 | "items": { 1275 | "type": "string", 1276 | "pattern": "^(\\*|\\+|#{1,6} .*)$" 1277 | }, 1278 | "default": [] 1279 | }, 1280 | "match_case": { 1281 | "description": "Match case of headings", 1282 | "type": "boolean", 1283 | "default": false 1284 | } 1285 | }, 1286 | "additionalProperties": false 1287 | }, 1288 | "MD044": { 1289 | "description": "MD044/proper-names : Proper names should have the correct capitalization : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md044.md", 1290 | "type": [ 1291 | "boolean", 1292 | "object" 1293 | ], 1294 | "default": true, 1295 | "properties": { 1296 | "names": { 1297 | "description": "List of proper names", 1298 | "type": "array", 1299 | "items": { 1300 | "type": "string" 1301 | }, 1302 | "default": [] 1303 | }, 1304 | "code_blocks": { 1305 | "description": "Include code blocks", 1306 | "type": "boolean", 1307 | "default": true 1308 | }, 1309 | "html_elements": { 1310 | "description": "Include HTML elements", 1311 | "type": "boolean", 1312 | "default": true 1313 | } 1314 | }, 1315 | "additionalProperties": false 1316 | }, 1317 | "proper-names": { 1318 | "description": "MD044/proper-names : Proper names should have the correct capitalization : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md044.md", 1319 | "type": [ 1320 | "boolean", 1321 | "object" 1322 | ], 1323 | "default": true, 1324 | "properties": { 1325 | "names": { 1326 | "description": "List of proper names", 1327 | "type": "array", 1328 | "items": { 1329 | "type": "string" 1330 | }, 1331 | "default": [] 1332 | }, 1333 | "code_blocks": { 1334 | "description": "Include code blocks", 1335 | "type": "boolean", 1336 | "default": true 1337 | }, 1338 | "html_elements": { 1339 | "description": "Include HTML elements", 1340 | "type": "boolean", 1341 | "default": true 1342 | } 1343 | }, 1344 | "additionalProperties": false 1345 | }, 1346 | "MD045": { 1347 | "description": "MD045/no-alt-text : Images should have alternate text (alt text) : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md045.md", 1348 | "type": "boolean", 1349 | "default": true 1350 | }, 1351 | "no-alt-text": { 1352 | "description": "MD045/no-alt-text : Images should have alternate text (alt text) : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md045.md", 1353 | "type": "boolean", 1354 | "default": true 1355 | }, 1356 | "MD046": { 1357 | "description": "MD046/code-block-style : Code block style : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md046.md", 1358 | "type": [ 1359 | "boolean", 1360 | "object" 1361 | ], 1362 | "default": true, 1363 | "properties": { 1364 | "style": { 1365 | "description": "Block style", 1366 | "type": "string", 1367 | "enum": [ 1368 | "consistent", 1369 | "fenced", 1370 | "indented" 1371 | ], 1372 | "default": "consistent" 1373 | } 1374 | }, 1375 | "additionalProperties": false 1376 | }, 1377 | "code-block-style": { 1378 | "description": "MD046/code-block-style : Code block style : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md046.md", 1379 | "type": [ 1380 | "boolean", 1381 | "object" 1382 | ], 1383 | "default": true, 1384 | "properties": { 1385 | "style": { 1386 | "description": "Block style", 1387 | "type": "string", 1388 | "enum": [ 1389 | "consistent", 1390 | "fenced", 1391 | "indented" 1392 | ], 1393 | "default": "consistent" 1394 | } 1395 | }, 1396 | "additionalProperties": false 1397 | }, 1398 | "MD047": { 1399 | "description": "MD047/single-trailing-newline : Files should end with a single newline character : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md047.md", 1400 | "type": "boolean", 1401 | "default": true 1402 | }, 1403 | "single-trailing-newline": { 1404 | "description": "MD047/single-trailing-newline : Files should end with a single newline character : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md047.md", 1405 | "type": "boolean", 1406 | "default": true 1407 | }, 1408 | "MD048": { 1409 | "description": "MD048/code-fence-style : Code fence style : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md048.md", 1410 | "type": [ 1411 | "boolean", 1412 | "object" 1413 | ], 1414 | "default": true, 1415 | "properties": { 1416 | "style": { 1417 | "description": "Code fence style", 1418 | "type": "string", 1419 | "enum": [ 1420 | "consistent", 1421 | "backtick", 1422 | "tilde" 1423 | ], 1424 | "default": "consistent" 1425 | } 1426 | }, 1427 | "additionalProperties": false 1428 | }, 1429 | "code-fence-style": { 1430 | "description": "MD048/code-fence-style : Code fence style : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md048.md", 1431 | "type": [ 1432 | "boolean", 1433 | "object" 1434 | ], 1435 | "default": true, 1436 | "properties": { 1437 | "style": { 1438 | "description": "Code fence style", 1439 | "type": "string", 1440 | "enum": [ 1441 | "consistent", 1442 | "backtick", 1443 | "tilde" 1444 | ], 1445 | "default": "consistent" 1446 | } 1447 | }, 1448 | "additionalProperties": false 1449 | }, 1450 | "MD049": { 1451 | "description": "MD049/emphasis-style : Emphasis style : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md049.md", 1452 | "type": [ 1453 | "boolean", 1454 | "object" 1455 | ], 1456 | "default": true, 1457 | "properties": { 1458 | "style": { 1459 | "description": "Emphasis style", 1460 | "type": "string", 1461 | "enum": [ 1462 | "consistent", 1463 | "asterisk", 1464 | "underscore" 1465 | ], 1466 | "default": "consistent" 1467 | } 1468 | }, 1469 | "additionalProperties": false 1470 | }, 1471 | "emphasis-style": { 1472 | "description": "MD049/emphasis-style : Emphasis style : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md049.md", 1473 | "type": [ 1474 | "boolean", 1475 | "object" 1476 | ], 1477 | "default": true, 1478 | "properties": { 1479 | "style": { 1480 | "description": "Emphasis style", 1481 | "type": "string", 1482 | "enum": [ 1483 | "consistent", 1484 | "asterisk", 1485 | "underscore" 1486 | ], 1487 | "default": "consistent" 1488 | } 1489 | }, 1490 | "additionalProperties": false 1491 | }, 1492 | "MD050": { 1493 | "description": "MD050/strong-style : Strong style : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md050.md", 1494 | "type": [ 1495 | "boolean", 1496 | "object" 1497 | ], 1498 | "default": true, 1499 | "properties": { 1500 | "style": { 1501 | "description": "Strong style", 1502 | "type": "string", 1503 | "enum": [ 1504 | "consistent", 1505 | "asterisk", 1506 | "underscore" 1507 | ], 1508 | "default": "consistent" 1509 | } 1510 | }, 1511 | "additionalProperties": false 1512 | }, 1513 | "strong-style": { 1514 | "description": "MD050/strong-style : Strong style : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md050.md", 1515 | "type": [ 1516 | "boolean", 1517 | "object" 1518 | ], 1519 | "default": true, 1520 | "properties": { 1521 | "style": { 1522 | "description": "Strong style", 1523 | "type": "string", 1524 | "enum": [ 1525 | "consistent", 1526 | "asterisk", 1527 | "underscore" 1528 | ], 1529 | "default": "consistent" 1530 | } 1531 | }, 1532 | "additionalProperties": false 1533 | }, 1534 | "MD051": { 1535 | "description": "MD051/link-fragments : Link fragments should be valid : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md051.md", 1536 | "type": [ 1537 | "boolean", 1538 | "object" 1539 | ], 1540 | "default": true, 1541 | "properties": { 1542 | "ignore_case": { 1543 | "description": "Ignore case of fragments", 1544 | "type": "boolean", 1545 | "default": false 1546 | } 1547 | }, 1548 | "additionalProperties": false 1549 | }, 1550 | "link-fragments": { 1551 | "description": "MD051/link-fragments : Link fragments should be valid : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md051.md", 1552 | "type": [ 1553 | "boolean", 1554 | "object" 1555 | ], 1556 | "default": true, 1557 | "properties": { 1558 | "ignore_case": { 1559 | "description": "Ignore case of fragments", 1560 | "type": "boolean", 1561 | "default": false 1562 | } 1563 | }, 1564 | "additionalProperties": false 1565 | }, 1566 | "MD052": { 1567 | "description": "MD052/reference-links-images : Reference links and images should use a label that is defined : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md052.md", 1568 | "type": [ 1569 | "boolean", 1570 | "object" 1571 | ], 1572 | "default": true, 1573 | "properties": { 1574 | "shortcut_syntax": { 1575 | "description": "Include shortcut syntax", 1576 | "type": "boolean", 1577 | "default": false 1578 | } 1579 | }, 1580 | "additionalProperties": false 1581 | }, 1582 | "reference-links-images": { 1583 | "description": "MD052/reference-links-images : Reference links and images should use a label that is defined : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md052.md", 1584 | "type": [ 1585 | "boolean", 1586 | "object" 1587 | ], 1588 | "default": true, 1589 | "properties": { 1590 | "shortcut_syntax": { 1591 | "description": "Include shortcut syntax", 1592 | "type": "boolean", 1593 | "default": false 1594 | } 1595 | }, 1596 | "additionalProperties": false 1597 | }, 1598 | "MD053": { 1599 | "description": "MD053/link-image-reference-definitions : Link and image reference definitions should be needed : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md053.md", 1600 | "type": [ 1601 | "boolean", 1602 | "object" 1603 | ], 1604 | "default": true, 1605 | "properties": { 1606 | "ignored_definitions": { 1607 | "description": "Ignored definitions", 1608 | "type": "array", 1609 | "items": { 1610 | "type": "string" 1611 | }, 1612 | "default": [ 1613 | "//" 1614 | ] 1615 | } 1616 | }, 1617 | "additionalProperties": false 1618 | }, 1619 | "link-image-reference-definitions": { 1620 | "description": "MD053/link-image-reference-definitions : Link and image reference definitions should be needed : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md053.md", 1621 | "type": [ 1622 | "boolean", 1623 | "object" 1624 | ], 1625 | "default": true, 1626 | "properties": { 1627 | "ignored_definitions": { 1628 | "description": "Ignored definitions", 1629 | "type": "array", 1630 | "items": { 1631 | "type": "string" 1632 | }, 1633 | "default": [ 1634 | "//" 1635 | ] 1636 | } 1637 | }, 1638 | "additionalProperties": false 1639 | }, 1640 | "MD054": { 1641 | "description": "MD054/link-image-style : Link and image style : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md054.md", 1642 | "type": [ 1643 | "boolean", 1644 | "object" 1645 | ], 1646 | "default": true, 1647 | "properties": { 1648 | "autolink": { 1649 | "description": "Allow autolinks", 1650 | "type": "boolean", 1651 | "default": true 1652 | }, 1653 | "inline": { 1654 | "description": "Allow inline links and images", 1655 | "type": "boolean", 1656 | "default": true 1657 | }, 1658 | "full": { 1659 | "description": "Allow full reference links and images", 1660 | "type": "boolean", 1661 | "default": true 1662 | }, 1663 | "collapsed": { 1664 | "description": "Allow collapsed reference links and images", 1665 | "type": "boolean", 1666 | "default": true 1667 | }, 1668 | "shortcut": { 1669 | "description": "Allow shortcut reference links and images", 1670 | "type": "boolean", 1671 | "default": true 1672 | }, 1673 | "url_inline": { 1674 | "description": "Allow URLs as inline links", 1675 | "type": "boolean", 1676 | "default": true 1677 | } 1678 | }, 1679 | "additionalProperties": false 1680 | }, 1681 | "link-image-style": { 1682 | "description": "MD054/link-image-style : Link and image style : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md054.md", 1683 | "type": [ 1684 | "boolean", 1685 | "object" 1686 | ], 1687 | "default": true, 1688 | "properties": { 1689 | "autolink": { 1690 | "description": "Allow autolinks", 1691 | "type": "boolean", 1692 | "default": true 1693 | }, 1694 | "inline": { 1695 | "description": "Allow inline links and images", 1696 | "type": "boolean", 1697 | "default": true 1698 | }, 1699 | "full": { 1700 | "description": "Allow full reference links and images", 1701 | "type": "boolean", 1702 | "default": true 1703 | }, 1704 | "collapsed": { 1705 | "description": "Allow collapsed reference links and images", 1706 | "type": "boolean", 1707 | "default": true 1708 | }, 1709 | "shortcut": { 1710 | "description": "Allow shortcut reference links and images", 1711 | "type": "boolean", 1712 | "default": true 1713 | }, 1714 | "url_inline": { 1715 | "description": "Allow URLs as inline links", 1716 | "type": "boolean", 1717 | "default": true 1718 | } 1719 | }, 1720 | "additionalProperties": false 1721 | }, 1722 | "MD055": { 1723 | "description": "MD055/table-pipe-style : Table pipe style : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md055.md", 1724 | "type": [ 1725 | "boolean", 1726 | "object" 1727 | ], 1728 | "default": true, 1729 | "properties": { 1730 | "style": { 1731 | "description": "Table pipe style", 1732 | "type": "string", 1733 | "enum": [ 1734 | "consistent", 1735 | "leading_only", 1736 | "trailing_only", 1737 | "leading_and_trailing", 1738 | "no_leading_or_trailing" 1739 | ], 1740 | "default": "consistent" 1741 | } 1742 | }, 1743 | "additionalProperties": false 1744 | }, 1745 | "table-pipe-style": { 1746 | "description": "MD055/table-pipe-style : Table pipe style : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md055.md", 1747 | "type": [ 1748 | "boolean", 1749 | "object" 1750 | ], 1751 | "default": true, 1752 | "properties": { 1753 | "style": { 1754 | "description": "Table pipe style", 1755 | "type": "string", 1756 | "enum": [ 1757 | "consistent", 1758 | "leading_only", 1759 | "trailing_only", 1760 | "leading_and_trailing", 1761 | "no_leading_or_trailing" 1762 | ], 1763 | "default": "consistent" 1764 | } 1765 | }, 1766 | "additionalProperties": false 1767 | }, 1768 | "MD056": { 1769 | "description": "MD056/table-column-count : Table column count : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md056.md", 1770 | "type": "boolean", 1771 | "default": true 1772 | }, 1773 | "table-column-count": { 1774 | "description": "MD056/table-column-count : Table column count : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md056.md", 1775 | "type": "boolean", 1776 | "default": true 1777 | }, 1778 | "MD058": { 1779 | "description": "MD058/blanks-around-tables : Tables should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md058.md", 1780 | "type": "boolean", 1781 | "default": true 1782 | }, 1783 | "blanks-around-tables": { 1784 | "description": "MD058/blanks-around-tables : Tables should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.36.1/doc/md058.md", 1785 | "type": "boolean", 1786 | "default": true 1787 | }, 1788 | "headings": { 1789 | "description": "headings : MD001, MD003, MD018, MD019, MD020, MD021, MD022, MD023, MD024, MD025, MD026, MD036, MD041, MD043", 1790 | "type": "boolean", 1791 | "default": true 1792 | }, 1793 | "bullet": { 1794 | "description": "bullet : MD004, MD005, MD007, MD032", 1795 | "type": "boolean", 1796 | "default": true 1797 | }, 1798 | "ul": { 1799 | "description": "ul : MD004, MD005, MD007, MD030, MD032", 1800 | "type": "boolean", 1801 | "default": true 1802 | }, 1803 | "indentation": { 1804 | "description": "indentation : MD005, MD007, MD027", 1805 | "type": "boolean", 1806 | "default": true 1807 | }, 1808 | "whitespace": { 1809 | "description": "whitespace : MD009, MD010, MD012, MD027, MD028, MD030, MD037, MD038, MD039", 1810 | "type": "boolean", 1811 | "default": true 1812 | }, 1813 | "hard_tab": { 1814 | "description": "hard_tab : MD010", 1815 | "type": "boolean", 1816 | "default": true 1817 | }, 1818 | "links": { 1819 | "description": "links : MD011, MD034, MD039, MD042, MD051, MD052, MD053, MD054", 1820 | "type": "boolean", 1821 | "default": true 1822 | }, 1823 | "blank_lines": { 1824 | "description": "blank_lines : MD012, MD022, MD031, MD032, MD047", 1825 | "type": "boolean", 1826 | "default": true 1827 | }, 1828 | "line_length": { 1829 | "description": "line_length : MD013", 1830 | "type": "boolean", 1831 | "default": true 1832 | }, 1833 | "code": { 1834 | "description": "code : MD014, MD031, MD038, MD040, MD046, MD048", 1835 | "type": "boolean", 1836 | "default": true 1837 | }, 1838 | "atx": { 1839 | "description": "atx : MD018, MD019", 1840 | "type": "boolean", 1841 | "default": true 1842 | }, 1843 | "spaces": { 1844 | "description": "spaces : MD018, MD019, MD020, MD021, MD023", 1845 | "type": "boolean", 1846 | "default": true 1847 | }, 1848 | "atx_closed": { 1849 | "description": "atx_closed : MD020, MD021", 1850 | "type": "boolean", 1851 | "default": true 1852 | }, 1853 | "blockquote": { 1854 | "description": "blockquote : MD027, MD028", 1855 | "type": "boolean", 1856 | "default": true 1857 | }, 1858 | "ol": { 1859 | "description": "ol : MD029, MD030, MD032", 1860 | "type": "boolean", 1861 | "default": true 1862 | }, 1863 | "html": { 1864 | "description": "html : MD033", 1865 | "type": "boolean", 1866 | "default": true 1867 | }, 1868 | "url": { 1869 | "description": "url : MD034", 1870 | "type": "boolean", 1871 | "default": true 1872 | }, 1873 | "hr": { 1874 | "description": "hr : MD035", 1875 | "type": "boolean", 1876 | "default": true 1877 | }, 1878 | "emphasis": { 1879 | "description": "emphasis : MD036, MD037, MD049, MD050", 1880 | "type": "boolean", 1881 | "default": true 1882 | }, 1883 | "language": { 1884 | "description": "language : MD040", 1885 | "type": "boolean", 1886 | "default": true 1887 | }, 1888 | "spelling": { 1889 | "description": "spelling : MD044", 1890 | "type": "boolean", 1891 | "default": true 1892 | }, 1893 | "accessibility": { 1894 | "description": "accessibility : MD045", 1895 | "type": "boolean", 1896 | "default": true 1897 | }, 1898 | "images": { 1899 | "description": "images : MD045, MD052, MD053, MD054", 1900 | "type": "boolean", 1901 | "default": true 1902 | }, 1903 | "table": { 1904 | "description": "table : MD055, MD056, MD058", 1905 | "type": "boolean", 1906 | "default": true 1907 | } 1908 | } 1909 | } 1910 | } 1911 | }, 1912 | "commands": [ 1913 | { 1914 | "command": "markdownlint.fixAll", 1915 | "title": "Fix all errors found by markdownlint" 1916 | } 1917 | ] 1918 | } 1919 | } 1920 | -------------------------------------------------------------------------------- /snippets/snippets.json: -------------------------------------------------------------------------------- 1 | { 2 | "insertMarkdownLintDisableComment": { 3 | "prefix": "markdownlint-disable", 4 | "body": "", 5 | "description": "Disables one or more rules by name (MD013), alias (line-length), or tag (whitespace). Multiple rules are space-delimited (MD018 MD019). If no rules are specified, all rules are disabled. Takes effect starting with the line the comment is on." 6 | }, 7 | "insertMarkdownLintEnableComment": { 8 | "prefix": "markdownlint-enable", 9 | "body": "", 10 | "description": "Enables one or more rules by name (MD013), alias (line-length), or tag (whitespace). Multiple rules are space-delimited (MD018 MD019). If no rules are specified, all rules are enabled. Takes effect starting with the line the comment is on." 11 | }, 12 | "insertMarkdownLintDisableFileComment": { 13 | "prefix": "markdownlint-disable-file", 14 | "body": "", 15 | "description": "Disables one or more rules by name (MD013), alias (line-length), or tag (whitespace). Multiple rules are space-delimited (MD018 MD019). If no rules are specified, all rules are disabled. Applies to the entire file." 16 | }, 17 | "insertMarkdownLintEnableFileComment": { 18 | "prefix": "markdownlint-enable-file", 19 | "body": "", 20 | "description": "Enables one or more rules by name (MD013), alias (line-length), or tag (whitespace). Multiple rules are space-delimited (MD018 MD019). If no rules are specified, all rules are enabled. Applies to the entire file." 21 | }, 22 | "insertMarkdownLintDisableLineComment": { 23 | "prefix": "markdownlint-disable-line", 24 | "body": "", 25 | "description": "Disables one or more rules by name (MD013), alias (line-length), or tag (whitespace). Multiple rules are space-delimited (MD018 MD019). If no rules are specified, all rules are disabled. Applies to the current line only." 26 | }, 27 | "insertMarkdownLintDisableNextLineComment": { 28 | "prefix": "markdownlint-disable-next-line", 29 | "body": "", 30 | "description": "Disables one or more rules by name (MD013), alias (line-length), or tag (whitespace). Multiple rules are space-delimited (MD018 MD019). If no rules are specified, all rules are disabled. Applies to the next line only." 31 | }, 32 | "insertMarkdownLintCaptureComment": { 33 | "prefix": "markdownlint-capture", 34 | "body": "", 35 | "description": "Captures the current rule configuration. Takes effect starting with the line the comment is on." 36 | }, 37 | "insertMarkdownLintRestoreComment": { 38 | "prefix": "markdownlint-restore", 39 | "body": "", 40 | "description": "Restores the most recently captured rule configuration. Defaults to the document's initial configuration. Takes effect starting with the line the comment is on." 41 | }, 42 | "insertMarkdownLintConfigureFileComment": { 43 | "prefix": "markdownlint-configure-file", 44 | "body": "", 45 | "description": "Configures one or more rules by name (MD013), alias (line-length), or tag (whitespace) using the same JSON format as the \"markdownlint.config\" object. Applies to the entire file." 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/engine.ts: -------------------------------------------------------------------------------- 1 | import { 2 | type CodeAction, 3 | type CodeActionContext, 4 | CodeActionKind, 5 | type CodeActionProvider, 6 | Diagnostic, 7 | DiagnosticSeverity, 8 | Position, 9 | Range, 10 | type TextDocument, 11 | TextEdit, 12 | type WorkspaceEdit, 13 | languages, 14 | window, 15 | workspace, 16 | } from "coc.nvim"; 17 | import extend from "deep-extend"; 18 | import fs from "node:fs"; 19 | import jsYaml from "js-yaml"; 20 | import { applyFix, applyFixes, type LintError, type Options, readConfigSync, sync } from "markdownlint"; 21 | import path from "node:path"; 22 | import rc from "rc"; 23 | 24 | const projectConfigFiles = [".markdownlint.json", ".markdownlint.yaml", ".markdownlint.yml"]; 25 | const configFileParsers = [JSON.parse, jsYaml.load]; 26 | 27 | export class MarkdownlintEngine implements CodeActionProvider { 28 | public readonly fixAllCommandName = "markdownlint.fixAll"; 29 | private readonly source = "markdownlint"; 30 | private outputChannel = window.createOutputChannel(this.source); 31 | private diagnosticCollection = languages.createDiagnosticCollection(this.source); 32 | private config: { [key: string]: unknown } = {}; 33 | 34 | private outputLine(message: string) { 35 | if (this.outputChannel) { 36 | this.outputChannel.appendLine(`[${new Date().toLocaleTimeString()}] ${message}`); 37 | } 38 | } 39 | 40 | async parseConfig() { 41 | try { 42 | this.config = rc(this.source, {}); 43 | this.outputLine(`Info: global config: ${JSON.stringify(rc(this.source, {}))}`); 44 | } catch (e) { 45 | this.outputLine(`Error: global config parse failed: ${e}`); 46 | } 47 | 48 | try { 49 | for (const projectConfigFile of projectConfigFiles) { 50 | const fullPath = path.join(workspace.root, projectConfigFile); 51 | if (fs.existsSync(fullPath)) { 52 | // @ts-ignore 53 | const projectConfig = readConfigSync(fullPath, configFileParsers); 54 | this.config = extend(this.config, projectConfig); 55 | 56 | this.outputLine(`Info: local config: ${fullPath}, ${JSON.stringify(projectConfig)}`); 57 | break; 58 | } 59 | } 60 | } catch (e) { 61 | this.outputLine(`Error: local config parse failed: ${e}`); 62 | } 63 | 64 | const cocConfig = workspace.getConfiguration("markdownlint").get<{ [key: string]: unknown }>("config"); 65 | if (cocConfig) { 66 | this.config = extend(this.config, cocConfig); 67 | this.outputLine(`Info: config from coc-settings.json: ${JSON.stringify(cocConfig)}`); 68 | } 69 | 70 | this.outputLine(`Info: full config: ${JSON.stringify(this.config)}`); 71 | } 72 | 73 | private markdownlintWrapper(document: TextDocument): LintError[] { 74 | const options: Options = { 75 | resultVersion: 3, 76 | config: this.config, 77 | // customRules: customRules, 78 | strings: { 79 | [document.uri]: document.getText(), 80 | }, 81 | }; 82 | 83 | let results: LintError[] = []; 84 | try { 85 | results = sync(options)[document.uri] as LintError[]; 86 | } catch (e) { 87 | this.outputLine(`Error: lint exception: ${e}`); 88 | } 89 | 90 | return results || []; 91 | } 92 | 93 | public async provideCodeActions(document: TextDocument, range: Range, context: CodeActionContext) { 94 | const doc = workspace.getDocument(document.uri); 95 | if (!doc) { 96 | return []; 97 | } 98 | const wholeRange = Range.create(0, 0, doc.lineCount, 0); 99 | let whole = false; 100 | if ( 101 | range.start.line === wholeRange.start.line && 102 | range.start.character === wholeRange.start.character && 103 | range.end.line === wholeRange.end.line && 104 | range.end.character === wholeRange.end.character 105 | ) { 106 | whole = true; 107 | } 108 | const codeActions: CodeAction[] = []; 109 | const fixInfoDiagnostics: Diagnostic[] = []; 110 | for (const diagnostic of context.diagnostics) { 111 | // @ts-ignore 112 | if (diagnostic.fixInfo) { 113 | // @ts-ignore 114 | const lineNumber = diagnostic.fixInfo.lineNumber - 1 || diagnostic.range.start.line; 115 | const line = await workspace.getLine(document.uri, lineNumber); 116 | // @ts-ignore 117 | const newText = applyFix(line, diagnostic.fixInfo, "\n"); 118 | 119 | const edit: WorkspaceEdit = { changes: {} }; 120 | if (typeof newText === "string") { 121 | const range = Range.create(lineNumber, 0, lineNumber, line.length); 122 | // biome-ignore lint/style/noNonNullAssertion: 123 | edit.changes![document.uri] = [TextEdit.replace(range, newText)]; 124 | } else { 125 | // biome-ignore lint/style/noNonNullAssertion: 126 | edit.changes![document.uri] = [TextEdit.del(diagnostic.range)]; 127 | } 128 | 129 | const title = `Fix: ${diagnostic.message.split(":")[0]}`; 130 | const action: CodeAction = { 131 | title, 132 | edit, 133 | diagnostics: [...context.diagnostics], 134 | }; 135 | 136 | fixInfoDiagnostics.push(diagnostic); 137 | if (!whole) { 138 | codeActions.push(action); 139 | } 140 | } 141 | } 142 | 143 | if (range.start.line === range.end.line && range.start.character === 0) { 144 | // 145 | const edit = TextEdit.insert(Position.create(range.start.line, 0), "\n"); 146 | codeActions.push({ 147 | title: "Disable markdownlint for current line", 148 | edit: { 149 | changes: { 150 | [doc.uri]: [edit], 151 | }, 152 | }, 153 | }); 154 | } 155 | 156 | if (whole) { 157 | // 158 | const edit = TextEdit.insert(Position.create(0, 0), "\n"); 159 | codeActions.push({ 160 | title: "Disable markdownlint for current file", 161 | edit: { 162 | changes: { 163 | [doc.uri]: [edit], 164 | }, 165 | }, 166 | }); 167 | } 168 | 169 | if (fixInfoDiagnostics.length) { 170 | const title = "Fix All error found by markdownlint"; 171 | const sourceFixAllAction: CodeAction = { 172 | title, 173 | kind: CodeActionKind.SourceFixAll, 174 | diagnostics: fixInfoDiagnostics, 175 | command: { 176 | title, 177 | command: this.fixAllCommandName, 178 | }, 179 | }; 180 | 181 | codeActions.push(sourceFixAllAction); 182 | } 183 | 184 | return codeActions; 185 | } 186 | 187 | public lint(document: TextDocument) { 188 | if (document.languageId !== "markdown") { 189 | return; 190 | } 191 | this.diagnosticCollection.set(document.uri); 192 | 193 | const results = this.markdownlintWrapper(document); 194 | if (!results.length) { 195 | return; 196 | } 197 | 198 | const diagnostics: Diagnostic[] = []; 199 | for (const result of results) { 200 | const ruleDescription = result.ruleDescription; 201 | let message = `${result.ruleNames.join("/")}: ${ruleDescription}`; 202 | if (result.errorDetail) { 203 | message += ` [${result.errorDetail}]`; 204 | } 205 | 206 | const start = Position.create(result.lineNumber - 1, 0); 207 | const end = Position.create(result.lineNumber - 1, 0); 208 | if (result.errorRange) { 209 | start.character = result.errorRange[0] - 1; 210 | end.character = start.character + result.errorRange[1]; 211 | } 212 | 213 | const range = Range.create(start, end); 214 | const diagnostic = Diagnostic.create(range, message); 215 | diagnostic.severity = DiagnosticSeverity.Warning; 216 | diagnostic.source = this.source; 217 | // @ts-ignore 218 | diagnostic.fixInfo = result.fixInfo; 219 | diagnostics.push(diagnostic); 220 | } 221 | 222 | this.diagnosticCollection.set(document.uri, diagnostics); 223 | } 224 | 225 | public async fixAll(document: TextDocument) { 226 | const results = this.markdownlintWrapper(document); 227 | if (!results.length) { 228 | return; 229 | } 230 | 231 | const text = document.getText(); 232 | const fixedText = applyFixes(text, results); 233 | if (text !== fixedText) { 234 | const doc = workspace.getDocument(document.uri); 235 | if (!doc) { 236 | return; 237 | } 238 | const end = Position.create(doc.lineCount - 1, doc.getline(doc.lineCount - 1).length); 239 | const edit: WorkspaceEdit = { 240 | changes: { 241 | [document.uri]: [TextEdit.replace(Range.create(Position.create(0, 0), end), fixedText)], 242 | }, 243 | }; 244 | await workspace.applyEdit(edit); 245 | } 246 | } 247 | } 248 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | import { 2 | type DidChangeTextDocumentParams, 3 | type Document, 4 | type DocumentFilter, 5 | type ExtensionContext, 6 | type TextDocument, 7 | commands, 8 | languages, 9 | workspace, 10 | } from "coc.nvim"; 11 | import { MarkdownlintEngine } from "./engine"; 12 | 13 | const documentSelector: DocumentFilter[] = [ 14 | { 15 | language: "markdown", 16 | scheme: "file", 17 | }, 18 | { 19 | language: "markdown", 20 | scheme: "untitled", 21 | }, 22 | ]; 23 | 24 | let documentVersion = 0; 25 | const engine = new MarkdownlintEngine(); 26 | const config = workspace.getConfiguration("markdownlint"); 27 | 28 | function didOpenTextDocument(document: TextDocument) { 29 | if (config.get("onOpen", true)) { 30 | engine.lint(document); 31 | } 32 | } 33 | 34 | async function didChangeTextDocument(params: DidChangeTextDocumentParams) { 35 | if (!config.get("onChange", true)) { 36 | return; 37 | } 38 | 39 | if (params.textDocument.version && documentVersion !== params.textDocument.version) { 40 | documentVersion = params.textDocument.version; 41 | const { document } = await workspace.getCurrentState(); 42 | engine.lint(document); 43 | } 44 | } 45 | 46 | async function didSaveTextDocument(document: TextDocument) { 47 | if (config.get("onSave", true)) { 48 | engine.lint(document); 49 | } 50 | } 51 | 52 | export async function activate(context: ExtensionContext): Promise { 53 | await engine.parseConfig(); 54 | 55 | context.subscriptions.push( 56 | languages.registerCodeActionProvider(documentSelector, engine, "markdownlint"), 57 | commands.registerCommand(engine.fixAllCommandName, async () => { 58 | const { document } = await workspace.getCurrentState(); 59 | engine.fixAll(document); 60 | }), 61 | 62 | workspace.onDidOpenTextDocument(didOpenTextDocument), 63 | workspace.onDidChangeTextDocument(didChangeTextDocument), 64 | workspace.onDidSaveTextDocument(didSaveTextDocument), 65 | ); 66 | 67 | workspace.documents.map((doc: Document) => { 68 | didOpenTextDocument(doc.textDocument); 69 | }); 70 | } 71 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2017", 4 | "lib": ["es2017", "es2018"], 5 | "module": "commonjs", 6 | "declaration": false, 7 | "sourceMap": true, 8 | "outDir": "lib", 9 | "strict": true, 10 | "moduleResolution": "node", 11 | "noImplicitAny": false, 12 | "esModuleInterop": true 13 | }, 14 | "include": ["src"] 15 | } 16 | --------------------------------------------------------------------------------