Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .condrabbit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
review:
model: gpt-3.5 # 또는 'gpt-4' (유료 요금제 사용 시)
language: ko
files:
- include: '**/*.ts'
- include: '**/*.tsx'
- exclude: '**/*.test.ts'
- exclude: '**/*.spec.ts'

prompt: |
You are a senior React Native developer reviewing a pull request in a production-level project.

🛠️ Project Stack:
- React Native with Expo
- TypeScript
- OpenAPI-based API handling
- App router-based navigation (like Expo Router or similar)

Your goal is to:
1. Focus on **performance issues**, especially those that may cause unnecessary re-renders, inefficient rendering in lists, or redundant API calls.
2. Identify areas that are **likely to throw runtime errors**, especially "Cannot read property of undefined", null dereferencing, or optional chaining misuses.
3. Suggest better **modularization**, such as breaking down components or extracting hooks/utilities if any logic is too large or repeated.
4. Point out places where **better patterns or abstraction** could improve readability and maintainability (e.g., custom hooks, reusable UI components).
5. Suggest **alternative approaches** where applicable (e.g., using FlatList instead of ScrollView, memoizing with useMemo, useCallback, etc.)
6. Mention if any **types are too generic or unsafe** (e.g., use of any, improper inference).

Output your response in **clear sections**: Performance, Error Safety, Modularization, Suggestions.

If everything looks good, say LGTM ✅ under each section.
Always write in Korean.
4 changes: 2 additions & 2 deletions src/pages/PatientListPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ import { patientCardStyles, styles } from './styles';

const PatientListPage = () => {
const result = useGetPatientList();
const data = result?.data ?? [];
const data = result?.data;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

타입 안전성 문제가 발생할 수 있습니다.

result?.data에서 기본값 []을 제거했습니다. 그러나 이렇게 하면 dataundefinednull일 때 타입 안전성 문제가 발생할 수 있습니다. 22번 줄에서 data.length를 직접 접근하고 있기 때문에 런타임 오류가 발생할 가능성이 있습니다.

다음과 같이 변경하는 것을 제안합니다:

-  const data = result?.data;
+  const data = result?.data ?? [];
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const data = result?.data;
const data = result?.data ?? [];

const isLoading = result?.isLoading ?? false;

return (
<SafeAreaView style={styles.safeArea} edges={['left', 'right', 'top']}>
<Header containerStyle={styles.headerContainer} title="환자 관리" />
<View style={styles.container}>
{data?.length === 0 ? (
{data.length === 0 ? (
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

널 체크 없이 직접 속성에 접근하고 있습니다.

이전 코드에서는 아마도 data?.length === 0과 같이 널 체크를 사용했을 것입니다. 현재 코드에서는 dataundefined일 수 있는데 직접 .length 속성에 접근하고 있어 런타임 오류가 발생할 수 있습니다.

다음과 같이 변경하는 것을 제안합니다:

-        {data.length === 0 ? (
+        {data?.length === 0 ? (

또는 15번 줄에서 빈 배열 기본값을 제공하는 경우:

-        {data.length === 0 ? (
+        {data.length === 0 ? (
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{data.length === 0 ? (
- {data.length === 0 ? (
+ {data?.length === 0 ? (

<NoPatients />
) : (
<ScrollView style={patientCardStyles.scrollViewStyle}>
Expand Down