Skip to content

Commit db57d67

Browse files
committed
fix: use .markdownlint-cli2.mjs for the configuration file
1 parent aa24db4 commit db57d67

File tree

3 files changed

+28
-20
lines changed

3 files changed

+28
-20
lines changed

.markdownlint-cli2.jsonc

-11
This file was deleted.

.markdownlint-cli2.mjs

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import relativeLinksRule from "./src/index.js"
2+
3+
const config = {
4+
config: {
5+
"extends": "markdownlint/style/prettier",
6+
default: true,
7+
"relative-links": true,
8+
"no-inline-html": false,
9+
},
10+
globs: ["**/*.md"],
11+
ignores: ["**/node_modules", "**/test/fixtures/**"],
12+
customRules: [relativeLinksRule],
13+
}
14+
15+
export default config

README.md

+13-9
Original file line numberDiff line numberDiff line change
@@ -80,18 +80,22 @@ There are various ways [markdownlint](https://github.com/DavidAnson/markdownlint
8080

8181
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.
8282

83-
`.markdownlint-cli2.jsonc`
83+
`.markdownlint-cli2.mjs`
8484

85-
```json
86-
{
87-
"config": {
88-
"default": true,
89-
"relative-links": true
85+
```js
86+
import relativeLinksRule from "markdownlint-rule-relative-links"
87+
88+
const config = {
89+
config: {
90+
default: true,
91+
"relative-links": true,
9092
},
91-
"globs": ["**/*.md"],
92-
"ignores": ["**/node_modules"],
93-
"customRules": ["markdownlint-rule-relative-links"]
93+
globs: ["**/*.md"],
94+
ignores: ["**/node_modules"],
95+
customRules: [relativeLinksRule],
9496
}
97+
98+
export default config
9599
```
96100

97101
`package.json`

0 commit comments

Comments
 (0)