Live data from Hacker News

A text adventure game on TypeScript's type system

github.com

11–20 of 33 posts

Re: A text adventure game on TypeScript's type system

#12

Earlier quoted context omitted.

git clone, make sure TypeScript is installed, and open src/index.ts Would be nice if this was exported to some TypeScript playground environment.

Easiest is to just press `.` on the GitHub repo to open the GH dev environment

wtf! I had no idea this existed!

Re: A text adventure game on TypeScript's type system

#15
post #3

I never get tired of seeing fun little things like this. Is there a way to make VSCode not truncate the type info?

`noErrorTruncation: true` in a tsconfig.[1] It also affects hover and quickinfo truncation. Technically it will still truncate, just at a way higher limit, like a million characters.

[1]https://www.typescriptlang.org/tsconfig#noErrorTruncation

Re: A text adventure game on TypeScript's type system

#17

This is neat. Can someone explain why the generic types extending string need to default to any in all these cases, like: `TDescription extends string = any` ?

It’s just so I can later reuse that type without having to pass in the generic. Like I do on lines 41 and 42

Re: A text adventure game on TypeScript's type system

#19
post #3

I never get tired of seeing fun little things like this. Is there a way to make VSCode not truncate the type info?

`noErrorTruncation: true` in a tsconfig.[1] It also affects hover and quickinfo truncation. Technically it will still truncate, just at a way higher limit, like a million characters. [1] https://www.typescriptlang.org/tsconfig#noErrorTruncation

> Setting "noErrorTruncation": true, as proposed in the previous answer, does not work for this question as asked.

https://stackoverflow.com/questions/62508909/vs-code-how-to-...

Re: A text adventure game on TypeScript's type system

#20

Earlier quoted context omitted.

git clone, make sure TypeScript is installed, and open src/index.ts Would be nice if this was exported to some TypeScript playground environment.

Easiest is to just press `.` on the GitHub repo to open the GH dev environment

I'm really surprised I've never even discovered that accidentally. If nothing else, this is a vastly superior way to search a repository.
Post reply on HN