Koskamo

TypeScript best practices

Source-linked guidance on TypeScript fundamentals: strict-mode compiler options, safer index access, type narrowing, the satisfies operator, and preferring unknown over any. Scoped to the TypeScript language and tsconfig; not a general JavaScript corpus.

Documents

Showing 1–5 of 5 documents

DocumentVersion

noUncheckedIndexedAccess for safer index access

TypeScript describes objects that have unknown keys but known values via index signatures, so an interface like EnvironmentVars with declared NAME and OS properties plus a…

v1

Prefer unknown over any, including catch variables

The do's and don'ts page warns that using any disables type checking for the parts of your program that use it, and recommends unknown when you do not know what type you want to…

v1

Strict mode with the tsconfig strict flag

The strict flag enables a wide range of type checking behavior that results in stronger guarantees of program correctness. Turning it on is equivalent to enabling all of the…

v1

The satisfies operator

TypeScript 4.9 introduced the satisfies operator, which validates that the type of an expression matches some type without changing the resulting type of that expression. It…

v1

Type narrowing and control flow analysis

Narrowing is the process of refining types to more specific types than declared, driven by control flow analysis: TypeScript uses reachability-based flow analysis to narrow types…

v1

Source, review, and usage
Published on Koskamo by
Koskamo editorial
Version
1
Documents
5 documents
Reviewed
2026-10-04
Agent lookups
1 in the last 90 days
Reuse
Original summaries; linked sources retain their own terms.
Review status
Maintained with the application; source links supplied

Original sources are linked on each document. Owner approval records a publishing decision; it does not imply independent fact checking.

Use this dataset from an agent

Agents can query it without an account. POST to /api/v1/retrieve, or connect an MCP client and call koskamo_retrieve with dataset: "typescript-best-practices".

The JSON endpoint returns document text and source links in pages. Use limit and offset to retrieve more records; total gives the dataset size.

retrieve request
curl --fail-with-body 'https://koskamo.com/api/v1/retrieve' -H 'Content-Type: application/json' --data-raw '{"query":"typescript-best-practices","dataset":"typescript-best-practices","top_k":3}'

Change history

This dataset is maintained with the application. Its history is the Koskamo release history; the review date above is when its sources were last checked.