tslint-clean-code
Version:
TSLint rules for enforcing Clean Code
14 lines (10 loc) • 376 B
text/typescript
import * as ts from 'typescript';
import { getJsxAttributesFromJsxElement } from '../JsxAttribute';
const hrefString: string = 'href';
/**
* @Returns the implicit role for a link tag.
*/
function getImplicitRoleForLink(node: ts.Node): string {
return getJsxAttributesFromJsxElement(node)[hrefString] ? 'link' : undefined;
}
export { getImplicitRoleForLink as link };