ts-check-without-ts

0.0.6 • Public • Published

TypeScript Checking Without TypeScript

CircleCI Greenkeeper badge

This repository demonstrates using @ts-check and JSDoc within a JavaScript file to catch type errors.

AKA: Using TypeScript to type check JavaScript!

Visual Example


Usage

Clone this repository. Install its dependencies. See the errors in src/index.js. Fix them. Run tests (npm test). Now you get why @ts-check and JSDoc work together to assist you in writing safer code! 💅🏾

Within the src/ and build/ finished files are added if you get confused. Otherwise fixing issues within index.js and making tests pass should take little time.


Setup

  1. Clone: git clone git@github.com:yowainwright/ts-check-without-ts.git
  2. Within jest.config.js, remove these lines:
     '/src/index.js', // @here remove this line to test changes
     '/src/__tests__/index.js', // @here remove this line to test changes
  3. Within src/index.js remove this line /* eslint-disable */

Readme

Keywords

Package Sidebar

Install

npm i ts-check-without-ts

Weekly Downloads

2

Version

0.0.6

License

MIT

Unpacked Size

290 kB

Total Files

31

Last publish

Collaborators

  • yowainwright