You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20-14
Original file line number
Diff line number
Diff line change
@@ -22,10 +22,10 @@ See [`markdownlint` rules](https://github.com/DavidAnson/markdownlint#rules--ali
22
22
23
23
**Important**: We support the use of `markdownlint` through [`markdownlint-cli2`](https://github.com/DavidAnson/markdownlint-cli2) instead of `markdownlint-cli` for compatibility with the [`vscode-markdownlint`](https://github.com/DavidAnson/vscode-markdownlint) plugin.
24
24
25
-
1. Create a `.markdownlint-cli2.cjs` file in the root of your repository.
25
+
1. Create a `.markdownlint-cli2.mjs` file in the root of your repository.
26
26
27
27
```bash
28
-
touch .markdownlint-cli2.cjs
28
+
touch .markdownlint-cli2.mjs
29
29
```
30
30
31
31
2. Install packages.
@@ -44,36 +44,39 @@ See [`markdownlint` rules](https://github.com/DavidAnson/markdownlint#rules--ali
44
44
}
45
45
```
46
46
47
-
4. Edit `.markdownlint-cli2.cjs` file to suit your needs. Start with
47
+
4. Edit `.markdownlint-cli2.mjs` file to suit your needs. Start with
import configOptions, {init} from "@github/markdownlint-github"
51
+
const options = {
52
+
config: init(),
53
53
customRules: ["@github/markdownlint-github"],
54
54
outputFormatters: [
55
55
[ "markdownlint-cli2-formatter-pretty", { "appendLink": true } ] // ensures the error message includes a link to the rule documentation
56
56
]
57
57
}
58
+
export default options
58
59
```
59
60
60
-
Or, you can also pass in configuration options that you wish to override the default. Read more at [Customizing configurations](#customizing-configurations).
61
+
Or, you can also pass in configuration options that you wish to override the default. Read more at [Customizing configurations](#customizing-configurations).
5. Install the [`vscode-markdownlint`](https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint) plugin to ensure `markdownlint` violations are surfaced in the file. This plugin should flag rules based off your `.markdownlint-cli2.cjs` configuration. When you make edits to your configuration, you will need to reload the VSCode window (`Ctrl+Shift+P` ->`Reload Window`) to ensure the extension syncs. If your project runs on Codespaces, consider adding this extension to your `.devcontainer/devcontainer.json` so that this extension is installed to new Codespaces by default.
79
+
5. Install the [`vscode-markdownlint`](https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint) plugin to ensure `markdownlint` violations are surfaced in the file. This plugin should flag rules based off your `.markdownlint-cli2.mjs` configuration. When you make edits to your configuration, you will need to reload the VSCode window (`Ctrl+Shift+P` ->`Reload Window`) to ensure the extension syncs. If your project runs on Codespaces, consider adding this extension to your `.devcontainer/devcontainer.json` so that this extension is installed to new Codespaces by default.
77
80
78
81
### Customizing configurations
79
82
@@ -89,13 +92,15 @@ To review configurations supported by `markdownlint`, see [`markdownlint-cli2` c
89
92
90
93
You may write custom rules within your repository. Follow the [custom rules guide in `markdownlint`](https://github.com/DavidAnson/markdownlint/blob/main/doc/CustomRules.md) to write your rule.
91
94
92
-
The rule will need to be enabled in the configuration. For instance, if you introduce `some-rule.js` with the name "some-rule", you must set the path of the custom rule in the `.markdownlint-cli2.cjs` file:
95
+
The rule will need to be enabled in the configuration. For instance, if you introduce `some-rule.js` with the name "some-rule", you must set the path of the custom rule in the `.markdownlint-cli2.mjs` file:
0 commit comments