MCPcopy Create free account
hub / github.com/ampproject/amphtml / fix

Function fix

build-system/eslint-rules/preact.js:42–56  ·  view source on GitHub ↗
(fixer)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected