(fixer)
| 40 | ].join('\n\t'), |
| 41 | |
| 42 | fix(fixer) { |
| 43 | const ancestors = context.getAncestors(); |
| 44 | const program = ancestors[0]; |
| 45 | let firstImport = program.body.find( |
| 46 | (node) => node.type === 'ImportDeclaration' |
| 47 | ); |
| 48 | if (!firstImport) { |
| 49 | firstImport = ancestors[1]; |
| 50 | } |
| 51 | |
| 52 | return fixer.insertTextBefore( |
| 53 | firstImport, |
| 54 | `import * as Preact from '${packageName}';\n` |
| 55 | ); |
| 56 | }, |
| 57 | }); |
| 58 | } |
| 59 |
nothing calls this directly
no outgoing calls
no test coverage detected