(j: any, root: any, line: number, col: number)
| 29 | * Returns the ASTPath or null. |
| 30 | */ |
| 31 | export function findJSXElementAt(j: any, root: any, line: number, col: number): any | null { |
| 32 | let target: any = null; |
| 33 | root.find(j.JSXElement).forEach((p: any) => { |
| 34 | const loc = p.node.openingElement.loc; |
| 35 | if (loc && loc.start.line === line && loc.start.column === col) { |
| 36 | target = p; |
| 37 | } |
| 38 | }); |
| 39 | return target; |
| 40 | } |
| 41 | |
| 42 | /** |
| 43 | * Reorder JSX siblings by swapping elements at the given lines. |
no outgoing calls
no test coverage detected