CodeRabbit logoCodeRabbit logo
FeaturesEnterpriseCustomersPricingBlog
Resources
  • Docs
  • Trust Center
  • Contact Us
  • FAQ
Log InGet a free trial
CodeRabbit logoCodeRabbit logo

Products

Pull Request ReviewsIDE ReviewsCLI Reviews

Navigation

About UsFeaturesFAQSystem StatusCareersDPAStartup ProgramVulnerability Disclosure

Resources

BlogDocsChangelogCase StudiesTrust CenterBrand Guidelines

Contact

SupportSalesPricingPartnerships

By signing up you agree to our Terms of Use and Privacy Policy

discord iconx iconlinkedin iconrss icon
footer-logo shape
Terms of Service Privacy Policy

CodeRabbit Inc © 2026

CodeRabbit logoCodeRabbit logo

Products

Pull Request ReviewsIDE ReviewsCLI Reviews

Navigation

About UsFeaturesFAQSystem StatusCareersDPAStartup ProgramVulnerability Disclosure

Resources

BlogDocsChangelogCase StudiesTrust CenterBrand Guidelines

Contact

SupportSalesPricingPartnerships

By signing up you agree to our Terms of Use and Privacy Policy

discord iconx iconlinkedin iconrss icon

How to Automate TypeScript Code Reviews with CodeRabbit

by
Ankur Tyagi

Ankur Tyagi

November 06, 2024

5 min read

November 06, 2024

5 min read

  • Prerequisites
  • Why do you need an AI code reviewer?
  • How to configure CodeRabbit in GitHub
  • Reviewing TypeScript Code using CodeRabbit
    • Getting a PR review
  • Conclusion
Back to blog
Cover image

Share

https://victorious-bubble-f69a016683.media.strapiapp.com/Reddit_feecae8a6d.pnghttps://victorious-bubble-f69a016683.media.strapiapp.com/X_721afca608.pnghttps://victorious-bubble-f69a016683.media.strapiapp.com/Linked_In_a3d8c65f20.png

Cut code review time & bugs by 50%

Most installed AI app on GitHub and GitLab

Free 14-day trial

Get Started

Catch the latest, right in your inbox.

Add us your feed.RSS feed icon
newsletter decoration

Catch the latest, right in your inbox.

Add us your feed.RSS feed icon

Keep reading

Article Card ImageArticle Card ImageArticle Card ImageArticle Card Image

Why users shouldn’t choose their own LLM models: Choice is not always good

Giving users a dropdown of LLMs to choose from often seems like the right product choice. After all, users might have a favorite model or they might want to try the latest release the moment it drops. One problem: unless they’re an ML engineer runnin...

Article Card ImageArticle Card ImageArticle Card ImageArticle Card Image

An (actually useful) framework for evaluating AI code review tools

Benchmarks promise clarity. They’re supposed to reduce a complex system to a score, compare competitors side by side, and let the numbers speak for themselves. But, in practice, they rarely do. Benchmarks don’t measure “quality” in the abstract. They...

Article Card ImageArticle Card ImageArticle Card ImageArticle Card Image

CodeRabbit's AI Code Reviews now support NVIDIA Nemotron

TL;DR: Blend of frontier & open models is more cost efficient and reviews faster. NVIDIA Nemotron is supported for CodeRabbit self-hosted customers. We are delighted to share that CodeRabbit now supports the NVIDIA Nemotron family of open models amon...

Get
Started in
2 clicks.

No credit card needed

Your browser does not support the video.
Install in VS Code
Your browser does not support the video.

In code reviews, discussions often focus on minor issues like formatting and style, while critical aspects—such as functionality, performance, and backward compatibility—are overlooked. Code reviews can be even more challenging than writing code itself, as ensuring quality across these critical areas requires careful attention.

Image by Gunnar Morling, licensed under CC BY-SA 4.0.

Doing a 'perfect' code review means finding all the bugs, knowing best practices yourself, sorting through a bunch of code you didn't write, writing comments that could be taken as subjective criticism without sounding like a jerk, and justifying every comment you make. It's exhausting from a logical standpoint and a social standpoint. Or you can rubber stamp it but feel bad when a bug makes it through to production and the codebase becomes a mess.

10 lines changed : 10 comments, 500 lines changed : 'LGTM'.

Many development teams often focus on shipping bug-free code to production. While that's important, the ability to spot and resolve issues when they arise quickly is frequently overlooked—ideally through automated tools or straightforward processes. But what if I told you there's an easier way—one that streamlines code reviews in a fraction of the time? That's what CodeRabbit does.

In this guide, we'll learn how to catch issues in a popular OSS TypeScript codebase using CodeRabbit. Upon completion, you can review TypeScript pull requests in your codebase and ensure that only high-quality code is merged into our repository using the AI code reviewer CodeRabbit.

Want to jump right in? Here is the pull request for a quick look.

Prerequisites

