Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function isDeclare(node) {
return Lint.hasModifier(node.modifiers, ts.SyntaxKind.DeclareKeyword);
}
function isExport(node) {
function memberIsPrivate(node: ts.Declaration): boolean {
return Lint.hasModifier(node.modifiers, ts.SyntaxKind.PrivateKeyword, ts.SyntaxKind.ProtectedKeyword);
}
function nameIsIdentifier(node: ts.Node): node is ts.Identifier {
function isExport(node: ts.Node): boolean {
return Lint.hasModifier(node.modifiers, ts.SyntaxKind.ExportKeyword);
}
function isDeclare(node: ts.Node): boolean {
return Lint.hasModifier(node.modifiers, ts.SyntaxKind.DeclareKeyword);
}
if (!tag.description && OPTIONS.requireParamDescription) {
this.addFailure(this.createFailure(start, width, Rule.FAILURE_STRING.missingParameterDescription(tag.name)));
}
if (params[tag.name]) {
this.addFailure(this.createFailure(start, width, Rule.FAILURE_STRING.duplicateParameter(tag.name)));
}
else if (tag.name.indexOf('.') === -1) {
params[tag.name] = true;
}
break;
case 'return':
case 'returns':
hasReturns = true;
isAbstract = Lint.hasModifier(fn.node.modifiers, ts.SyntaxKind.AbstractKeyword);
if (!isAbstract && !OPTIONS.requireReturn && !fn.returnPresent && tag.type && tag.type.name !== 'void' && tag.type.name !== 'undefined') {
this.addFailure(this.createFailure(start, width, Rule.FAILURE_STRING.unexpectedTag(tag.title)));
}
else {
if (!tag.type && OPTIONS.requireReturnType) {
this.addFailure(this.createFailure(start, width, Rule.FAILURE_STRING.missingReturnType));
}
if (!this.isValidReturnType(tag) && !tag.description && OPTIONS.requireReturnDescription) {
this.addFailure(this.createFailure(start, width, Rule.FAILURE_STRING.missingReturnDescription));
}
}
break;
case 'constructor':
case 'class':
private check(node: ts.Node) {
if (node.modifiers && Lint.hasModifier(node.modifiers, ts.SyntaxKind.PublicKeyword)) {
this.addFailureAtNode(node, Rule.FAILURE_STRING);
}
}
}