TypeScript code review: best practices, checklist, and tools (2026)
TypeScript can catch a lot of problems before a PR ever reaches code review. But not every piece of code that compiles is correct.
A type assertion can hide an invalid value. An any can remove an important guarantee. And an API response can be treated as trustworthy without anyone validating what it actually contains.
These are problems that get past the compiler and still make it to production.
This guide walks through the main points worth checking in a TypeScript code review, with code examples, a checklist to use on PRs, and the tools that help automate part of that process.
For JavaScript reviews, see also JavaScript code review best practices, and for the review process itself, independent of language, the general code review checklist.
Updated November 4, 2026
What should you review in a TypeScript PR?
A good TypeScript code review needs to check whether types actually represent the application’s data and behavior, on top of catching what the compiler can’t detect on its own.
The main points of attention:
- type safety (
any,unknown, and type assertions) - project configuration (
strict,strictNullChecks, and other compiler options) - handling of
null,undefined, and falsy values - type modeling (union types, generics, and invalid states)
- public contracts (exported functions, interfaces, and shared types)
- validation of external data (APIs, requests, webhooks, and environment variables)
- React component contracts and Node.js backend inputs
- data used in tests (fixtures and mocks)
Not every one of these points needs a deep look on every PR. A small change to a React component, for example, calls for different attention than a change to an authentication endpoint.
What matters is knowing where the risk sits in a given change and focusing the review there.
Why does TypeScript need its own code review checklist?
TypeScript helps catch type errors during development, but its guarantees depend on the types declared and the project’s configuration.
Consider this example:
const user = response.data as User;
To the compiler, user is now treated as User, but that doesn’t mean the data the API actually returned follows that shape.
If the response comes back without a required property, or with an unexpected value, the code can still fail at runtime.
That’s the kind of problem the review needs to catch.
Instead of only checking whether the code is typed, ask:
- Does the type represent the real data?
- Is there an assumption that was never validated?
- Does the code allow states that shouldn’t exist?
- Could a change to this contract affect other parts of the application?
These questions help catch the kind of problem a static check alone doesn’t solve.
How should you review type safety in TypeScript?
Before getting into more complex types, check three things: the compiler configuration, the use of any, and how unknown data is handled.
Is the TypeScript configuration correct?
The first step is checking tsconfig.json.
The strict option turns on a stricter set of checks, including noImplicitAny and strictNullChecks.
{
"compilerOptions": {
"strict": true
}
}
Without these checks, the compiler can accept situations that should raise an error, such as a potentially null value being used without any handling.
In a project with multiple packages, check the inherited configuration too. A package can override the root tsconfig and end up running with weaker checks than the rest of the project.
Before requesting a review, run the automated checks already available:
tsc --noEmit
eslint .
prettier --check .
The exact command depends on each repository’s setup. Ideally these checks already run in CI, so the reviewer isn’t spending time pointing out what the compiler, the linter, or the formatter already catch on their own.
When is using any a problem?
any lets you work with a value without the type checks TypeScript would normally apply.
That can be useful in specific situations, like integrating with a library that doesn’t ship proper types, or a gradual migration from JavaScript to TypeScript.
The problem shows up when any is used just to get around a compiler error.
function getUserEmail(user: any) {
return user.profile.email;
}
TypeScript can’t verify whether profile exists or whether email is available. If the value received doesn’t have that shape, the application can fail at runtime.
During the review, check whether:
- there’s a concrete reason to use
any - the usage is isolated and doesn’t spread into other parts of the code
- a more specific type could represent the value
unknownwould be a safer alternative
You don’t need to ban any in every situation. The concern is making sure its use doesn’t drop an important guarantee without justification.
When should you use unknown instead of any?
unknown is a safer alternative when the shape of a value isn’t known yet.
This comes up often with API responses, webhooks, files, and other external sources.
Unlike any, unknown forces the code to check the value before using it.
type User = { id: string; email: string; };function isUser(value: unknown): value is User {
return (
typeof value === "object" &&
value !== null &&
"id" in value &&
typeof value.id === "string" &&
"email" in value &&
typeof value.email === "string"
);
}
Now you can check the structure before accessing its properties:
const data: unknown = response.data;if (!isUser(data)) {
throw new Error("Invalid user data");
}console.log(data.email);
The check confirms the expected properties exist and have the types they need.
During the review, look for places where external data gets used directly as an internal type, with no validation at all. It’s one of the spots where a TypeScript application can look safe to the compiler and still be exposed to unexpected data.
How should you review whether a type can be trusted in TypeScript?
Past the basics, the problem changes shape: the code already has a type, and the question is whether that type can actually be guaranteed at the point it’s used. Three patterns answer that: assertions, null values, and union types.
Is a type assertion hiding an incompatibility?
Type assertions, like as User, tell the compiler which type to assume for a value. They don’t run any validation at runtime.
const user = response.data as User;
If response.data doesn’t follow the expected contract, the assertion doesn’t stop the problem.
That doesn’t mean every type assertion should go. There are situations where the code genuinely knows something the compiler can’t infer. What matters is checking whether that assertion documents a real guarantee or just hides uncertainty.
When the value comes from an external source, prefer a validation schema, like Zod:
const user = UserSchema.parse(response.data);
That way the shape gets checked at runtime before the value is treated as User. An equivalent type guard works too, depending on how complex the data is.
When the goal is checking whether an object defined in your own code satisfies a contract, without the data coming from outside, satisfies is usually a better fit than as:
const config = {
retries: 3,
backoffMs: 500,
} satisfies RetryConfig;
Unlike a type assertion, satisfies still reports an error if the object doesn’t match the given type, and it keeps the expression’s inferred type instead of just telling the compiler to accept it. During the review, check whether as is actually needed or whether satisfies would keep the type checking intact.
Are null and undefined handled consistently?
Even with strictNullChecks on, the code still needs to correctly represent situations where a value might not exist.
type User = {
id: string;
profile?: {
name: string;
};
};
Here, profile can be missing. Code that accesses that property needs to account for that.
Optional chaining helps with that access:
return user.profile?.name;
If profile doesn’t exist, the expression returns undefined instead of trying to read name off a missing value.
For default values, ?? is usually the better fit when the fallback should only kick in for null or undefined:
const displayName = user.profile?.name ?? "Anonymous";
Watch out for || too:
const retries = config.retries || 3;
If config.retries is 0, the code falls back to 3, even though zero might be a valid value for that setting. With ??, the behavior changes:
const retries = config.retries ?? 3;
Now the fallback only kicks in when retries is null or undefined.
During the review, check whether the code distinguishes a missing value from a valid one that just happens to be falsy, like 0, false, or an empty string.
Is a switch or if-chain over a union type exhaustive?
Union types represent a specific value or state explicitly:
type ReviewStatus = "pending" | "approved" | "rejected";
The problem shows up when the code uses those states without accounting for all of them:
function describeStatus(status: ReviewStatus) {
switch (status) {
case "pending":
return "Pending review";
case "approved":
return "Approved";
}
}
The function doesn’t handle "rejected". If it receives that value, it returns undefined, and depending on the project’s configuration and how the return value gets used, that can pass without a compile error.
An exhaustiveness check with never fixes that:
function describeStatus(status: ReviewStatus): string {
switch (status) {
case "pending":
return "Pending review";
case "approved":
return "Approved";
case "rejected":
return "Rejected";
default: {
const _exhaustive: never = status;
return _exhaustive;
}
}
}
Now, if someone adds a new value to the union without updating the switch, TypeScript flags the mismatch. The pattern is especially useful for process statuses, user roles and permissions, component states, event types, and subscription plans.
During the review, look for conditions that depend on a union and check whether every state is handled. In a lot of cases, that stops a seemingly small change from introducing unexpected behavior somewhere else in the application.
How should you review contracts in TypeScript?
A correct type isn’t the same thing as a clear contract. A function can be correctly typed and still offer a confusing contract, or allow invalid use.
Does the API have a clear contract?
When reviewing an exported function, hook, component, or shared package, look at the signature first:
export function buildReviewSummary(
pullRequest: PullRequest,
comments: ReviewComment[]
): ReviewSummary {
// ...
}
The parameters and the return value make clear what the function expects and what it delivers. An explicit return type helps a lot on public or shared APIs, because it keeps the contract stable even when the implementation changes.
During the review, consider:
- Does the signature make it clear how the function should be used?
- Do the parameters represent information that’s actually necessary?
- Is there an argument combination that should be invalid?
- Does the return value communicate the possible states?
- Could an internal change alter the contract another module relies on?
Watch the type names too. A generic type like Data, Info, Item, or Payload gets harder to follow once it’s used across several parts of the project; prefer a name that represents the application’s domain.
The goal isn’t to add complexity to the typing. It’s to make the contract easier to understand and harder to misuse.
Do React props model the component’s real states?
In a React component, typing needs to correctly represent the props and the states the component can actually be in.
A common red flag is a component with several related boolean props:
<Button isPrimary isDestructive isIconOnly />
Depending on the implementation, that combination might not make sense. If the options are mutually exclusive, a union represents the contract more clearly:
type ButtonVariant = "primary" | "destructive" | "icon";type ButtonProps = {
variant: ButtonVariant;
children?: React.ReactNode;
};
That way the component gets one defined variant, instead of allowing any combination of flags.
When reviewing a React component, also check for:
- an optional prop that should be required
- a callback typed generically as
Function - an event handler using
any - nullable state that isn’t correctly represented
- a hook that returns a structure that’s hard to follow
The main question is whether the typing helps prevent invalid use of the component, or just describes every possible combination.
This section stays deliberately scoped to type modeling. useEffect dependencies, rules of hooks, and unnecessary re-renders are a behavior problem, not a type-contract one, and they still matter in a complete code review, but they deserve their own article instead of a squeezed-in section here.
How should you review TypeScript at the edges of the system?
TypeScript doesn’t automatically validate the data the application receives at runtime. Even in a strictly typed project, requests, webhooks, environment variables, and thrown errors are still runtime data, and the two points below are the same problem showing up in different places.
Does error handling preserve the original problem?
In JavaScript, any value can be thrown as an error, not just instances of Error. That’s why the code shouldn’t assume a variable caught in a catch block has properties like message or stack.
try {
await runImport();
} catch (err: unknown) {
if (err instanceof Error) {
console.error(err.message);
} else {
console.error("Unknown import failure", err);
}
}
Here the code checks the type before accessing message. This matters most in code that uses observability tooling, structured logging, or shows an error message to the user.
During the review, check whether:
- the error is treated as an unknown value when needed
- the handling preserves information that’s useful for investigating
- a failure inside the error handling itself could hide the original problem
- sensitive information isn’t exposed in a log or a public response
The goal is making sure error handling helps diagnose the problem, instead of introducing a new failure.
Does Node.js code treat requests, webhooks, and environment variables as external data?
Internal code can be well typed, but requests, webhooks, queues, environment variables, and external service responses are still runtime data.
const input = req.body as CreateUserInput;
The assertion makes the compiler treat the body as CreateUserInput, but it doesn’t check the data received. If a required property is missing, the rest of the application can end up using an invalid value.
const input = CreateUserSchema.parse(req.body);
The same concern applies to query and route params, headers, webhooks, queue messages, external service responses, and data loaded from a file. Check whether proper validation exists and whether it happens before the data is used by the application’s logic.
Environment variables are external data too. In Node.js, process.env can return undefined when a setting doesn’t exist, and that can cause a problem worse than a failed startup: imagine an authentication check that depends on a required variable. If the code doesn’t confirm it exists before using it, a misconfiguration can compromise what the check was supposed to guarantee.
Validate required configuration at application startup. That way a misconfigured environment fails explicitly, instead of continuing to run with an unexpected value, exactly the kind of failure a security vulnerability identification process should surface. Further down this guide there’s a real example of this exact problem, caught in a public cal.com PR.
How should you review generics and tests in TypeScript?
The last two traps sit outside the happy path: a generic that promises more than the runtime guarantees, and a test that pretends to validate a contract it actually ignores.
Does a generic promise more than the runtime guarantees?
Generics are useful when there’s an abstraction that genuinely needs to work across different types, but they can also create a false sense of safety by promising something the runtime can’t actually enforce.
async function fetchData<T>(url: string): Promise<T> {
const response = await fetch(url);
return response.json() as Promise<T>;
}
Whoever calls the function picks any type for T:
const user = await fetchData<User>("/api/user");
Nothing confirms the response actually follows User‘s shape. One alternative is to have the function take a validation function:
async function fetchData<T>( url: string, parse: (value: unknown) => T ): Promise<T> { const response = await fetch(url); const data: unknown = await response.json();return parse(data);
}
Now the function requires the data it receives to go through validation or conversion before it’s returned as T.
During the review, look at both extremes: duplicated code that would benefit from an abstraction, and a generic that’s too complex for a simple problem. A generic should make code reuse easier without making the contract harder to understand.
Does the test use data that matches the real type?
Tests can hide type problems too, especially when fixtures and mocks are built with a type assertion.
const user = {
id: "1"
} as User;
If User requires other properties, that assertion lets you create an incomplete fixture without the compiler flagging it. That makes the test use different data than what the application actually expects.
A factory fixes that:
function createUser(overrides: Partial<User> = {}): User {
return {
id: "user-1",
email: "user@example.com",
name: "Test User",
...overrides
};
}
With a factory, the test only changes the field that matters, while keeping a valid structure by default.
During the review, check whether:
- the fixture respects the real contract
- an assertion is being used to hide a missing property
- the mock represents a realistic behavior of the dependency
- invalid input is tested when the code handles external data
- a complex type needs a dedicated type-level test
Runtime tests and type checks solve different problems: a test confirms a function’s behavior, a type check guarantees a given argument combination isn’t accepted. Writing unit tests that stay useful covers that first point in more depth, testing observable behavior instead of implementation detail.
Complete TypeScript code review checklist
Use this checklist as a reference during review. Not every item applies to every PR, so prioritize the ones related to the code that actually changed.
Type safety
- Is there a justification for using
any? - Is an unknown value treated as
unknownwhere appropriate? - Is
strictenabled intsconfig? - Is a type assertion hiding an incompatibility?
- Could
satisfiesbe used instead of an assertion? - Is external data validated before it gets an internal type?
- Is a union type handled exhaustively?
- Is a nullable value handled correctly?
- Would
??be more appropriate than||? - Do the types prevent invalid states?
API and contract
- Does the public function have a clear signature?
- Does the type name represent the application’s domain?
- Is the shared contract consistent?
- Could an internal change break a contract another module relies on?
- Does the API allow an invalid parameter combination?
- Do the types represent the application’s real behavior?
React
- Are the props typed correctly?
- Is an optional prop actually optional?
- Does the event handler have a specific type?
- Is nullable state correctly represented?
- Does the hook return an understandable structure?
- Do the props prevent an invalid combination?
Node.js and backend
- Is the request body validated?
- Are route params and query params converted and validated?
- Is a required environment variable checked at startup?
- Are webhooks and queue messages treated as external data?
- Does the type used for database data match the real schema?
- Is an error checked before accessing a specific property?
Tests
- Does the fixture follow the real type?
- Does an assertion hide incomplete data?
- Is invalid input covered by a test?
- Does the mock represent a contract close to the real one?
- Does a complex type need a dedicated test?
What are the best code review tools for TypeScript?
Part of this checklist is mechanical enough to automate. TypeScript, ESLint, and static analysis tools are important for catching known problems, like type mismatches, forbidden code patterns, and some classes of vulnerability.
But there’s still a problem that depends heavily on context, which is understanding whether a change breaks a business rule, introduces a regression, or creates a vulnerability a static rule alone can’t catch. That’s where an AI code review tool complements traditional checks; manual vs. automated code review covers where that line actually sits.
We ran a benchmark comparing AI code review tools. The goal was simple: take real PRs from large open-source projects, each with a bug already documented and confirmed by the maintainers, and run the same PR through four tools, under the same default configuration, with no hint or custom rule for any of them. We compared Kodus, CodeRabbit, GitHub Copilot, and Cursor Bugbot across 38 PRs from five open-source repositories, including cal.com, which is TypeScript, and the result was clear: Kodus caught 30 of 38 known bugs (79%), followed by Cursor Bugbot (58%), GitHub Copilot (53%), and CodeRabbit (39%).
When picking a tool for a TypeScript project, weigh four criteria:
| Criterion | What to evaluate |
|---|---|
| Custom rules | Does the tool enforce the team’s own standards and conventions? |
| Specialized reviewer | Can you set up a dedicated analysis for security, architecture, or tests? |
| Repository context | Does the tool look beyond the diff and reuse relevant context? |
| Model and infrastructure | Is there support for BYOK, a different model, or self-hosting? |
Comparing the tools
| Tool | Best for | Key differentiators |
|---|---|---|
| Kodus | Teams that need custom rules, persistent context, and control over the model | Kody Rules, Kody Memories, Custom Agents, BYOK, and self-hosting |
| CodeRabbit | Teams that want to combine PR review, triage, and security tooling | Linter and SAST integration, custom rules, and PR triage |
| Cursor Bugbot | Teams already using Cursor for development | Integration with the Cursor ecosystem, specific rules, and autofix |
| GitHub Copilot | Teams already using GitHub Copilot | Review built into GitHub and reuse of the repository’s own instructions |
1. Kodus
Kodus is an open source AI code review platform, available as a cloud service or self-hosted. It lets you configure review rules, keep context about the repository, and choose the model used, through BYOK.
Key features
- Kody Rules: custom review instructions in plain language, applied to a specific file or to the whole PR.
- Kody Memories: persistent context about the project’s conventions and decisions, with an approval flow for AI-generated memories.
- Custom Agents: lets you create an agent focused on one specific concern, such as security, architecture, or test coverage, with its own instructions and tools. It runs alongside Kody on the same PR and only comments on what it was set up to look at.
- BYOK: connect a different provider (OpenAI, Anthropic, Google, Vertex AI, an OpenAI-compatible endpoint) and choose which model runs each review.
- Self-hosting: run your own instance of Kodus on your team’s infrastructure, with the same rules, memory, and BYOK capabilities.
These capabilities are useful on a TypeScript project with specific architecture rules, data validation, or contract organization. A team can set a rule requiring every new endpoint to validate its input before using it, or configure a dedicated agent to review security-related changes, instead of relying only on the general PR review. What makes an AI code review agent actually work explains why these capabilities matter more than the model running behind them.
A real example: an authentication failure in a TypeScript webhook
In PR #11 of the repository used in the experiment, run against a fork of cal.com, a change adds a webhook endpoint protected by a secret set through an environment variable:
if (
req.headers[process.env.CALCOM_WEBHOOK_HEADER_NAME || "calcom-webhook-secret"] !==
process.env.CALCOM_WEBHOOK_SECRET
) {
return res.status(403).json({ message: "Invalid webhook secret" });
}
The problem is the direct use of process.env.CALCOM_WEBHOOK_SECRET. If that variable isn’t set, the comparison becomes undefined !== undefined, which is false: the if never blocks anything, and anyone with no secret at all can create or update any user’s credentials in the system.
In the benchmark, Kodus flagged this as a critical issue. The other three tools tested didn’t catch it in this scenario.
This example shows why a TypeScript code review needs to look at the code’s behavior, not just its typing. The variable was being used in a way that was perfectly valid to the compiler, but the real problem was something else: a missing configuration that could compromise a security check, exactly what the Node.js section of this guide describes.
2. CodeRabbit
CodeRabbit combines AI code review with PR triage and integrations with static analysis and security tools. It’s an option for teams that want to consolidate different checks into one tool.
Key features
- Rule configuration through
.coderabbit.yaml, withpath_instructions, custom checks, andast-grepinstructions. - Around 60 linters and SAST tools integrated, including Semgrep, Trivy, and TruffleHog.
- A security agent, an issue planner, plus Slack and Discord agents.
- Bring your own model, but only on self-hosted Enterprise.
On a TypeScript project, the linter and security tooling integration can complement the AI-generated review.
Consideration: self-hosting and a custom model are Enterprise-only, with a documented 500-seat minimum; the cloud plans don’t offer model choice.
3. Cursor Bugbot
Cursor Bugbot is Cursor’s own PR review tool, built for teams already developing with the company’s editor and agents.
Key features
- Review rules through a
BUGBOT.mdfile, per directory. - Rules learned automatically from the team’s activity on GitHub, or set manually via
@cursor remember. - MCP tool support in a review, on Team and Enterprise.
- Integration with Cursor’s own autofix feature.
For a team already centered on Cursor, this integration simplifies the workflow.
Consideration: it isn’t self-hosted, it runs as a Cursor service even when connected to a self-managed Git server, and the documentation doesn’t mention model choice for the review itself.
4. GitHub Copilot
GitHub Copilot also has AI code review built into GitHub, using instructions kept in the repository itself.
Key features
- Code review built into GitHub PRs.
- Support for
.github/copilot-instructions.mdand path-specific instructions in.github/instructions/. - Reuses the same instruction file the coding agent already follows.
For a team already paying for Copilot, the advantage is adding AI review to a workflow that already exists.
Consideration: BYOK is in preview for Copilot Chat, CLI, IDEs, and the desktop app, but the documentation doesn’t mention that capability for PR code review specifically, nor a dedicated agent system for that case.
Which tool should you choose for your team?
| Need | Tool to consider |
|---|---|
| Custom rules, persistent context, BYOK, and self-hosting | Kodus |
| Review integrated with PR triage and security tooling | CodeRabbit |
| Review connected to the Cursor development environment | Cursor Bugbot |
| Review built into the GitHub Copilot the team already uses | GitHub Copilot |
The choice depends on how your team already builds and reviews code. On a TypeScript project, test the tool with a PR that represents a real problem from the repository: a tool can be good at catching common mistakes and still miss a rule specific to your application’s domain. Beyond comparing features, look at suggestion quality, how much irrelevant commentary it produces, and how well it identifies what actually needs fixing before merge.
Frequently asked questions about TypeScript code review
What is a TypeScript code review checklist?
It’s a list of points a reviewer checks beyond what the compiler already guarantees: whether any has a reason, whether external data is validated before becoming an internal type, whether a union type is handled exhaustively, and whether a function’s, component’s, or endpoint’s contract stays clear for whoever uses it later. The goal is catching the kind of problem that gets past tsc with no error and still breaks in production.
What are TypeScript code review best practices?
Start with tsconfig: without strict enabled project-wide, the rest of the checklist is worth less. After that, question every any and every unjustified type assertion, validate external data before treating it as an internal type, and check whether union types and error handling cover every case, not just the happy path.
How do you automate TypeScript code review?
tsc --noEmit, ESLint, and Prettier in CI handle the mechanical part: type errors, formatting, and forbidden code patterns, without needing a human reviewer for that. What’s left out is what depends on context, like knowing whether a change breaks a business rule or introduces a regression. That’s where an AI code review tool, with configurable rules and memory for the repository, complements traditional automation.
What are the best code review tools for TypeScript?
It depends on what your team already uses. For teams that need their own rules, persistent context, and control over the model, Kodus is the most direct option, including self-hosting. For teams already centered on Cursor or already paying for GitHub Copilot, the review built into those tools avoids adding another product; for a large PR queue that also needs triage and a security scanner, CodeRabbit covers more ground in one tool.
What’s the difference between any and unknown in TypeScript?
any turns off type checking for the value: any property can be accessed without the compiler complaining. unknown keeps type checking on and forces the code to validate or narrow the value before using it, which makes it the safer choice for data that hasn’t had its shape confirmed yet.
When should you use satisfies instead of as?
Use satisfies when the object is already defined in your own code and just needs to be checked against a type, without losing each field’s more specific inference. as doesn’t validate anything, it only tells the compiler which type to assume; satisfies still reports an error if the object doesn’t match the type.
What is exhaustiveness checking in TypeScript?
It’s the check that every case of a union type has been handled, usually done with a default branch that assigns the remaining value to never. If someone adds a new value to the union later and forgets to handle that case, the build breaks instead of the code silently returning undefined in production.
Is Kodus good for reviewing TypeScript code?
Kody Rules lets you lock in a repository-specific pattern in plain language, and BYOK lets you choose the provider and model used in the review. In a benchmark comparing Kodus, CodeRabbit, GitHub Copilot, and Cursor Bugbot across 38 real PRs from open-source projects, including one in TypeScript, Kodus caught 79% of known bugs, ahead of the other three tools tested.
Better TypeScript code review, every day
A good TypeScript code review doesn’t stop at catching what the compiler already flags. The goal is checking whether the code stays correct when it receives unexpected data, goes through a contract change, or interacts with another part of the application.
That means paying attention to:
- Do the types represent the real data?
- Is there an assertion hiding information that hasn’t been validated?
- Does the contract allow an invalid state?
- Is external input checked before it’s used?
- Could a change introduce a regression somewhere else in the system?
The compiler, the linter, tests, and an AI review tool each help at a different stage of that process, each with its own limit, and combining them tends to give more complete coverage.
This guide’s checklist is a starting point for manual review or for defining automated rules in the repository, the same way the general guide to doing code review serves as a base for any language.
In the end, it’s not enough for code to pass tsc. The types need to represent the application’s real behavior, including when it receives data nobody accounted for during development.