New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

typecomment

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typecomment

This repository is an experiment in converting JavaScript files with TypeScript type comments to TypeScript files for type checking without emitting.

latest
npmnpm
Version
0.0.3
Version published
Maintainers
1
Created
Source

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

FAQs

Package last updated on 12 Jan 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts