chore(BE)(lint): fix linter errors in server 1#248
Open
Muatasim-Aswad wants to merge 1 commit intomainfrom
Open
chore(BE)(lint): fix linter errors in server 1#248Muatasim-Aswad wants to merge 1 commit intomainfrom
Muatasim-Aswad wants to merge 1 commit intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR addresses linter errors and warnings in the backend server by upgrading ESLint configuration, updating type annotations, improving error handling, and implementing TypeScript best practices.
Key changes include:
- Upgrade from legacy ESLint to modern ESLint 9 with TypeScript ESLint configuration
- Replace
anytypes with proper TypeScript types and add comprehensive type safety - Remove unnecessary try-catch blocks and improve async/await handling
Reviewed Changes
Copilot reviewed 29 out of 31 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| server/src/utils/database.ts | Adds proper typing for MongoDB utilities and transforms |
| server/src/services/*.ts | Improves type safety, error handling, and async operations |
| server/src/repositories/TraineesRepository.ts | Adds type safety with helper methods and proper error handling |
| server/src/controllers/*.ts | Removes unnecessary error handling and improves async patterns |
| server/src/models/*.ts | Updates utility functions with better TypeScript patterns |
| server/eslint.config.js | Upgrades to modern ESLint configuration |
| client/package.json & eslint.config.js | Updates client ESLint to modern configuration |
| .github/workflows/quality-checks.yml | Adds CI workflow for linting both server and client |
Files not reviewed (1)
- server/package-lock.json: Language not supported
Comments suppressed due to low confidence (2)
client/eslint.config.js:6
- The import
{ globalIgnores } from 'eslint/config'does not exist in ESLint. This should likely be removed asglobalIgnoresis being used as a function on line 9, but this import path is invalid.
import { globalIgnores } from 'eslint/config';
server/src/repositories/TraineesRepository.ts:92
- [nitpick] The parameter name
_idsuggests it's intentionally unused, but the original parameter nameidwas more descriptive. Since this is a stub method that throws 'Not implemented', consider keeping the original parameter nameidfor clarity.
deleteTrainee(_id: string): Promise<void> {
8334b6a to
553af96
Compare
553af96 to
0a6387c
Compare
Muatasim-Aswad
commented
Jul 31, 2025
| export default tseslint.config( | ||
| { | ||
| ignores: ['dist', 'node_modules', 'scripts', 'eslint.config.js'], | ||
| }, |
Contributor
Author
There was a problem hiding this comment.
if the scripts need to be linted too, ts config will change to include them in the project but exclude them from the build
sima-milli
approved these changes
Aug 15, 2025
128ad54 to
7603ee1
Compare
7603ee1 to
d525dbf
Compare
d525dbf to
8d84927
Compare
8d84927 to
201101b
Compare
201101b to
bf304d4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Due to the rejected promises being auto-handled by express in the current version, and due to some linter errors, instead of just satisfying the linter, the whole
try catchwrappers are removed where not necessary.The fixes related to validation will be part of a following PR.
To see the exact errors and warnings that are solved here please refer to: previous linter result