(
node: ts.JsxElement | ts.JsxSelfClosingElement,
sourceFile: ts.SourceFile
)
| 307 | } |
| 308 | |
| 309 | private getJsxTagName( |
| 310 | node: ts.JsxElement | ts.JsxSelfClosingElement, |
| 311 | sourceFile: ts.SourceFile |
| 312 | ): string | null { |
| 313 | const tagName = ts.isJsxElement(node) ? node.openingElement.tagName : node.tagName; |
| 314 | |
| 315 | if (ts.isIdentifier(tagName)) { |
| 316 | return tagName.text; |
| 317 | } |
| 318 | |
| 319 | if (ts.isPropertyAccessExpression(tagName)) { |
| 320 | // e.g., form.AppField or field.Input |
| 321 | return tagName.getText(sourceFile); |
| 322 | } |
| 323 | |
| 324 | return null; |
| 325 | } |
| 326 | |
| 327 | /** Returns true if the JSX element has an attribute with the given name, regardless of its value. */ |
| 328 | private hasJsxAttribute( |
no outgoing calls
no test coverage detected