mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-15 21:19:40 +02:00
Move inactive projects out of active workspace: - bauntown (community website) - maerchenzauber (AI story generation) - memoro (voice memo app) - news (news aggregation) - nutriphi (nutrition tracking) - reader (reading app) - uload (URL shortener) - wisekeep (AI wisdom extraction) Update CLAUDE.md documentation: - Add presi to active projects - Document archived projects section - Update workspace configuration Archived apps can be re-activated by moving back to apps/ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
3.3 KiB
3.3 KiB
ESLint Setup for Unused Code Detection
✅ Successfully Configured
ESLint has been added to your project with specialized rules for detecting and auto-fixing unused imports and variables.
📦 Installed Packages
"devDependencies": {
"eslint": "latest",
"@typescript-eslint/parser": "latest",
"@typescript-eslint/eslint-plugin": "latest",
"eslint-plugin-unused-imports": "latest",
"eslint-plugin-react": "latest",
"eslint-plugin-react-hooks": "latest",
"eslint-config-expo": "latest"
}
🎯 Key Features
1. Automatic Unused Import Removal
- Detects and removes unused imports automatically with
--fixflag - Already cleaned up imports in 50+ files on first run
2. Unused Variable Detection
- Warns about unused variables and function parameters
- Ignores variables/parameters prefixed with underscore (e.g.,
_unused) - Respects destructuring patterns and rest operators
3. React-Specific Rules
- Ensures React hooks are called correctly
- Validates JSX variable usage
- Checks for exhaustive dependencies in hooks
📝 Available NPM Scripts
# Check for linting issues
npm run lint
# Auto-fix all fixable issues (including unused imports)
npm run lint:fix
# Specifically check for unused code
npm run lint:unused
# Format and fix everything
npm run format
🔧 Configuration
The ESLint configuration (eslint.config.js) includes:
- TypeScript support with proper type checking
- React/React Native optimizations
- Unused imports auto-removal
- Unused variables detection with smart patterns
- Proper ignores for build directories and generated files
📊 Initial Cleanup Results
On the first run, ESLint automatically:
- ✅ Removed unused imports from 50+ files
- ✅ Fixed import duplications in several files
- ✅ Cleaned up commented-out imports
- ✅ Identified variables that can be removed
Files with Most Cleanup:
app/(protected)/(memo)/[id].tsx- 32 lines simplifiedapp/(protected)/(tabs)/index.tsx- 15 lines cleanedapp/(protected)/(tabs)/memos.tsx- 15 lines cleaned
🚀 Usage Examples
Check specific file for unused code:
npx eslint app/_layout.tsx
Auto-fix a specific directory:
npx eslint features/ --fix
Check entire project (quiet mode, only errors):
npx eslint . --quiet
⚠️ Common Warnings to Expect
_unusedparameters: Intentionally unused (follows convention)- Hook dependencies: May need manual review
- Console statements: Warnings for non-error/warn/debug console use
- Type imports: Some type-only imports are necessary for TypeScript
🎯 Best Practices
- Run before commits:
npm run lint:fixbefore committing - Regular cleanup: Run monthly to prevent accumulation
- CI Integration: Consider adding to CI/CD pipeline
- Pre-commit hook: Can be added with husky for automatic checking
📈 Impact
- Reduced bundle size: Removing unused imports helps tree-shaking
- Cleaner codebase: Less cognitive overhead from unused code
- Better maintainability: Easier to understand actual dependencies
- Faster builds: Less code to process and compile
Note: The configuration is conservative by default. Adjust rules in eslint.config.js as needed for your team's preferences.