UNPKG

@atlaskit/eslint-plugin-design-system

Version:

The essential plugin for use with the Atlassian Design System.

16 lines 430 B
function unrollMemberExpression(exp) { if (exp.type === 'JSXIdentifier') { return exp.name; } return unrollMemberExpression(exp.object); } export function getJSXElementName(jsx) { switch (jsx.name.type) { case 'JSXIdentifier': return jsx.name.name; case 'JSXMemberExpression': return unrollMemberExpression(jsx.name.object); case 'JSXNamespacedName': return jsx.name.namespace.name; } }