Skip to content

Commit

Permalink
chore(doclint): exclude constructors by default (#938)
Browse files Browse the repository at this point in the history
Our API does not expose any classes; thus all the constructors
should be excluded from the API.
  • Loading branch information
aslushnikov committed Oct 2, 2017
1 parent 6c9a994 commit 017429e
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions utils/doclint/check_public_api/index.js
Expand Up @@ -35,22 +35,8 @@ const EXCLUDE_CLASSES = new Set([
]);

const EXCLUDE_METHODS = new Set([
'Body.constructor',
'Browser.constructor',
'ConsoleMessage.constructor',
'Dialog.constructor',
'ElementHandle.constructor',
'Frame.constructor',
'Headers.constructor',
'Headers.fromPayload',
'Keyboard.constructor',
'Mouse.constructor',
'Touchscreen.constructor',
'Tracing.constructor',
'Page.constructor',
'Page.create',
'Request.constructor',
'Response.constructor',
]);

/**
Expand Down Expand Up @@ -145,6 +131,9 @@ function filterJSDocumentation(jsDocumentation) {
const members = cls.membersArray.filter(member => {
if (member.name.startsWith('_'))
return false;
// Exclude all constructors by default.
if (member.name === 'constructor' && member.type === 'method')
return false;
return !EXCLUDE_METHODS.has(`${cls.name}.${member.name}`);
});
classes.push(new Documentation.Class(cls.name, members));
Expand Down

0 comments on commit 017429e

Please sign in to comment.