CodeRabbit is language-agnostic, so you don't need a specific programming language background. However, this article demonstrates how CodeRabbit works using the Dub.co GitHub repository, written in Typescript.

Before you begin, make sure you have the following:

  • GitHub Profile - Ensure you have an active GitHub account to fork and contribute to various code repositories.

  • Code Editor - A powerful code editor like Visual Studio Code or IntelliJ IDEA

Why do you need an AI code reviewer?

As software engineering teams strive to maintain high-quality code while meeting tight deadlines, efficient and reliable code review processes become increasingly necessary.

CodeRabbit can 10x your team's productivity and code quality as it can help you with:

  • Faster Code Review Cycles

  • Consistent and Objective Feedback

  • Increased Developer Efficiency

  • Continuous Improvement

How to configure CodeRabbit in GitHub

Signing up with CodeRabbit is a two-step process. First, log in using your GitHub account and then add our GitHub app to your organization.

Next, we can integrate CodeRabbit into all our code repositories or select specific ones from the list.

Now, CodeRabbit is fully integrated into our repositories and ready to review any code changes. It is as simple as that.

Reviewing TypeScript Code using CodeRabbit

Dub. co is an open-source link management platform that offers features such as link shortening, analytics, free custom domains, a QR code generator for links, and more. Its codebase is written in TypeScript and React, so a basic understanding of these technologies will help you navigate it more effectively.

To get started, let's fork the Dub.co repository.

Next, run the following command in your terminal to clone the Dub.co TypeScript repository to your local computer.

git clone https://github.com/dubinc/dub.git

Install its package dependencies using the command below:

pnpm install

Rename or copy the .env.example file within the apps/web folder into a .env file:

cp .env.example .env

Follow the steps in the Dub. co Local Development Guide to set up and run a local version of dub.co on your computer.

Getting a PR review

Let us change the forked Dub. co repository and see how CodeRabbit identifies issues in a large TypeScript codebase.

Before we proceed, create a new GitHub branch called tutorial/coderabbit in our forked repo. This will enable us to compare both branches and create pull requests.

a GitHub repo showing branch selection with 'tutorial/coderabbit' highlighted.

Navigate into the app folder and update the code in the below files:

  • app.dub.co/(dashboard)/[slug]/page.tsx

  • apps/web/app/api/links/route.ts

  • apps/web/app/app.dub.co/(dashboard)/[slug]/auth.tsx

  • apps/web/app/app.dub.co/(dashboard)/layout.tsx

For example:

export default function WorkspaceLinks() {
  return (
    <div className="mx-auto my-3 w-[70%] px-2 text-center">
      <h2 className="mb-3 text-2xl text-orange-500">
        Testing how CodeRabbit works
      </h2>
      <p>
        CodeRabbit is an AI-powered code reviewer for your code repositories. It
        provides quick, context-aware code review feedback and line-by-line
        suggestions, significantly reducing manual review time.
      </p>
    </div>
  );
}

The code snippet changes the homepage content.

CodeRabbit test message showcasing code review features.

To demonstrate how CodeRabbit works, we have updated the page. TSX file with the wrong React syntax and pushed the code to the test branch. You can do this via the GitHub web interface or command line.

import WorkspaceLinksClient from "./page-client";

export default function WorkspaceLinks() {
  return (
    <>
      <h2 className="text-2xl mb-3 text-orange-500">
        Testing how CodeRabbit works
      </h2>
      <p>
        CodeRabbit is an AI-powered code reviewer for your code repositories. It provides quick, context-aware code review feedback and line-by-line suggestions, significantly reducing manual review time.
      </p>
    </>
  );
}

Next, we can compare both branches and create a pull request.

CodeRabbit-PR-Summary

CodeRabbit reviews the updated code on the tutorial/code rabbit branch, highlights the issues within the pull request, and even includes sequence diagrams showing how it analyses the code. Then, it provides a solution to ensure the pull request passes all necessary tests for merging.

For example, let's look at the CodeRabbit in action.

  • PR summary by CodeRabbit

PR summary by CodeRabbit

  • Complete walkthrough by CodeRabbit

PR walkthrough by CodeRabbit

  • Actionable comments by CodeRabbit

Actionable comments by CodeRabbit

Committable suggestion by CodeRabbit

You can check the example pull request here on the GitHub repository.

Congratulations. You've successfully integrated CodeRabbit into an open-source TypeScript repository.

Conclusion

We looked at how CodeRabbit could be integrated into a TypeScript repository.

CodeRabbit is an AI Code Reviewer that helps you or your team merge your code changes faster with superior code quality. There is more that you could do with CodeRabbit with TypeScript or JavaScript.

Here is some further reading:

  • Enabling Automated Linting with Biome, Eslint

  • Adding Custom Review Instructions

  • Discovering Code Intent Patterns

Sign up to CodeRabbit today and merge your PR 10x faster, without compromising code quality or security.