@atlaskit/eslint-plugin-design-system
Version:
The essential plugin for use with the Atlassian Design System.
13 lines • 334 B
JavaScript
import { isNodeOfType } from 'eslint-codemod-utils';
export const isDecendantOfSvgElement = node => {
if (isNodeOfType(node, 'JSXElement')) {
// @ts-ignore
if (node.openingElement.name.name === 'svg') {
return true;
}
}
if (node.parent) {
return isDecendantOfSvgElement(node.parent);
}
return false;
};