mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
Automatically generate table-of-contents for markdown
This patch teaches doclint to regenerate table of contents automatically whenever it's needed. This patch: - splits lint.js into lint.js and cli.js - teaches cli.js to generate table-of-contents - removes the test for table-of-contents errors from doclint - adds a test for doclint failing to parse object destructuring in method parameters.
This commit is contained in:
@@ -3,5 +3,9 @@
|
||||
- `arg1` <[string]>
|
||||
- `arg2` <[string]>
|
||||
|
||||
#### foo.bar(options)
|
||||
- `options` <[Object]>
|
||||
|
||||
#### foo.test(...files)
|
||||
- `...filePaths` <[string]>
|
||||
|
||||
|
||||
@@ -4,4 +4,7 @@ class Foo {
|
||||
|
||||
test(...filePaths) {
|
||||
}
|
||||
|
||||
bar({visibility}) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
<!-- toc -->
|
||||
|
||||
- [class: Dialog](#class-dialog)
|
||||
|
||||
<!-- tocstop -->
|
||||
|
||||
### class: Foo
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
class Foo {
|
||||
}
|
||||
@@ -1,4 +1,7 @@
|
||||
[JavaScript] JS Parsing issue: unsupported syntax to define parameter in Foo.bar(): {visibility}
|
||||
[MarkDown] Heading arguments for "foo.test(...files)" do not match described ones, i.e. "...files" != "...filePaths"
|
||||
[MarkDown] Method Foo.bar() fails to describe its parameters:
|
||||
- Non-existing argument found: options
|
||||
[MarkDown] Method Foo.constructor() fails to describe its parameters:
|
||||
- Argument not found: arg3
|
||||
- Non-existing argument found: arg2
|
||||
[MarkDown] Heading arguments for "foo.test(...files)" do not match described ones, i.e. "...files" != "...filePaths"
|
||||
- Non-existing argument found: arg2
|
||||
@@ -1 +0,0 @@
|
||||
[MarkDown] Markdown TOC is outdated, run `yarn generate-toc`
|
||||
@@ -1,4 +1,4 @@
|
||||
[MarkDown] foo.www() has mistyped 'return' type declaration: expected exactly 'returns: ', found 'returns '.
|
||||
[MarkDown] Async method Foo.asyncFunction should describe return type Promise
|
||||
[MarkDown] Method Foo.return42 is missing return type description
|
||||
[MarkDown] Method Foo.returnNothing has unneeded description of return type
|
||||
[MarkDown] foo.www() has mistyped 'return' type declaration: expected exactly 'returns: ', found 'returns '.
|
||||
[MarkDown] Method Foo.returnNothing has unneeded description of return type
|
||||
@@ -35,11 +35,10 @@ describe('doclint', function() {
|
||||
it('02-method-errors', SX(test));
|
||||
it('03-property-errors', SX(test));
|
||||
it('04-bad-arguments', SX(test));
|
||||
it('05-outdated-toc', SX(test));
|
||||
it('05-event-errors', SX(test));
|
||||
it('06-duplicates', SX(test));
|
||||
it('07-sorting', SX(test));
|
||||
it('08-return', SX(test));
|
||||
it('09-event-errors', SX(test));
|
||||
});
|
||||
|
||||
async function test() {
|
||||
|
||||
Reference in New Issue
Block a user