(child: ts.JsxChild)
| 610 | } |
| 611 | |
| 612 | private isJsxText(child: ts.JsxChild): boolean { |
| 613 | if (!ts.isJsxText(child)) { |
| 614 | return false; |
| 615 | } |
| 616 | |
| 617 | // Tolerance for `;` and whitespace characters in text, we just ignore them. |
| 618 | let value = child.text.replace(/(\s|;)+/, ''); |
| 619 | |
| 620 | if (value) { |
| 621 | this.onError(child, 'Text elements are not supported in JSX. Use <label/> to render a text node.'); |
| 622 | } |
| 623 | |
| 624 | return true; |
| 625 | } |
| 626 | |
| 627 | private isEmptyJsxExpression(child: ts.JsxChild): boolean { |
| 628 | if (!ts.isJsxExpression(child)) { |
no test coverage detected