fix: use .markdownlint-cli2.mjs for the configuration file

This commit is contained in:
Théo LUDWIG 2024-12-28 23:13:48 +01:00
parent aa24db4fac
commit db57d67b0b
Signed by: theoludwig
GPG Key ID: ADFE5A563D718F3B
3 changed files with 28 additions and 20 deletions

View File

@ -1,11 +0,0 @@
{
"config": {
"extends": "markdownlint/style/prettier",
"default": true,
"relative-links": true,
"no-inline-html": false,
},
"globs": ["**/*.md"],
"ignores": ["**/node_modules", "**/test/fixtures/**"],
"customRules": ["./src/index.js"],
}

15
.markdownlint-cli2.mjs Normal file
View File

@ -0,0 +1,15 @@
import relativeLinksRule from "./src/index.js"
const config = {
config: {
"extends": "markdownlint/style/prettier",
default: true,
"relative-links": true,
"no-inline-html": false,
},
globs: ["**/*.md"],
ignores: ["**/node_modules", "**/test/fixtures/**"],
customRules: [relativeLinksRule],
}
export default config

View File

@ -80,18 +80,22 @@ There are various ways [markdownlint](https://github.com/DavidAnson/markdownlint
We recommend configuring [markdownlint-cli2](https://github.com/DavidAnson/markdownlint-cli2) over [markdownlint-cli](https://github.com/igorshubovych/markdownlint-cli) for compatibility with the [vscode-markdownlint](https://github.com/DavidAnson/vscode-markdownlint) extension.
`.markdownlint-cli2.jsonc`
`.markdownlint-cli2.mjs`
```json
{
"config": {
"default": true,
"relative-links": true
```js
import relativeLinksRule from "markdownlint-rule-relative-links"
const config = {
config: {
default: true,
"relative-links": true,
},
"globs": ["**/*.md"],
"ignores": ["**/node_modules"],
"customRules": ["markdownlint-rule-relative-links"]
globs: ["**/*.md"],
ignores: ["**/node_modules"],
customRules: [relativeLinksRule],
}
export default config
```
`package.json`