(node)
| 72 | } |
| 73 | return { |
| 74 | ExportNamedDeclaration(node) { |
| 75 | const page = context.filename.split('pages', 2)[1] |
| 76 | if (!page || path.parse(page).dir.startsWith('/api')) { |
| 77 | return |
| 78 | } |
| 79 | |
| 80 | const decl = node.declaration |
| 81 | |
| 82 | if (!decl) { |
| 83 | return |
| 84 | } |
| 85 | |
| 86 | switch (decl.type) { |
| 87 | case 'FunctionDeclaration': { |
| 88 | checkTypos(node, decl.id.name) |
| 89 | break |
| 90 | } |
| 91 | case 'VariableDeclaration': { |
| 92 | decl.declarations.forEach((d) => { |
| 93 | if (d.id.type !== 'Identifier') { |
| 94 | return |
| 95 | } |
| 96 | checkTypos(node, d.id.name) |
| 97 | }) |
| 98 | break |
| 99 | } |
| 100 | case 'ClassDeclaration': |
| 101 | // We don't need to check typos in class declarations. |
| 102 | break |
| 103 | default: |
| 104 | decl satisfies never |
| 105 | } |
| 106 | return |
| 107 | }, |
| 108 | } |
| 109 | }, |
| 110 | }) |
nothing calls this directly
no test coverage detected