Hacker Newsnew | past | comments | ask | show | jobs | submit | eezing's commentslogin

Awesome


Very functional.


When was product and design never the bottleneck?


Addictive


Aside from the following, JSDoc is absolutely TypeScript.

Discriminated unions, conditional types, mapped types, template literal types, recursive type aliases, higher-kinded type patterns, generic constraints with conditional inference, the infer keyword, never type exhaustiveness checking, const assertions, readonly tuple and array inference, exact object types, key remapping in mapped types, indexed access types, variance annotations, assertion signatures, strict null checking with flow-sensitive narrowing, definite assignment assertions, the satisfies operator, declaration merging, module augmentation, symbol-typed properties, type-safe enums

…and not written via comments


Yes, all of these are supported in JSDoc because they are supported in TypeScript. Because JSDoc is TypeScript. You can either define your types in JSDoc comments or in .ts files.

I really mean it. You can even use the @satisfies operator like so

  /** @satisfies {Type} */
Discriminated unions, conditional types, mapped types, template literal types, etc work exactly the same way if you define them in a JSDoc comment as if you define them in a .ts file


Sounds like Scala type fetishism all over again.


It looks AI won’t replace software engineers after all.


With AI, this is about to get a whole lot worse.


So don’t use Wikipedia then. Problem solved.


Have you actually tried to tag, edit, or leave comments when you come across questionable content?

I’ve found that the system works pretty well. It’s not perfect, but I can’t think of a better solution.


My favorite offenders are the CJS to ESM (only) conversions.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: