@atlaskit/eslint-plugin-ui-styling-standard
Version:
The eslint plugin to enforce and educate on Atlassian's UI Styling Standard
24 lines (23 loc) • 564 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.isSafeProperty = isSafeProperty;
function hasSafeKey(property) {
if (property.computed) {
return property.key.type === 'Literal';
}
return true;
}
function isSafeProperty(property, isSafePropertyValue) {
if (property.type === 'SpreadElement') {
return false;
}
if (property.method || property.shorthand || property.kind !== 'init') {
return false;
}
if (!hasSafeKey(property)) {
return false;
}
return isSafePropertyValue(property.value);
}