Typescript is mad

Went back to make some updates to an older CLI Pack, and now Typescript is mad about a bunch of things it wasn’t mad about before. (I don’t know Typescript very well, and at first it seemed like the compiler was cool with my sprinkle-types-in-some-places-but-not-everywhere approach, but now it’s complaining of things like

  • Unrecognized key(s) in object
  • null is not assignable to type ...
  • etc

Can I tell TS to chill out a bit with a config or something?

1 Like

Hard to guess but those seem like the more core parts of the type checking system that are probably not configurable.

Just make everything any until it works :man_shrugging:

1 Like

It’s a nuclear option, but you can disable all type checking in a file by including this line somewhere:

// @ts-nocheck

Alternatively, using @ts-ignore to just disable the checking on the following line.

let a = "abc";
// @ts-ignore
a = 123;

In most cases TypeScript is telling you something useful about how you could improve your code, but it doesn’t always do it in a way that’s easy to understand.

1 Like

Thanks all!

Any idea why it would be finding so many issues after previously being ok with the same codebase?

(Like, it won’t compile/upload now, and it definitely did before, as evidenced by the existence of the published pack)

1 Like

It’s a good question, and I don’t know for sure. How long ago did you last build the code? If it was during our beta we could have changed some settings since then.

1 Like