Skip to content

Instantly share code, notes, and snippets.

@dy
Last active August 16, 2023 14:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dy/994fc31188a25c2bec41628b86c01f3c to your computer and use it in GitHub Desktop.
Save dy/994fc31188a25c2bec41628b86c01f3c to your computer and use it in GitHub Desktop.
Why not typescript
  1. () => {} is not the same as () => void.
  2. {a?: string | undefined} is tautology.
  3. void | undefined | {} | never | null is tautology.
  4. Native types Record, Partial etc are a bunch of internal jargon, meaningless from JS view.
  5. Interfaces and types are same thing differently named, only creates confusion.
  6. unknown vs any: little who cares about the difference.
  7. JSX.Element, React.ReactNode, React.ReactFragment is tautology
  8. const X = {abc:123} as const
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment