typecomment

0.0.3 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i typecomment

Weekly Downloads

4

Version

0.0.3

License

none

Unpacked Size

4.28 kB

Total Files

7

Last publish

Collaborators

  • tomashubelbauer