Skip to content

Commit

Permalink
fix(recast/babel): pass tokens: true to @babel/parser
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards1211 committed Sep 1, 2022
1 parent 431b267 commit 6900ec0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/chooseGetBackend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ export default function chooseGetBackend(parser: string): GetBackend {
case 'babel':
return getBabelBackend
case 'recast/babel':
return getRecastBackend(getBabelBackend)
return getRecastBackend(
(file: string, options?: { [k in string]?: any }) =>
getBabelBackend(file, {
...options,
tokens: true,
})
)
default:
throw new Error(`unknown parser: ${parser}`)
}
Expand Down

0 comments on commit 6900ec0

Please sign in to comment.