@atlaskit/eslint-plugin-design-system
Version:
The essential plugin for use with the Atlassian Design System.
19 lines (18 loc) • 545 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.isDecendantOfSvgElement = void 0;
var _eslintCodemodUtils = require("eslint-codemod-utils");
var _isDecendantOfSvgElement = exports.isDecendantOfSvgElement = function isDecendantOfSvgElement(node) {
if ((0, _eslintCodemodUtils.isNodeOfType)(node, 'JSXElement')) {
// @ts-ignore
if (node.openingElement.name.name === 'svg') {
return true;
}
}
if (node.parent) {
return _isDecendantOfSvgElement(node.parent);
}
return false;
};