Skip to content

Commit

Permalink
Add BabelFile type annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperpeulen committed Jan 12, 2023
1 parent e0656f2 commit 2322343
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion code/lib/codemod/src/transforms/csf-2-to-3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,10 @@ class StorybookImportHelper {
constructor(csf: CsfFile, info: FileInfo) {
// This allows for showing buildCodeFrameError messages
// @ts-expect-error File is not yet exposed, see https://github.com/babel/babel/issues/11350#issuecomment-644118606
const file = new babel.File({ filename: info.path }, { code: info.source, ast: csf._ast });
const file: BabelFile = new babel.File(
{ filename: info.path },
{ code: info.source, ast: csf._ast }
);
this.sbImportDeclarations = this.getAllSbImportDeclarations(file);
}

Expand Down

0 comments on commit 2322343

Please sign in to comment.