0.1.9 • Published 10 months ago

ts-type-diagnostic v0.1.9

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
10 months ago

ts-type-diagnostic

Show Typescript assignment errors in a conflict table.

This is a global npm tool that runs in the terminal and uses the Typescript Compiler API to generate a conflict table with links.

IOW Instead of a multiline hover error like this, a table that shows the conflicting types with links that bring you to their declaration.

link

In some cases this tool can also fix the problem. link

Installation

# Global installation is recommended.
npm install -g ts-type-diagnostic

Usage

Command Line

# Create a conflict table for a ts file with assignment errors.
tstd file.ts

# Create a verbose table.
tstd --v file.ts

Semantic Errors

Most Typescript errors are easy to fix--they're on the same line they occur:

const A: number;
# Can't assign A to B.
const B: string = A;

But where do you look if A is:

  • declared on another line, perhaps in another file, perhaps in another package
  • is a return type and B on another line, perhaps in another file, perhaps in another package
  • A and B are both type shapes with mismatched or missing properties
  • B is an array and A is an array item
  # Type FC<Node> is not assignable to ShapeComponent.
   # Type of 'props' and 'props' are unassignable
    # England is the capital of France
  return NodeShape
0.0.20

12 months ago

0.0.21

12 months ago

0.0.22

12 months ago

0.0.24

11 months ago

0.0.25

11 months ago

0.1.2

11 months ago

0.1.8

10 months ago

0.0.26

11 months ago

0.1.7

10 months ago

0.1.9

10 months ago

0.1.4

11 months ago

0.1.3

11 months ago

0.1.6

11 months ago

0.1.5

11 months ago

0.0.18

12 months ago

0.0.17

12 months ago

0.0.16

12 months ago

0.0.15

12 months ago

0.0.14

12 months ago

0.0.12

12 months ago

0.0.10

12 months ago

0.0.9

12 months ago

0.0.8

12 months ago

0.0.7

12 months ago

0.0.6

12 months ago