-
-
Notifications
You must be signed in to change notification settings - Fork 68
fix: comprehensive ESLint cleanup and enable linting in builds #847
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Configuration Changes: - Updated .eslintrc.json with practical rule configuration - Converted errors to warnings for stylistic rules - Added overrides for test files and scripts - Excluded scripts/, prisma/, next.config.js from linting - Removed ignoreDuringBuilds flag from next.config.js Rules Adjusted: - Relaxed: naming-convention, no-restricted-syntax, no-nested-ternary - To warnings: button-has-type, no-array-index-key, function-component-definition - Disabled: no-plusplus, no-restricted-exports, destructuring-assignment - Test files: allowed console.log, global-require, no-var-requires Critical Bug Fixes: - Fixed 8 parseInt() calls missing radix parameter (potential bugs) - Fixed 3 == comparisons to use === (type safety) - Fixed React Hooks violation (useMemo called conditionally) - Removed unused imports (Fragment, useMemo) Results: - Reduced from 383 problems to 0 errors, 562 warnings - Build now passes with ESLint enabled - Auto-fixed 35+ issues with --fix - All critical bugs and security issues resolved Phase 1 Task Complete: ESLint cleanup for production readiness
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR performs a comprehensive ESLint cleanup to enable linting during builds. The changes include updating ESLint configuration with practical rule adjustments, fixing critical bugs (parseInt radix, type coercion), and auto-fixing code style issues across the codebase.
Key changes:
- Fixed 8 parseInt() calls by adding the required radix parameter (10) to prevent octal parsing bugs
- Replaced loose equality (==) with strict equality (===) in 3 locations for type safety
- Removed unused imports and simplified code with object property shorthand
Reviewed changes
Copilot reviewed 26 out of 28 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| .eslintrc.json | Added practical rule overrides, relaxed stylistic rules to warnings, added test file exceptions |
| .eslintignore | Excluded scripts/, prisma/, and next.config.js from linting |
| src/pages/courses/web-development/[moduleId]/[lessonId].tsx | Changed string concatenation to template literal |
| src/pages/certificates/[certificateId].tsx | Converted self-closing div tags to proper JSX syntax |
| src/pages/api/upload/signature.ts | Reordered imports |
| src/pages/api/upload/image.ts | Reordered imports |
| src/pages/api/og/fetch.ts | Applied object property shorthand |
| src/pages/api/military-resume/translate.ts | Applied object property shorthand |
| src/pages/api/lms/submissions/pending.ts | Fixed parseInt() calls by adding radix parameter |
| src/pages/api/enrollment/index.ts | Applied destructuring assignment |
| src/pages/api/courses/index.ts | Fixed parseInt() calls by adding radix parameter |
| src/pages/api/cloudinary/search.ts | Reordered imports |
| src/pages/api/cloudinary/resource/[publicId].ts | Reordered imports |
| src/pages/api/cloudinary/list.ts | Reordered imports |
| src/pages/api/cloudinary/folders.ts | Reordered imports |
| src/lib/shopify.ts | Added await keyword to json() call |
| src/lib/project.ts | Applied object property shorthand |
| src/lib/military-translator.ts | Applied object property shorthand |
| src/lib/github.ts | Fixed == comparisons to ===, removed else-after-return, added await keyword |
| src/lib/cloudinary-helpers.ts | Changed let to const for immutable variable |
| src/components/url-preview-card/index.tsx | Removed unused useMemo import and hook, applied destructuring |
| src/components/shopping-cart/shopping-cart.tsx | Replaced Fragment with shorthand syntax |
| src/components/cloudinary-upload-example.tsx | Applied destructuring assignment |
| src/components/cloudinary-media-library.tsx | Removed else-after-return |
| src/components/blog-image-manager.tsx | Fixed parseInt() call by adding radix parameter |
| tests/pages/projects.tests.tsx | Consolidated imports, reordered imports |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
🔍 Code Quality Score Breakdown:
💡 Recommendations:
|
Configuration Changes:
Rules Adjusted:
Critical Bug Fixes:
Results:
Phase 1 Task Complete: ESLint cleanup for production readiness