chore(BE)(lint): fix linter errors in server 1 - #248
Open
Muatasim-Aswad wants to merge 1 commit into
Open
Conversation
Muatasim-Aswad
requested review from
Aya-Alabrash,
sima-milli and
stasel
as code owners
July 31, 2025 06:45
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> {
Muatasim-Aswad
force-pushed
the
chore-be/fix-linter-errors
branch
from
July 31, 2025 07:10
8334b6a to
553af96
Compare
Muatasim-Aswad
force-pushed
the
chore-be/fix-linter-errors
branch
from
July 31, 2025 07:29
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
HackYourFutures
temporarily deployed
to
dojo-chore-be-fix-linte-4rertm
August 1, 2025 08:47
Inactive
sima-milli
approved these changes
Aug 15, 2025
Muatasim-Aswad
force-pushed
the
chore-be/fix-linter-errors
branch
from
August 15, 2025 14:01
128ad54 to
7603ee1
Compare
HackYourFutures
temporarily deployed
to
dojo-chore-be-fix-linte-rbhqk6
August 15, 2025 14:02
Inactive
Muatasim-Aswad
force-pushed
the
chore-be/fix-linter-errors
branch
from
August 15, 2025 14:14
7603ee1 to
d525dbf
Compare
HackYourFutures
temporarily deployed
to
dojo-chore-be-fix-linte-8wauxv
August 15, 2025 14:15
Inactive
Muatasim-Aswad
force-pushed
the
chore-be/fix-linter-errors
branch
from
August 15, 2025 14:49
d525dbf to
8d84927
Compare
HackYourFutures
temporarily deployed
to
dojo-chore-be-fix-linte-8wauxv
August 15, 2025 14:50
Inactive
Muatasim-Aswad
force-pushed
the
chore-be/fix-linter-errors
branch
from
August 16, 2025 08:49
8d84927 to
201101b
Compare
HackYourFutures
temporarily deployed
to
dojo-chore-be-fix-linte-8wauxv
August 16, 2025 08:50
Inactive
stasel
force-pushed
the
chore-be/fix-linter-errors
branch
from
February 2, 2026 22:17
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