diff --git a/.living_spec/CODE_QUALITY_CHECKLIST.md b/.living_spec/CODE_QUALITY_CHECKLIST.md new file mode 100644 index 0000000..0961480 --- /dev/null +++ b/.living_spec/CODE_QUALITY_CHECKLIST.md @@ -0,0 +1,227 @@ +# Code Quality Checklist + +This document provides a quick reference for code quality checks that MUST be performed before completing any story. + +## Pre-Completion Checklist + +Before asking for user acceptance in Step 4 (Verification), ALL of the following must pass: + +### Rust Backend + +```bash +# 1. Run Clippy (linter) +cd src-tauri +cargo clippy --all-targets --all-features +# Expected: 0 errors, 0 warnings + +# 2. Run cargo check (compilation) +cargo check +# Expected: successful compilation + +# 3. Run tests +cargo test +# Expected: all tests pass +``` + +**Result Required:** ✅ 0 errors, 0 warnings, all tests pass + +### TypeScript Frontend + +```bash +# 1. Run TypeScript compiler check (type errors) +npx tsc --noEmit +# Expected: 0 errors + +# 2. Run Biome check (linter + formatter) +npx @biomejs/biome check src/ +# Expected: 0 errors, 0 warnings + +# 3. Apply fixes if needed +npx @biomejs/biome check --write src/ +npx @biomejs/biome check --write --unsafe src/ # for unsafe fixes + +# 4. Build +npm run build +# Expected: successful build +``` + +**Result Required:** ✅ 0 errors, 0 warnings, successful build + +## Common Biome Issues and Fixes + +### 1. `noExplicitAny` - No `any` types + +**Bad:** +```typescript +const handler = (data: any) => { ... } +``` + +**Good:** +```typescript +const handler = (data: { className?: string; children?: React.ReactNode; [key: string]: unknown }) => { ... } +``` + +### 2. `noArrayIndexKey` - Don't use array index as key + +**Bad:** +```typescript +{items.map((item, idx) =>
- {msg.content}
-
-
- {children}
-
- );
- },
- }}
- >
- {msg.content}
-
+ {msg.content}
+
+
+ {children}
+
+ );
+ },
+ }}
+ >
+ {msg.content}
+
+ {children}
+
+ );
+ },
+ }}
+ >
+ {streamingContent}
+