-
ESLint Configuration
- Backend: Airbnb style guide with customizations
- Frontend: React-app config with React-specific rules
- Both configured for auto-fixing
-
Auto-Fix Commands
npm run lint:fix # Fix both frontend and backend npm run lint:fix:backend # Fix backend only npm run lint:fix:frontend # Fix frontend only
-
Pre-commit Hook
- Automatically runs ESLint with auto-fix on staged files
- Prevents commits if unfixable issues exist
- Uses husky + lint-staged
-
IDE Integration
- VS Code settings included (
.vscode/settings.json) - Auto-fix on save enabled
- ESLint extension support
- VS Code settings included (
-
CI/CD Integration
- GitHub workflow updated to use unified lint commands
- Runs on every push and pull request
-
Install dependencies (if not already done):
npm install cd backend && npm install cd ../frontend && npm install
-
Fix lint issues:
npm run lint:fix
-
Check for remaining issues:
npm run lint
-
Commit your changes (pre-commit hook will run automatically):
git add . git commit -m "Your commit message"
- Minimal new packages: Only added husky and lint-staged
- Auto-fix capability: Most issues are fixed automatically
- Pre-commit safety: Prevents bad code from being committed
- IDE integration: Real-time feedback while coding
- Consistent style: Enforces project-wide code standards
- If pre-commit hook fails: Run
npm run lint:fixmanually - If ESLint errors persist: Check the specific error and fix manually
- For IDE issues: Ensure ESLint extension is installed and enabled