# TypeScript Tips Everyone Should Know: A Pattern Reference, Not a Course

> AllThingsSmitty/typescript-tips-everyone-should-know is a README-only collection of fifteen TypeScript patterns, published under CC0-1.0. It is a checklist for people already writing TypeScript, not a tutorial for people learning it.

**AllThingsSmitty/typescript-tips-everyone-should-know** — ✅ A collection of practical TypeScript patterns that improve safety, readability, maintainability, and developer experience.

- Repository: https://github.com/AllThingsSmitty/typescript-tips-everyone-should-know
- Stars: 415 · Forks: 5
- Language: Unknown
- License: CC0-1.0
- Published: 2026-09-20 · Updated: 2026-09-20 · Language: en
- Canonical page: https://hysenlabs.com/projects/allthingssmitty-typescript-tips-everyone-should-know

## What the repository actually contains

There is no package here. The top-level entries are CODE-OF-CONDUCT.md, CONTRIBUTING.md, LICENSE and README.md, and the README is the entire deliverable: a table of contents linking to fifteen short sections, each with a code sample and a few lines of explanation. The topics listed on the repository describe it as an awesome-list, a cheatsheet and a set of best practices, which matches what is on disk. Nothing is exported, nothing is versioned, and no releases are listed.

That shape determines who it is for. If you are already shipping TypeScript and want a compact list of habits that reduce type leakage, the fifteen headings are a reasonable audit sheet. If you are trying to learn the language, the sections assume you know what a discriminated union is before the section that models application state with one. The README does not teach syntax from zero.

## The through-line: prove the value before you use it

Read the sections in order and a single argument emerges. The README opens with preferring unknown over any, and the stated reason is that unknown forces you to prove what a value is before using it, while any skips the type system entirely. The same instinct recurs later: type predicates are described as a runtime check that teaches the compiler something, and the runtime validation section states outright that TypeScript does not validate API responses.

The strongest example is the satisfies section. Added in TS 4.9 according to the README, satisfies checks that a value matches a type while preserving its inferred type, whereas as asserts a type and discards what the compiler could have inferred. The README's guidance is to use satisfies when validating object shapes and reserve as for information the compiler genuinely cannot infer. That is a defensible rule and a sharper one than the usual advice to avoid as everywhere.

Where the collection is weakest is depth. Several sections end after two code blocks and a bullet list, and the reasoning stops at why the pattern is nicer rather than when it breaks down. The unknown section, for instance, shows a typeof guard on a string and stops there; narrowing an unknown object property by property is not covered.

## Installing nothing: how to put the tips to work

The repository publishes no npm package, so there is no install command to run. The practical path is to clone it for local reading, then apply individual patterns in your own project. The README gives no clone instructions; the command below is the standard one for the repository's default branch.

```bash
git clone https://github.com/AllThingsSmitty/typescript-tips-everyone-should-know.git
cd typescript-tips-everyone-should-know
```

Inside you will find the README and the community files, nothing executable. To try a pattern, the fastest route is to turn on the strict compiler options the README recommends and paste a snippet into a file the compiler checks.

```json
{
  "compilerOptions": {
    "strict": true
  }
}
```

The README names the strict compiler options as one of the fifteen tips but does not list which flags strict enables or show a full tsconfig.json. With strict on, the unknown example compiles as written and the any-free version of the same code will not, because the compiler refuses to let you call toUpperCase on a value it has not seen narrowed. That failure is the point of the tip.

One caveat before you copy the runtime-validation snippet. It shows a zod schema, and zod is a third-party package the README never tells you to install. Adding it is your decision and your dependency, not something the repository provides.

## Where the advice stops short

The runtime validation section is the clearest gap. It states that every API response, form submission, environment variable, JSON file and user input is an untrusted boundary, which is correct, then shows a zod schema without naming the package as an install step or mentioning alternatives. A reader who takes the tip seriously has to leave the README to find out how to act on it.

The enum section is similarly blunt. It says to avoid enum in most cases and acknowledges that enums still have valid use cases, but never says which ones. If your codebase depends on enum for reverse mapping or for const enum inlining, the README gives you no way to judge whether your case is the exception it keeps gesturing at.

