Add style/prettier.json (fixes #592).

This commit is contained in:
Josh Goldberg 2022-10-02 01:15:14 -04:00 committed by David Anson
parent cedbdbaaf1
commit 82a5de0821
4 changed files with 34 additions and 4 deletions

View file

@ -1,8 +1,12 @@
# 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.
[`Prettier`](https://prettier.io) is a popular code formatter.
For the most part, Prettier works seamlessly with `markdownlint`.
You can extend the `markdownlint/style/prettier.json` style to disable all
markdownlint rules that overlap with Prettier.
Special situations when not extending `prettier.json` are documented below.
## List item indentation

View file

@ -9,6 +9,7 @@
"./helpers": "./helpers/helpers.js",
"./style/all": "./style/all.json",
"./style/cirosantilli": "./style/cirosantilli.json",
"./style/prettier": "./style/prettier.json",
"./style/relaxed": "./style/relaxed.json"
},
"types": "./lib/markdownlint.d.ts",

25
style/prettier.json Normal file
View file

@ -0,0 +1,25 @@
{
"comment": "Disables rules that may conflict with Prettier",
"blanks-around-fences": false,
"blanks-around-headings": false,
"blanks-around-lists": false,
"code-fence-style": false,
"emphasis-style": false,
"heading-start-left": false,
"hr-style": false,
"line-length": false,
"list-indent": false,
"list-marker-space": false,
"no-blanks-blockquote": false,
"no-hard-tabs": false,
"no-missing-space-atx": false,
"no-missing-space-closed-atx": false,
"no-multiple-blanks": false,
"no-multiple-space-atx": false,
"no-multiple-space-blockquote": false,
"no-multiple-space-closed-atx": false,
"no-trailing-spaces": false,
"ol-prefix": false,
"strong-style": false,
"ul-indent": false
}

View file

@ -431,7 +431,7 @@ test("enableTagMixedCase", (t) => new Promise((resolve) => {
}));
test("styleFiles", (t) => new Promise((resolve) => {
t.plan(7);
t.plan(9);
fs.readdir("./style", function readdir(err, files) {
t.falsy(err);
for (const file of files) {