File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import { transformAsync , createConfigItem } from '@babel/core' ;
1+ // @ts -expect-error Type definitions don't know about createConfigItemSync
2+ import { transformAsync , createConfigItemSync } from '@babel/core' ;
23import type { VisitNodeObject , Node } from '@babel/traverse' ;
34import { format , Options as PrettierOptions } from 'prettier' ;
45
56// @ts -expect-error We're only importing so we can create a config item, so we don't care about types
67import bts from '@babel/plugin-transform-typescript' ;
7- const babelTsTransform = createConfigItem ( [
8+ const babelTsTransform = createConfigItemSync ( [
89 bts ,
910 { allowDeclareFields : true , onlyRemoveTypeImports : true } ,
1011] ) ;
1112
1213// @ts -expect-error We're only importing so we can create a config item, so we don't care about types
1314import bsd from '@babel/plugin-syntax-decorators' ;
14- const babelDecoratorSyntax = createConfigItem ( [ bsd , { legacy : true } ] ) ;
15+ const babelDecoratorSyntax = createConfigItemSync ( [ bsd , { version : 'legacy' } ] ) ;
1516
1617export async function removeTypes ( code : string , prettierConfig : PrettierOptions | boolean = true ) {
1718 // Babel collapses newlines all over the place, which messes with the formatting of almost any
You can’t perform that action at this time.
0 commit comments