Skip to content

Commit

Permalink
Add Prettier.md to document compatibility issues (fixes #410).
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidAnson committed Aug 14, 2021
1 parent 92111e0 commit 580e57d
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
23 changes: 23 additions & 0 deletions doc/Prettier.md
@@ -0,0 +1,23 @@
# Using markdownlint with Prettier

[`Prettier`](https://prettier.io) is a popular code formatter. For the most part,
it works seamlessly with `markdownlint`. Special situations are documented
below.

## List item indentation

The default settings of `markdownlint` and `Prettier` are compatible and don't
result in any linting violations. If `Prettier` is used with `--tab-width` set
to `4`, the following `markdownlint` configuration can be used:

```json
{
"MD007": {
"indent": 4
},
"MD030": {
"ul_single": 3,
"ul_multi": 3
}
}
```
4 changes: 4 additions & 0 deletions doc/Rules.md
Expand Up @@ -329,6 +329,8 @@ issue for multi-markdown parsers, which require 4-space indents. More informatio
<https://cirosantilli.com/markdown-style-guide#indentation-of-content-inside-lists>
and <http://support.markedapp.com/discussions/problems/21-sub-lists-not-indenting>.

Note: See [Prettier.md](Prettier.md) for compatibility information.

<a name="md009"></a>

## MD009 - Trailing spaces
Expand Down Expand Up @@ -1183,6 +1185,8 @@ for your selected document style.

Rationale: Violations of this rule can lead to improperly rendered content.

Note: See [Prettier.md](Prettier.md) for compatibility information.

<a name="md031"></a>

## MD031 - Fenced code blocks should be surrounded by blank lines
Expand Down
2 changes: 2 additions & 0 deletions test/markdownlint-test.js
Expand Up @@ -80,6 +80,7 @@ test.cb("projectFilesNoInlineConfig", (t) => {
"README.md",
"CONTRIBUTING.md",
"doc/CustomRules.md",
"doc/Prettier.md",
"helpers/README.md"
],
"noInlineConfig": true,
Expand All @@ -94,6 +95,7 @@ test.cb("projectFilesNoInlineConfig", (t) => {
"README.md": [],
"CONTRIBUTING.md": [],
"doc/CustomRules.md": [],
"doc/Prettier.md": [],
"helpers/README.md": []
};
t.deepEqual(actual, expected, "Issue(s) with project files.");
Expand Down

0 comments on commit 580e57d

Please sign in to comment.