@atlaskit/eslint-plugin-design-system
Version:
The essential plugin for use with the Atlassian Design System.
15 lines (14 loc) • 540 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.isPropertyKey = void 0;
var _eslintCodemodUtils = require("eslint-codemod-utils");
var _isDecendantOfType = require("./is-decendant-of-type");
var isPropertyKey = exports.isPropertyKey = function isPropertyKey(node) {
if ((0, _eslintCodemodUtils.isNodeOfType)(node, 'Identifier') && (0, _isDecendantOfType.isDecendantOfType)(node, 'Property')) {
var parent = node.parent;
return node === parent.key || parent.shorthand;
}
return false;
};