A third limit is structural. This is a list, so the sections do not build on each other. The exhaustive-check section assumes the discriminated union from the previous section, but nothing else in the file is sequenced. That makes it easy to read and easy to skim past the parts that would change your code.

## How it compares with a type-checked runtime library

The obvious alternative for the runtime-validation tip is a library such as zod itself, which the README already uses in its example. The difference in approach matters. This repository is prose: it tells you that external data is untrusted and that TypeScript cannot validate it. A library such as zod is the mechanism that does the validating, producing a parser you call at the boundary and a type you derive from the schema instead of writing twice.

Choosing between them is not really a choice. The README is a set of opinions you read once and argue about in review; a schema library is code that runs in production and fails loudly when a response does not match. If your problem is that nobody on the team agrees on when to reach for as, read the tips. If your problem is that a malformed API response crashed a page, the tips will not fix it, and the zod snippet in the README is a pointer rather than a solution.

## Licence, maintenance and what a fork costs you

The licence is CC0-1.0, which places the work in the public domain. For a text collection that is generous and low-friction: you can copy sections into an internal style guide without an attribution requirement, though keeping a link back is the decent thing to do. CC0 is not a software licence, so it says nothing about the snippets as code in your build; treat the examples as text you retype rather than a licensed dependency. None of this is legal advice.

The repository is not archived, and the last push was on 2026-08-17. There are no releases, so there is no upgrade path to track and no changelog to read. Maintenance cost is therefore near zero and also near zero benefit: nothing in your build depends on it, and nothing will break when it changes. The real cost of adopting it is social, not technical. Pasting fifteen rules into a team wiki invites fifteen arguments, and the README resolves none of them with data. The CONTRIBUTING.md file exists if you want to propose a correction, and because the licence permits it, forking is equally open.

## Conclusion

Adopt it as a review checklist if your team already writes TypeScript and keeps arguing about any versus unknown, as versus satisfies, or enum versus literal unions, because the fifteen sections map onto those arguments directly. Do not adopt it as a teaching resource or as a dependency: there is no package to install, no build step, and no runnable sample project, and the README's own runtime-validation section shows a zod schema without stating that zod must be added separately. Before you cite it in a style guide, open the README and confirm which of the fifteen sections your codebase actually violates, then check the repository's CONTRIBUTING.md for how changes are proposed, since the licence places the text in the public domain and anyone can fork it without asking.

## FAQ

### Is AllThingsSmitty/typescript-tips-everyone-should-know a package I can install?

No. The repository contains only documentation: a README plus CODE-OF-CONDUCT.md, CONTRIBUTING.md and LICENSE. There is no package to install and no releases are listed, so the tips are read and applied by hand.

### What do I need to know to learn TypeScript from these tips?

The README assumes prior TypeScript knowledge rather than teaching it from zero. The sections on discriminated unions and exhaustive checks with never build on concepts the reader is expected to already understand, and the first tip opens with unknown versus any rather than with basic syntax.

### What are the most important concepts covered in the tips?

The fifteen sections cover unknown instead of any, type inference, satisfies instead of as, deriving types from values, discriminated unions, exhaustive checks with never, as const, type predicates, utility types such as Pick and Omit, runtime validation, avoiding enum, inferable generics, strict compiler options, template literal types and the distinction between type safety and runtime safety.

### Does the repository include the zod dependency used in its validation example?

No. The runtime validation section shows a zod schema, but the repository publishes no package and the README does not present adding zod as an install step. If you want to follow that tip, adding the dependency is your own decision.

### Can I copy these TypeScript tips into my own project documentation?

The repository is licensed CC0-1.0, which places the work in the public domain, so copying sections into an internal style guide is permitted. Note that CC0 covers the text, not the snippets as a software dependency.

## Sources

- [AllThingsSmitty/typescript-tips-everyone-should-know on GitHub](https://github.com/AllThingsSmitty/typescript-tips-everyone-should-know)
- [Issues](https://github.com/AllThingsSmitty/typescript-tips-everyone-should-know/issues)
- [License: CC0-1.0](https://github.com/AllThingsSmitty/typescript-tips-everyone-should-know/blob/main/LICENSE)
- [README](https://github.com/AllThingsSmitty/typescript-tips-everyone-should-know/blob/main/README.md)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/allthingssmitty-typescript-tips-everyone-should-know
