Skip to content

Commit

Permalink
fix(document-exported): Ensure that document-exported does not docume…
Browse files Browse the repository at this point in the history
…nt constructors separately
  • Loading branch information
tmcw committed Apr 24, 2017
1 parent 355038d commit 96a6d13
Show file tree
Hide file tree
Showing 5 changed files with 173 additions and 101 deletions.
6 changes: 5 additions & 1 deletion lib/extractors/exported.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,11 @@ function traverseExportedSubtree(path, data, addComments, overrideName) {
path.skip();
},
Method(path) {
addComments(data, path);
// Don't explicitly document constructor methods: their
// parameters are output as part of the class itself.
if (path.node.kind !== 'constructor') {
addComments(data, path);
}
path.skip();
}
});
Expand Down
1 change: 1 addition & 0 deletions test/fixture/document-exported.input.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Options: {"documentExported": true}

export class Class {
constructor(a: string) {}
classMethod() {}
get classGetter() {}
set classSetter(v) {}
Expand Down
Loading

0 comments on commit 96a6d13

Please sign in to comment.