Skip to content

Commit 99bbed2

Browse files
committedApr 7, 2024
Refactor docs
1 parent 7e676ed commit 99bbed2

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed
 

‎readme.md

+19-15
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,12 @@ We would get a report like this:
5050

5151
```txt
5252
doc/example.md
53-
1:1-1:35 warning Marker style should be `.` ordered-list-marker-style remark-lint
54-
1:4 warning Incorrect list-item indent: add 1 space list-item-indent remark-lint
55-
1:25-1:34 warning Emphasis should use `_` as a marker emphasis-marker remark-lint
53+
1:2 warning Unexpected ordered list marker `)`, expected `.` ordered-list-marker-style remark-lint
54+
1:25-1:34 warning Unexpected emphasis marker `*`, expected `_` emphasis-marker remark-lint
55+
[cause]:
56+
1:11-1:20 info Emphasis marker style `'_'` first defined for `'consistent'` here emphasis-marker remark-lint
5657
57-
3 warnings
58+
2 warnings
5859
```
5960

6061
This GitHub repository is a monorepo that contains ±70 plugins (each a rule that
@@ -379,10 +380,10 @@ const file = await remark()
379380
.use(remarkPresetLintConsistent)
380381
// Few recommended rules.
381382
.use(remarkPresetLintRecommended)
382-
// `remark-lint-list-item-indent` is configured with `tab-size` in the
383+
// `remark-lint-list-item-indent` is configured with `one` in the
383384
// recommended preset, but if we’d prefer something else, it can be
384385
// reconfigured:
385-
.use(remarkLintListItemIndent, 'space')
386+
.use(remarkLintListItemIndent, 'tab')
386387
.process('1) Hello, _Jupiter_ and *Neptune*!')
387388
388389
console.error(reporter(file))
@@ -391,11 +392,14 @@ console.error(reporter(file))
391392
Running that with `node example.js` yields:
392393
393394
```txt
394-
1:1 warning Missing newline character at end of file final-newline remark-lint
395-
1:1-1:35 warning Marker style should be `.` ordered-list-marker-style remark-lint
396-
1:25-1:34 warning Emphasis should use `_` as a marker emphasis-marker remark-lint
397-
398-
⚠ 3 warnings
395+
1:2 warning Unexpected ordered list marker `)`, expected `.` ordered-list-marker-style remark-lint
396+
1:4 warning Unexpected `1` space between list item marker and content, expected `2` spaces, add `1` space list-item-indent remark-lint
397+
1:25-1:34 warning Unexpected emphasis marker `*`, expected `_` emphasis-marker remark-lint
398+
[cause]:
399+
1:11-1:20 info Emphasis marker style `'_'` first defined for `'consistent'` here emphasis-marker remark-lint
400+
1:35 warning Unexpected missing final newline character, expected line feed (`\n`) at end of file final-newline remark-lint
401+
402+
⚠ 4 warnings
399403
```
400404
401405
### Example: check and format markdown on the API
@@ -478,12 +482,12 @@ Now add a `remarkConfig` to your `package.json` to configure remark:
478482
"plugins": [
479483
"remark-preset-lint-consistent", // Check that markdown is consistent.
480484
"remark-preset-lint-recommended", // Few recommended rules.
481-
// `remark-lint-list-item-indent` is configured with `tab-size` in the
485+
// `remark-lint-list-item-indent` is configured with `one` in the
482486
// recommended preset, but if we’d prefer something else, it can be
483487
// reconfigured:
484488
[
485489
"remark-lint-list-item-indent",
486-
"space"
490+
"tab"
487491
]
488492
]
489493
},
@@ -512,7 +516,7 @@ change the npm script:
512516
/**/
513517
"scripts": {
514518
/**/
515-
"format": "remark . --quiet --frail --output",
519+
"format": "remark . --frail --output --quiet",
516520
/**/
517521
},
518522
/**/
@@ -534,7 +538,7 @@ Update `remarkConfig`:
534538
"plugins": [
535539
"remark-preset-lint-consistent",
536540
"remark-preset-lint-recommended",
537-
["remark-lint-list-item-indent", "space"]
541+
["remark-lint-list-item-indent", "tab"]
538542
["remark-lint-emphasis-marker", "*"],
539543
["remark-lint-strong-marker", "*"]
540544
]

0 commit comments

Comments
 (0)
Please sign in to comment.