UNPKG

@atlaskit/eslint-plugin-design-system

Version:

The essential plugin for use with the Atlassian Design System.

10 lines 380 B
import { isNodeOfType } from 'eslint-codemod-utils'; export const isDecendantOfGlobalToken = node => { if (isNodeOfType(node, 'CallExpression') && isNodeOfType(node.callee, 'Identifier') && (node.callee.name === 'token' || node.callee.name === 'getTokenValue')) { return true; } if (node.parent) { return isDecendantOfGlobalToken(node.parent); } return false; };