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

CodeRabbit を使った TypeScript コードレビューの自動化

by
Atsushi Nakatsugawa

Atsushi Nakatsugawa

February 04, 2025

2 min read

February 04, 2025

2 min read

  • 前提条件
  • なぜAIコードレビューが必要なのか?
  • GitHubでのCodeRabbitの設定方法
  • CodeRabbitを使用したTypeScriptコードのレビュー
    • PRのレビューを受ける
  • まとめ
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

Developers are dead? Long live developers.

Predictions about the end of programming are nothing new. Every few years, someone confidently announces that this time developers are truly finished. If you listened to these self-proclaimed Nostradamuses, devs were previously set to be replaced by ...

Article Card ImageArticle Card ImageArticle Card ImageArticle Card Image

Misalignment: The hidden cost of AI coding agents isn't from AI at all

TL;DR: The real cost of AI agents isn’t tokens or tools; it’s misalignment that shows up as rework, slop, and slowed teams. The conversation everyone is having (and why it misses the point) Most conversations about AI coding agents sound like a fant...

Article Card ImageArticle Card ImageArticle Card ImageArticle Card Image

How to effectively plan issues on Linear using CodeRabbit Issue Planner

There's a gap between a ticket and meaningful code. Your ticket says, "Add dark mode support." Great, but what does that actually mean in code? Which files need changes? What patterns does the codebase already use for theming, and are there shared ut...

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.

本記事はHow to run AI Code Review on TypeScript using CodeRabbit?の意訳です。

コードレビューでは、フォーマットやスタイルなどの些細な問題に議論が集中しがちです。その一方で、機能性やパフォーマンス、下位互換性といった重要な側面が見落とされることがあります。 コードレビューは、コードを書くこと自体よりも難しい場合があります。なぜなら、レビューで品質を担保するには、細心の注意が必要だからです。

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

「完璧な」コードレビューを行うということは、すべてのバグを見つけ、ベストプラクティスを熟知し、自分が書いたわけでもない大量のコードを整理し、嫌な奴にならないよう・主観的な批判にならないようなコメントを書き、自分が書いたコメントをすべて正当化する必要があります。論理的にも、社会的にも疲れる作業です。形式的に承認することもできますが、バグが本番環境にリリースされてしまい、コードベースが混乱状態に陥る可能性があります。

10行変更:10件のコメント、500行変更:「問題なし」!

多くの開発チームは、バグのないコードを本番環境にリリースできるよう注力しています。もちろん、それは重要なことです。しかし、問題が発生した際に素早く問題を発見して解決する能力は、自動化ツールやシンプルなプロセスを通じて実現されるべきであるにも関わらず、見落とされがちです。 そこで、コードレビューの時間を大幅に短縮する、より簡単な方法があるとしたらどうでしょうか? それがまさにCodeRabbitです。

このガイドでは、CodeRabbit を使用して、人気の OSS TypeScript プロジェクトであるDub.co を利用して、コードの問題を検出する方法を学びます。これを読めば、TypeScript のプロジェクトに対して、AI コードレビューツール CodeRabbit を使用し、正しいコードのみをリポジトリにマージできるようになるでしょう。

すぐに始めたい方は、こちらの プルリクエスト をご覧ください。

前提条件

CodeRabbit は言語に依存しないため、特定のプログラミング言語の知識は必要ありません。本記事ではTypescriptで書かれたDub.coのGitHubリポジトリを使用して、CodeRabbitの動作を説明します。

始める前に、以下のものを用意してください。

  • GitHub プロフィール - 有効な GitHub アカウント

  • コードエディター - Visual Studio Code や IntelliJ IDEA など

なぜAIコードレビューが必要なのか?

開発チームは厳しい納期を守りながら、高品質のコードを維持するために、効率的で信頼性の高いコードレビュープロセスが重要になっています。

CodeRabbitは、以下のようなメリットにより、チームの生産性とコード品質を10倍向上させられます。

  • より迅速なコードレビューサイクル

  • 一貫性のある客観的なフィードバック

  • 開発者の効率性向上

  • 継続的な改善

