christina-de-martinez / babel-plugin-glowup-vibes

the most goated babel plugin
978 stars 68 forks source link

TypeScript Support #24

Open Offroaders123 opened 12 months ago

Offroaders123 commented 12 months ago

Not sure how to handle ghosted and return null just yet.

The TSConfig is only to demo these types in the source file, to show that it works at the type-checking level. To use the types in TS with this plugin, you just have to add babel-plugin-glowup-vibes to your own TSConfig in the types config option, and use Babel to transpile your TypeScript down to JS. Or another option is that you could use // @ts-check if you don't want to use the full TS syntax.

Offroaders123 commented 12 months ago

Looking into ways of extending the TypeScript compiler with language service plugins, it may be able to allow the missing features I mentioned above to work. That kind of thing is new to me with the TypeScript compiler, and I could use something like that in other projects too. Here's to hoping it can work! https://www.typescriptlang.org/tsconfig#plugins https://github.com/microsoft/TypeScript/wiki/Writing-a-Language-Service-Plugin