Skip to content

Commit

Permalink
Replace dox w/ comment-parser
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Aug 11, 2021
1 parent 4a832b1 commit 5c398a8
Show file tree
Hide file tree
Showing 70 changed files with 667 additions and 369 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"type": "module",
"devDependencies": {
"c8": "^7.0.0",
"dox": "^0.9.0",
"comment-parser": "^1.0.0",
"lerna": "^4.0.0",
"mdast-zone": "^5.0.0",
"parse-author": "^2.0.0",
Expand Down
13 changes: 8 additions & 5 deletions packages/remark-lint-blockquote-indentation/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,25 @@
* `'consistent'` detects the first used indentation and will warn when
* other block quotes use a different indentation.
*
* @example {"name": "ok.md", "setting": 4}
* @example
* {"name": "ok.md", "setting": 4}
*
* > Hello
*
* Paragraph.
*
* > World
*
* @example {"name": "ok.md", "setting": 2}
* @example
* {"name": "ok.md", "setting": 2}
*
* > Hello
*
* Paragraph.
*
* > World
*
* @example {"name": "not-ok.md", "label": "input"}
* @example
* {"name": "not-ok.md", "label": "input"}
*
* > Hello
*
Expand All @@ -39,7 +41,8 @@
*
* > World
*
* @example {"name": "not-ok.md", "label": "output"}
* @example
* {"name": "not-ok.md", "label": "output"}
*
* 5:5: Remove 1 space between block quote and content
* 9:3: Add 1 space between block quote and content
Expand Down
24 changes: 16 additions & 8 deletions packages/remark-lint-checkbox-character-style/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,45 +26,53 @@
* See [Using remark to fix your Markdown](https://github.com/remarkjs/remark-lint#using-remark-to-fix-your-markdown)
* on how to automatically fix warnings for this rule.
*
* @example {"name": "ok.md", "setting": {"checked": "x"}, "gfm": true}
* @example
* {"name": "ok.md", "setting": {"checked": "x"}, "gfm": true}
*
* - [x] List item
* - [x] List item
*
* @example {"name": "ok.md", "setting": {"checked": "X"}, "gfm": true}
* @example
* {"name": "ok.md", "setting": {"checked": "X"}, "gfm": true}
*
* - [X] List item
* - [X] List item
*
* @example {"name": "ok.md", "setting": {"unchecked": " "}, "gfm": true}
* @example
* {"name": "ok.md", "setting": {"unchecked": " "}, "gfm": true}
*
* - [ ] List item
* - [ ] List item
* - [ ]··
* - [ ]
*
* @example {"name": "ok.md", "setting": {"unchecked": "\t"}, "gfm": true}
* @example
* {"name": "ok.md", "setting": {"unchecked": "\t"}, "gfm": true}
*
* - [»] List item
* - [»] List item
*
* @example {"name": "not-ok.md", "label": "input", "gfm": true}
* @example
* {"name": "not-ok.md", "label": "input", "gfm": true}
*
* - [x] List item
* - [X] List item
* - [ ] List item
* - [»] List item
*
* @example {"name": "not-ok.md", "label": "output", "gfm": true}
* @example
* {"name": "not-ok.md", "label": "output", "gfm": true}
*
* 2:5: Checked checkboxes should use `x` as a marker
* 4:5: Unchecked checkboxes should use ` ` as a marker
*
* @example {"setting": {"unchecked": "💩"}, "name": "not-ok.md", "label": "output", "positionless": true, "gfm": true}
* @example
* {"setting": {"unchecked": "💩"}, "name": "not-ok.md", "label": "output", "positionless": true, "gfm": true}
*
* 1:1: Incorrect unchecked checkbox marker `💩`: use either `'\t'`, or `' '`
*
* @example {"setting": {"checked": "💩"}, "name": "not-ok.md", "label": "output", "positionless": true, "gfm": true}
* @example
* {"setting": {"checked": "💩"}, "name": "not-ok.md", "label": "output", "positionless": true, "gfm": true}
*
* 1:1: Incorrect checked checkbox marker `💩`: use either `'x'`, or `'X'`
*/
Expand Down
9 changes: 6 additions & 3 deletions packages/remark-lint-checkbox-content-indent/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,24 @@
* @fileoverview
* Warn when list item checkboxes are followed by too much whitespace.
*
* @example {"name": "ok.md", "gfm": true}
* @example
* {"name": "ok.md", "gfm": true}
*
* - [ ] List item
* + [x] List Item
* * [X] List item
* - [ ] List item
*
* @example {"name": "not-ok.md", "label": "input", "gfm": true}
* @example
* {"name": "not-ok.md", "label": "input", "gfm": true}
*
* - [ ] List item
* + [x] List item
* * [X] List item
* - [ ] List item
*
* @example {"name": "not-ok.md", "label": "output", "gfm": true}
* @example
* {"name": "not-ok.md", "label": "output", "gfm": true}
*
* 2:7-2:8: Checkboxes should be followed by a single character
* 3:7-3:9: Checkboxes should be followed by a single character
Expand Down
27 changes: 18 additions & 9 deletions packages/remark-lint-code-block-style/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,17 @@
* See [Using remark to fix your Markdown](https://github.com/remarkjs/remark-lint#using-remark-to-fix-your-markdown)
* on how to automatically fix warnings for this rule.
*
* @example {"setting": "indented", "name": "ok.md"}
* @example
* {"setting": "indented", "name": "ok.md"}
*
* alpha()
*
* Paragraph.
*
* bravo()
*
* @example {"setting": "indented", "name": "not-ok.md", "label": "input"}
* @example
* {"setting": "indented", "name": "not-ok.md", "label": "input"}
*
* ```
* alpha()
Expand All @@ -43,12 +45,14 @@
* bravo()
* ```
*
* @example {"setting": "indented", "name": "not-ok.md", "label": "output"}
* @example
* {"setting": "indented", "name": "not-ok.md", "label": "output"}
*
* 1:1-3:4: Code blocks should be indented
* 7:1-9:4: Code blocks should be indented
*
* @example {"setting": "fenced", "name": "ok.md"}
* @example
* {"setting": "fenced", "name": "ok.md"}
*
* ```
* alpha()
Expand All @@ -60,20 +64,23 @@
* bravo()
* ```
*
* @example {"setting": "fenced", "name": "not-ok-fenced.md", "label": "input"}
* @example
* {"setting": "fenced", "name": "not-ok-fenced.md", "label": "input"}
*
* alpha()
*
* Paragraph.
*
* bravo()
*
* @example {"setting": "fenced", "name": "not-ok-fenced.md", "label": "output"}
* @example
* {"setting": "fenced", "name": "not-ok-fenced.md", "label": "output"}
*
* 1:1-1:12: Code blocks should be fenced
* 5:1-5:12: Code blocks should be fenced
*
* @example {"name": "not-ok-consistent.md", "label": "input"}
* @example
* {"name": "not-ok-consistent.md", "label": "input"}
*
* alpha()
*
Expand All @@ -83,11 +90,13 @@
* bravo()
* ```
*
* @example {"name": "not-ok-consistent.md", "label": "output"}
* @example
* {"name": "not-ok-consistent.md", "label": "output"}
*
* 5:1-7:4: Code blocks should be indented
*
* @example {"setting": "💩", "name": "not-ok-incorrect.md", "label": "output", "positionless": true}
* @example
* {"setting": "💩", "name": "not-ok-incorrect.md", "label": "output", "positionless": true}
*
* 1:1: Incorrect code block style `💩`: use either `'consistent'`, `'fenced'`, or `'indented'`
*/
Expand Down
9 changes: 6 additions & 3 deletions packages/remark-lint-definition-case/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,18 @@
* @fileoverview
* Warn when definition labels are not lowercase.
*
* @example {"name": "ok.md"}
* @example
* {"name": "ok.md"}
*
* [example]: http://example.com "Example Domain"
*
* @example {"name": "not-ok.md", "label": "input"}
* @example
* {"name": "not-ok.md", "label": "input"}
*
* [Example]: http://example.com "Example Domain"
*
* @example {"name": "not-ok.md", "label": "output"}
* @example
* {"name": "not-ok.md", "label": "output"}
*
* 1:1-1:47: Do not use uppercase characters in definition labels
*/
Expand Down
9 changes: 6 additions & 3 deletions packages/remark-lint-definition-spacing/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,18 @@
* @fileoverview
* Warn when consecutive whitespace is used in a definition.
*
* @example {"name": "ok.md"}
* @example
* {"name": "ok.md"}
*
* [example domain]: http://example.com "Example Domain"
*
* @example {"name": "not-ok.md", "label": "input"}
* @example
* {"name": "not-ok.md", "label": "input"}
*
* [example····domain]: http://example.com "Example Domain"
*
* @example {"name": "not-ok.md", "label": "output"}
* @example
* {"name": "not-ok.md", "label": "output"}
*
* 1:1-1:57: Do not use consecutive whitespace in definition labels
*/
Expand Down
27 changes: 18 additions & 9 deletions packages/remark-lint-emphasis-marker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,40 +22,49 @@
* See [Using remark to fix your Markdown](https://github.com/remarkjs/remark-lint#using-remark-to-fix-your-markdown)
* on how to automatically fix warnings for this rule.
*
* @example {"setting": "*", "name": "ok.md"}
* @example
* {"setting": "*", "name": "ok.md"}
*
* *foo*
*
* @example {"setting": "*", "name": "not-ok.md", "label": "input"}
* @example
* {"setting": "*", "name": "not-ok.md", "label": "input"}
*
* _foo_
*
* @example {"setting": "*", "name": "not-ok.md", "label": "output"}
* @example
* {"setting": "*", "name": "not-ok.md", "label": "output"}
*
* 1:1-1:6: Emphasis should use `*` as a marker
*
* @example {"setting": "_", "name": "ok.md"}
* @example
* {"setting": "_", "name": "ok.md"}
*
* _foo_
*
* @example {"setting": "_", "name": "not-ok.md", "label": "input"}
* @example
* {"setting": "_", "name": "not-ok.md", "label": "input"}
*
* *foo*
*
* @example {"setting": "_", "name": "not-ok.md", "label": "output"}
* @example
* {"setting": "_", "name": "not-ok.md", "label": "output"}
*
* 1:1-1:6: Emphasis should use `_` as a marker
*
* @example {"name": "not-ok.md", "label": "input"}
* @example
* {"name": "not-ok.md", "label": "input"}
*
* *foo*
* _bar_
*
* @example {"name": "not-ok.md", "label": "output"}
* @example
* {"name": "not-ok.md", "label": "output"}
*
* 2:1-2:6: Emphasis should use `*` as a marker
*
* @example {"setting": "💩", "name": "not-ok.md", "label": "output", "positionless": true}
* @example
* {"setting": "💩", "name": "not-ok.md", "label": "output", "positionless": true}
*
* 1:1: Incorrect emphasis marker `💩`: use either `'consistent'`, `'*'`, or `'_'`
*/
Expand Down
27 changes: 18 additions & 9 deletions packages/remark-lint-fenced-code-flag/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,51 +15,60 @@
* An `allowEmpty` field (`boolean`, default: `false`) can be set to allow
* code blocks without language flags.
*
* @example {"name": "ok.md"}
* @example
* {"name": "ok.md"}
*
* ```alpha
* bravo()
* ```
*
* @example {"name": "not-ok.md", "label": "input"}
* @example
* {"name": "not-ok.md", "label": "input"}
*
* ```
* alpha()
* ```
*
* @example {"name": "not-ok.md", "label": "output"}
* @example
* {"name": "not-ok.md", "label": "output"}
*
* 1:1-3:4: Missing code language flag
*
* @example {"name": "ok.md", "setting": {"allowEmpty": true}}
* @example
* {"name": "ok.md", "setting": {"allowEmpty": true}}
*
* ```
* alpha()
* ```
*
* @example {"name": "not-ok.md", "setting": {"allowEmpty": false}, "label": "input"}
* @example
* {"name": "not-ok.md", "setting": {"allowEmpty": false}, "label": "input"}
*
* ```
* alpha()
* ```
*
* @example {"name": "not-ok.md", "setting": {"allowEmpty": false}, "label": "output"}
* @example
* {"name": "not-ok.md", "setting": {"allowEmpty": false}, "label": "output"}
*
* 1:1-3:4: Missing code language flag
*
* @example {"name": "ok.md", "setting": ["alpha"]}
* @example
* {"name": "ok.md", "setting": ["alpha"]}
*
* ```alpha
* bravo()
* ```
*
* @example {"name": "not-ok.md", "setting": ["charlie"], "label": "input"}
* @example
* {"name": "not-ok.md", "setting": ["charlie"], "label": "input"}
*
* ```alpha
* bravo()
* ```
*
* @example {"name": "not-ok.md", "setting": ["charlie"], "label": "output"}
* @example
* {"name": "not-ok.md", "setting": ["charlie"], "label": "output"}
*
* 1:1-3:4: Incorrect code language flag
*/
Expand Down
Loading

0 comments on commit 5c398a8

Please sign in to comment.