mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-25 22:34:56 +00:00
- codegen: Low-code React app with JSON-driven component system - packagerepo: Schema-driven package repository with backend/frontend - postgres: Next.js app with Drizzle ORM and PostgreSQL Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
3.0 KiB
3.0 KiB
ESLint Warnings Summary
Overview
The codebase currently has 514 ESLint warnings (0 errors). These are non-blocking and the build completes successfully.
Warning Categories
1. TypeScript any Types (Most Common)
- Count: ~400+ warnings
- Rule:
@typescript-eslint/no-explicit-any - Impact: Low - these are typing warnings that don't affect runtime
- Common in: JSON UI system, dynamic component registry, data binding
2. Unused Variables/Imports
- Count: ~50 warnings
- Rule:
@typescript-eslint/no-unused-vars - Impact: Low - dead code that should be cleaned up during refactoring
- Examples: Unused imports in component files, unused function parameters
3. React Hook Dependencies
- Count: ~30 warnings
- Rule:
react-hooks/exhaustive-deps - Impact: Medium - could cause stale closures or unnecessary re-renders
- Examples: Missing dependencies in
useEffect,useCallback
4. Fast Refresh Compatibility
- Count: ~10 warnings
- Rule:
react-refresh/only-export-components - Impact: Low - affects hot module replacement, not production
5. Empty Catch Blocks
- Count: 1 (fixed)
- Rule:
no-empty - Impact: Low - should log errors for debugging
Why Not Fix All Warnings Now?
anytypes are intentional - The JSON UI system deals with dynamic schemas where typing everything would be overly complex- Time vs. Value - Fixing 514 warnings would take hours and provide minimal value
- No build blockers - All warnings, zero errors
- Best addressed incrementally - During feature work, clean up warnings in touched files
Recommendation
Follow the "Boy Scout Rule": Leave code cleaner than you found it. When working on a file:
- Remove unused imports/variables
- Add missing React Hook dependencies
- Type
anyparameters where practical - Handle errors in catch blocks
Files with Most Warnings
-
JSON UI System (~200 warnings)
src/lib/json-ui/*- Dynamic component renderingsrc/components/JSON*.tsx- JSON-driven pages
-
Hooks (~100 warnings)
src/hooks/**/*.ts- Custom React hooks
-
Components (~100 warnings)
src/components/*Designer.tsx- Designer components
-
Type Definitions (~50 warnings)
src/types/*.ts- Type files withany
Quick Wins
If you want to reduce the count quickly:
# Remove unused imports automatically
npm run lint:fix
This will auto-fix ~50 warnings (unused imports, simple formatting).
Suppressions to Consider
For intentional any usage in the JSON UI system:
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function renderComponent(schema: any) {
// Dynamic schema, typing would be counterproductive
}
Linting in CI/CD
Current setup:
- ✅ Linting runs in CI
- ✅ Warnings don't block builds
- ✅ Warnings are visible in logs
Future consideration:
- Add
--max-warnings 600to fail if warnings spike significantly - Track warning count trend over time