Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c1029f6

Browse filesBrowse files
khiga8lindseywild
andauthored
Update README.md (#31)
* Update README.md * Update README.md Co-authored-by: Lindsey Wild <35239154+lindseywild@users.noreply.github.com> Co-authored-by: Lindsey Wild <35239154+lindseywild@users.noreply.github.com>
1 parent 2ca150a commit c1029f6
Copy full SHA for c1029f6

File tree

Expand file treeCollapse file tree

1 file changed

+26
-17
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+26
-17
lines changed

‎README.md

Copy file name to clipboardExpand all lines: README.md
+26-17Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,13 @@
11
# GitHub Flavored Markdown Linting
22

3-
We are using the [`markdownlint`](https://github.com/DavidAnson/markdownlint) library (via [`markdownlint-cli2`](https://github.com/DavidAnson/markdownlint-cli2) and adding our opinions and custom rules to it.
43

5-
To review behaviors supported by `markdownlint`, particularly how to enable or disable rules, see [`markdownlint-cli2` configuration](https://github.com/DavidAnson/markdownlint-cli2#configuration).
4+
This repository provides GitHub's recommended [`markdownlint`](https://github.com/DavidAnson/markdownlint) configurations, and additional rules for use on GitHub open source and internal projects.
65

76
## Opinions
87

9-
At GitHub, we have opinions about how our markdown should be written.
10-
118
In addition to defaults defined by `markdownlint`, we use this repository to enforce rules not defined by default, including our own custom rules.
129

13-
See our opinions codified in [index.js](./index.js).
14-
15-
### Should I disable rules enabled by this plugin?
16-
17-
This plugin will enable the defaults defined by `markdownlint`. Several of these pertain to stylistic practices. You may choose to disable these rules if you determine it doesn't provide value for your project.
18-
19-
However, others of these rules should **NOT** be disabled because they encourage best accessibility practices. Disabling these rules will negatively impact accessibility. These rules are specified in [accessibility.json](./accessibility.json).
10+
See opinions codified in [index.js](./index.js).
2011

2112
## Rules
2213

@@ -29,19 +20,20 @@ See [`markdownlint` rules](https://github.com/DavidAnson/markdownlint#rules--ali
2920

3021
## Usage
3122

32-
**Note**: We recommend configuring [`markdownlint-cli2`](https://github.com/DavidAnson/markdownlint-cli2) over `markdownlint-cli` for compatibility with the [vscode-markdownlint](https://github.com/DavidAnson/vscode-markdownlint) plugin.
23+
**Important**: We support the use of `markdownlint` through [`markdownlint-cli2`](https://github.com/DavidAnson/markdownlint-cli2) instead of `markdownlint-cli` for compatability with the [`vscode-markdownlint`](https://github.com/DavidAnson/vscode-markdownlint) plugin.
3324

34-
1. Create a `.markdownlint-cli2.cjs` file in the root of your repository
25+
1. Create a `.markdownlint-cli2.cjs` file in the root of your repository.
3526

3627
```bash
3728
touch .markdownlint-cli2.cjs
3829
```
3930

40-
2. Install packages
31+
2. Install packages.
4132

4233
- ```bash
4334
npm install -D markdownlint-cli2 # if updating existing package, check for updates
4435
npm install -D @github/markdownlint-github [--@github:registry=https://registry.npmjs.org]
36+
npm install -D markdownlint-cli2-formatter-pretty
4537
```
4638

4739
3. Add/modify your linting script in `package.json`.
@@ -57,22 +49,39 @@ See [`markdownlint` rules](https://github.com/DavidAnson/markdownlint#rules--ali
5749
module.exports = {
5850
config: options,
5951
customRules: ["@github/markdownlint-github"],
52+
outputFormatters: [
53+
[ "markdownlint-cli2-formatter-pretty", { "appendLink": true } ] // ensures the error message includes a link to the rule documentation
54+
]
6055
}
6156
```
6257
63-
Or, you can also pass in configuration options that you wish to override the default. This looks like:
58+
Or, you can also pass in configuration options that you wish to override the default. Read more at [Customizing configurations](#customizing-configurations).
59+
This looks like:
6460
6561
```js
6662
const options = require('@github/markdownlint-github').init({
67-
'fenced-code-language': false,
63+
'fenced-code-language': false, // Custom overrides
6864
})
6965
module.exports = {
7066
config: options,
7167
customRules: ["@github/markdownlint-github"],
68+
outputFormatters: [
69+
[ "markdownlint-cli2-formatter-pretty", { "appendLink": true } ]
70+
]
7271
}
7372
```
7473
75-
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 configuartion, you will need to reload the VSCode window (`Ctrl+Shift+P` -> `Reload Window`) to ensure the extension syncs.
74+
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.
75+
76+
### Customizing configurations
77+
78+
You may determine that the defaults set by this plugin are not suitable for your project.
79+
80+
This plugin will pull in the the defaults defined by `markdownlint`, several of which pertain to stylistic practices. You may choose to disable these rules if you determine it doesn't provide value for your project.
81+
82+
However, others of these rules should **NOT** be disabled because they encourage best accessibility practices. Disabling these rules will negatively impact accessibility. These rules are defined in [accessibility.json](./accessibility.json).
83+
84+
To review configurations supported by `markdownlint`, see [`markdownlint-cli2` configuration](https://github.com/DavidAnson/markdownlint-cli2#configuration).
7685
7786
### Advanced: Adding custom rules in your codebase
7887

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.