typecomment
v0.0.3
Published
This repository is an experiment in converting JavaScript files with TypeScript type comments to TypeScript files for type checking without emitting.
Downloads
4
Readme
TypeScript Comment Types
This repository is an experiment in converting JavaScript files with TypeScript type comments to TypeScript files for type checking without emitting.
This is useful for when you need your files to remain valid JavaScript files, but also want to
use actual TypeScript instead of something like allowJs
+checkJs
+JSDoc. In my experience,
JSDoc is very limited and not useful enough in more complex typing scenarios (generics, overloads,
inference etc.).
See also the TypeScript issue on this topic.
Running
See the online demo.
Testing
This Azure Pipeline running TypeScript is deliberately failing to showcase the TypeScript type-check error.
Contributing
- [ ] Use the TypeScript compiler API to find the comments and replace them with their contents