(property: p.TSESTree.ObjectLiteralElement)
| 540 | } |
| 541 | |
| 542 | function getProp(property: p.TSESTree.ObjectLiteralElement) { |
| 543 | if (property.type === "SpreadElement") error("spread operator is not allowed", property); |
| 544 | if (property.computed) error("key must be bare", property); |
| 545 | if (property.value.type === "AssignmentPattern") error("AssignmentPattern is not allowed", property); |
| 546 | if (property.value.type === "TSEmptyBodyFunctionExpression") { |
| 547 | error("TSEmptyBodyFunctionExpression is not allowed", property); |
| 548 | } |
| 549 | return { key: getIdentifier(property.key), value: property.value }; |
| 550 | } |
| 551 | |
| 552 | function getTagAndProps(node: p.TSESTree.ObjectExpression) { |
| 553 | const props = node.properties.map(getProp); |
no test coverage detected