Skip to content

Commit

Permalink
Fix TS warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
peterp committed May 11, 2021
1 parent f56b078 commit b007329
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions packages/internal/src/ast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ interface NamedExports {
*/
export const getNamedExports = (code: string): NamedExports[] => {
const namedExports: NamedExports[] = []
traverse(parse(code), {
const ast = parse(code) as types.Node
traverse(ast, {
ExportNamedDeclaration(path) {
// Re-exports from other modules
// Eg: export { a, b } from './module'
Expand Down Expand Up @@ -63,7 +64,8 @@ export const getNamedExports = (code: string): NamedExports[] => {

export const hasDefaultExport = (code: string): boolean => {
let exported = false
traverse(parse(code), {
const ast = parse(code) as types.Node
traverse(ast, {
ExportDefaultDeclaration() {
exported = true
return
Expand Down
3 changes: 2 additions & 1 deletion packages/internal/src/findFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export const findCells = (webSrcDir: string = getPaths().web.src) => {
if (exportedQUERY && exportedSuccess) {
return p
}
return false
})
.filter((p) => typeof p === 'string')
.filter(Boolean)
}

0 comments on commit b007329

Please sign in to comment.