Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function checkMethodAccessibilityModifier(methodDefinition) {
let nodeType = 'method definition'
if (['get', 'set'].includes(methodDefinition.kind)) {
nodeType = `${methodDefinition.kind} property accessor`
}
if (isTypeScriptFile(context.getFilename())) {
const methodName = util.getNameFromClassMember(methodDefinition, sourceCode)
if (!!methodDefinition.accessibility) {
reportIssue('presentModifier', nodeType, methodDefinition, methodName)
}
}
}