UNPKG

@atlaskit/eslint-plugin-design-system

Version:

The essential plugin for use with the Atlassian Design System.

9 lines 356 B
import { isNodeOfType } from 'eslint-codemod-utils'; import { isDecendantOfType } from './is-decendant-of-type'; export var isPropertyKey = function isPropertyKey(node) { if (isNodeOfType(node, 'Identifier') && isDecendantOfType(node, 'Property')) { var parent = node.parent; return node === parent.key || parent.shorthand; } return false; };