Skip to content

Conversation

@Muatasim-Aswad
Copy link
Contributor

@Muatasim-Aswad Muatasim-Aswad commented Jul 31, 2025

  • 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 catch wrappers 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

@Copilot Copilot AI review requested due to automatic review settings July 31, 2025 06:45
@Muatasim-Aswad Muatasim-Aswad added the BE Backend ticket label Jul 31, 2025
@HackYourFutures HackYourFutures temporarily deployed to dojo-chore-be-fix-linte-9adqsg July 31, 2025 06:45 Inactive
@Muatasim-Aswad Muatasim-Aswad changed the title chore(BE)(lint): fix linter errors and warnings in server 1 chore(BE)(lint): fix linter errors 1 Jul 31, 2025
Copy link

Copilot AI left a 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 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 any types 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 as globalIgnores is 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 _id suggests it's intentionally unused, but the original parameter name id was more descriptive. Since this is a stub method that throws 'Not implemented', consider keeping the original parameter name id for clarity.
  deleteTrainee(_id: string): Promise<void> {

@Muatasim-Aswad Muatasim-Aswad force-pushed the chore-be/fix-linter-errors branch from 8334b6a to 553af96 Compare July 31, 2025 07:10
@HackYourFutures HackYourFutures temporarily deployed to dojo-chore-be-fix-linte-jardmw July 31, 2025 07:10 Inactive
@Muatasim-Aswad Muatasim-Aswad changed the title chore(BE)(lint): fix linter errors 1 chore(BE)(lint): fix linter errors server 1 Jul 31, 2025
@Muatasim-Aswad Muatasim-Aswad force-pushed the chore-be/fix-linter-errors branch from 553af96 to 0a6387c Compare July 31, 2025 07:29
@HackYourFutures HackYourFutures temporarily deployed to dojo-chore-be-fix-linte-qeade0 July 31, 2025 07:29 Inactive
export default tseslint.config(
{
ignores: ['dist', 'node_modules', 'scripts', 'eslint.config.js'],
},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the scripts need to be linted too, ts config will change to include them in the project but exclude them from the build

@Muatasim-Aswad Muatasim-Aswad changed the title chore(BE)(lint): fix linter errors server 1 chore(BE)(lint): fix linter errors in server 1 Jul 31, 2025
@HackYourFutures HackYourFutures temporarily deployed to dojo-chore-be-fix-linte-4rertm August 1, 2025 08:47 Inactive
@Muatasim-Aswad Muatasim-Aswad force-pushed the chore-be/fix-linter-errors branch from 128ad54 to 7603ee1 Compare August 15, 2025 14:01
@HackYourFutures HackYourFutures temporarily deployed to dojo-chore-be-fix-linte-rbhqk6 August 15, 2025 14:02 Inactive
@Muatasim-Aswad Muatasim-Aswad force-pushed the chore-be/fix-linter-errors branch from 7603ee1 to d525dbf Compare August 15, 2025 14:14
@HackYourFutures HackYourFutures temporarily deployed to dojo-chore-be-fix-linte-8wauxv August 15, 2025 14:15 Inactive
@Muatasim-Aswad Muatasim-Aswad force-pushed the chore-be/fix-linter-errors branch from d525dbf to 8d84927 Compare August 15, 2025 14:49
@HackYourFutures HackYourFutures temporarily deployed to dojo-chore-be-fix-linte-8wauxv August 15, 2025 14:50 Inactive
@Muatasim-Aswad Muatasim-Aswad force-pushed the chore-be/fix-linter-errors branch from 8d84927 to 201101b Compare August 16, 2025 08:49
@HackYourFutures HackYourFutures temporarily deployed to dojo-chore-be-fix-linte-8wauxv August 16, 2025 08:50 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BE Backend ticket

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants