All static analysis tools configured in this app and how to use them.
| Tool | Purpose | Command | In check:all |
|---|---|---|---|
| TypeScript | Type checking | npm run typecheck |
Yes |
| ESLint | Syntax, style, TS rules | npm run lint |
Yes |
| Prettier | Code formatting | npm run format:check |
Yes |
| ast-grep | Architecture patterns | npm run ast:lint |
Yes |
| React Compiler | Automatic memoization | Build-time | Yes |
| cargo fmt | Rust formatting | npm run rust:fmt:check |
Yes |
| clippy | Rust linting | npm run rust:clippy |
Yes |
| Vitest | Frontend tests | npm run test:run |
Yes |
| cargo test | Rust tests | npm run rust:test |
Yes |
| knip | Unused code detection | npm run knip |
No |
| jscpd | Duplicate code detection | npm run jscpd |
No |
npm run check:all # Must pass before commits
npm run fix:all # Auto-fix what can be fixedHandles syntax, style, and TypeScript-specific rules.
npm run lint # Check for issues
npm run lint:fix # Auto-fix issuesConfiguration in eslint.config.js.
Consistent code formatting.
npm run format:check # Check formatting
npm run format # Fix formattingConfiguration in prettier.config.js.
Enforces architectural patterns ESLint can't detect. Catches violations like Zustand destructuring and hooks in wrong directories.
npm run ast:lint # Scan for violations
npm run ast:fix # Auto-fix where possibleKey rules:
- No Zustand destructuring (causes render cascades)
- Hooks must be in
hooks/directory - No store subscriptions in
lib/
See writing-ast-grep-rules.md for creating new rules.
Handles memoization automatically at build time. You do not need to manually add:
useMemofor computed valuesuseCallbackfor function referencesReact.memofor components
The compiler analyzes code and adds memoization where beneficial.
Note: The getState() pattern is still critical - it avoids store subscriptions, not memoization. See state-management.md.
npm run rust:fmt:check # Check formatting
npm run rust:fmt # Fix formatting
npm run rust:clippy # Lint with clippy
npm run rust:clippy:fix # Auto-fix clippy warnings
npm run rust:test # Run Rust testsDetects unused exports, dependencies, and files. Not in check:all - use periodically.
npm run knipDetects duplicated code blocks. Not in check:all - use periodically.
npm run jscpdUse the /cleanup command for guided analysis and cleanup of both knip and jscpd findings.
check:all runs in CI. Ensure it passes locally before pushing:
npm run check:allESLint: Add rules to eslint.config.js
ast-grep: Create YAML files in .ast-grep/rules/. See writing-ast-grep-rules.md.
Prettier: Modify prettier.config.js