@atlaskit/eslint-plugin-design-system
Version:
The essential plugin for use with the Atlassian Design System.
14 lines • 422 B
JavaScript
import { isNodeOfType } from 'eslint-codemod-utils';
var _isDecendantOfSvgElement = function 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;
};
export { _isDecendantOfSvgElement as isDecendantOfSvgElement };