GitHubでのCodeRabbitの設定方法

CodeRabbitへのサインアップは2ステップで行えます。まずGitHubアカウントでログインし、次にCodeRabbitのGitHubアプリをOrganizationに追加してください。

次に、CodeRabbitをすべてのリポジトリに統合するか、特定のリポジトリを選択します。

これでCodeRabbitがあなたのリポジトリに統合され、コードの変更をレビューする準備が整いました。

CodeRabbitを使用したTypeScriptコードのレビュー

Dub.co は、リンク短縮や分析、無料のカスタムドメイン、リンク用のQRコードジェネレーターなどの機能を提供するオープンソースのリンク管理プラットフォームです。 そのコードベースは TypeScript と React で開発されており、それらを習得していれば、より効率的に操作できます。

まず始めに、Dub.coのリポジトリをフォークします。

次に、ターミナルで以下のコマンドを実行して、Dub.co の TypeScript リポジトリをローカルにクローンします。

# リポジトリをクローン(dubincはあなたのGitHubユーザー名に置き換えてください)
git clone https://github.com/dubinc/dub.git

以下のコマンドで、パッケージの依存関係をインストールします。

pnpm install

apps/web フォルダ内の .env.example ファイルを .env ファイルにコピー(またはリネーム)します。

cp .env.example .env

Dub.co ローカル開発ガイドの手順に従って、dub.co をローカルでセットアップします。

PRのレビューを受ける

フォークした Dub.co リポジトリのファイルを変更し、CodeRabbitがどのようにレビューを行うのかを見てみましょう。

作業を始める前に、フォークしたリポジトリに tutorial/coderabbit という名前の新しいGitHubブランチを作成します。両方のブランチを比較したり、プルリクエストを作成したりできます。

「tutorial/coderabbit」がハイライトされたブランチ選択を示すGitHubリポジトリ

appフォルダに移動し、以下のファイルのコードを更新します。

  • 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

例:

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>
  );
}

このコードスニペットは、ホームページコンテンツを変更するものです。

CodeRabbitのテストメッセージでコードレビュー機能を紹介

CodeRabbitの動作を確認するために、ファイルを更新します。以下は間違ったReact構文を含んでおり、TSXファイルをテストブランチにプッシュします。GitHubのWeb UIまたはCLIから実行できます。

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>
    </>
  );
}

次に、二つのブランチを比較し、プルリクエストを作成します。

CodeRabbit-PR-Summary

CodeRabbitは、tutorial/code branchにある更新されたコードをレビューし、プルリクエストにある問題をハイライトし、コードを分析する方法を示すシーケンス図まで含めています。そして、プルリクエストがマージするために必要なすべてのテストに合格できるよう解決策を提供します。

例えば、CodeRabbitの実際の動作を見てみましょう。

  • CodeRabbitによるPRサマリー

CodeRabbitによるPRの概要

  • CodeRabbitによる完全なチュートリアル

CodeRabbitによるPRウォークスルー

  • CodeRabbitによる実用的なコメント

CodeRabbitによる実行可能なコメント

CodeRabbitによるコミット可能な提案

このプルリクエストの例は、GitHub リポジトリ で確認できます。

これで、CodeRabbit をオープンソースの TypeScript リポジトリに正常に統合できたことが確認できました!

まとめ

本記事では、CodeRabbit を TypeScript リポジトリに統合する方法について説明しました。

CodeRabbitは、あなたやあなたのチームがコードの変更をより迅速・優れた品質でマージできるよう支援するAIコードレビューツールです。TypeScriptやJavaScriptでは、CodeRabbitでさらに多くの使い方があります。

さらに詳しく知りたい方は、以下をご覧ください。

  • Biome、Eslintによる自動リンティングの有効化

  • カスタムレビュー指示の追加

  • コードインテントパターンの発見

CodeRabbitに 今すぐ登録 して、コード品質やセキュリティを損なわずに、あなたのPRを10倍速くマージしましょう。