@atlaskit/eslint-plugin-design-system
Version:
The essential plugin for use with the Atlassian Design System.
9 lines • 339 B
JavaScript
import { isNodeOfType } from 'eslint-codemod-utils';
import { isDecendantOfType } from './is-decendant-of-type';
export const isPropertyKey = node => {
if (isNodeOfType(node, 'Identifier') && isDecendantOfType(node, 'Property')) {
const parent = node.parent;
return node === parent.key || parent.shorthand;
}
return false;
};