kimamula / ts-transformer-keys

A TypeScript custom transformer which enables to obtain keys of given type
MIT License
778 stars 85 forks source link

Support for babel-loader? #32

Open sandorvasas opened 4 years ago

sandorvasas commented 4 years ago

Is there a way to get this working with babel-loader? Want to use it in a Create-React-App project which depends on babel-preset-react-app, which in turn depends on babel-typescript

kimamula commented 4 years ago

I am not familiar with babel-typescript, but if I understand correctly, it is likely that type checking is not available during TypeScript compilation with Babel. As ts-transformer-keys uses TypeScript type checker to get keys of given type, I think it is not possible to use this transformer with Babel.

saitonakamura commented 3 years ago

It's possible if you create a program separately and then get position info from babel and then ask ts api about types and stuff