Quality Gate
Run these commands before committing:Linting
Run ESLint
- Code style violations
- Unused imports
- Common programming errors
- React/React Native best practices
Configuration
ESLint is configured with:eslint-config-expo- Expo’s recommended configeslint-config-prettier- Disables rules that conflict with Prettiereslint-plugin-prettier- Runs Prettier as an ESLint ruleeslint-plugin-unused-imports- Detects and removes unused imports
Type Checking
Run TypeScript Compiler
tsc --noEmit to check TypeScript types without generating output files.
Common Type Errors
Missing imports from coco-cashu-core
Missing imports from coco-cashu-core
Always import types from
coco-cashu-core, never redefine them.Importing from @cashu/cashu-ts
Importing from @cashu/cashu-ts
Import from coco, not the underlying
@cashu/cashu-ts library.Store type errors
Store type errors
Check
.cursor/rules/zustand-store-scoping.mdc for store type patterns and scoping rules.Code Formatting
Check Formatting
Auto-Fix Formatting
- JavaScript/TypeScript files (
.js,.jsx,.ts,.tsx) - JSON files
- Module formats (
.mjs,.cjs)
Configuration
Prettier is configured with:prettier-plugin-tailwindcss- Automatically sorts Tailwind classes
Dead Code Detection
Run Knip
- Unused exports
- Unused dependencies in
package.json - Unreferenced files
- Duplicate exports
What to do with Knip results
1
Review the output
Knip will list unused exports, files, and dependencies.
2
Verify before deleting
Some exports may be used by external tools or in ways Knip can’t detect. Verify before removing.
3
Remove dead code
Delete genuinely unused code. Keep the codebase lean.
Testing
Run Tests
Test Configuration
Tests use:jest- Testing frameworkjest-expo- Expo-specific Jest preset@types/jest- TypeScript definitions for Jest
Writing Tests
Styling Standards
Use Semantic Tokens
Runtime Color Values
UseuseThemeColor for dynamic color access:
Prefer className Over style
Performance Best Practices
List Performance
Avoid Unnecessary Memoization
Loading States
Use HeroUI Components
Skeleton Best Practices
Comments and JSDoc
When to add JSDoc
Add JSDoc only for:- Intent (why this exists)
- Constraints (limits, edge cases)
- UX rules (user-facing behavior)
- Async contracts (timing, dependencies)
- Invariants (must-hold conditions)
Quick Reference
All five must pass before committing:
lint, type-check, pretty:check, knip, test.