Skip to content

Commit 96a6d13

Browse files
committed
fix(document-exported): Ensure that document-exported does not document constructors separately
1 parent 355038d commit 96a6d13

File tree

5 files changed

+173
-101
lines changed

5 files changed

+173
-101
lines changed

lib/extractors/exported.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,11 @@ function traverseExportedSubtree(path, data, addComments, overrideName) {
165165
path.skip();
166166
},
167167
Method(path) {
168-
addComments(data, path);
168+
// Don't explicitly document constructor methods: their
169+
// parameters are output as part of the class itself.
170+
if (path.node.kind !== 'constructor') {
171+
addComments(data, path);
172+
}
169173
path.skip();
170174
}
171175
});

test/fixture/document-exported.input.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Options: {"documentExported": true}
22

33
export class Class {
4+
constructor(a: string) {}
45
classMethod() {}
56
get classGetter() {}
67
set classSetter(v) {}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy