Skip to content
This repository was archived by the owner on Apr 8, 2026. It is now read-only.

Commit 3319cc0

Browse files
committed
refactor: remove unnecessary comments and improve code readability across multiple files
fix: ignore unused variable warnings in ESLint configuration chore: add new line at the end of several EJS template files refactor: simplify error handling functions in various controllers refactor: remove redundant comments in repository and service files style: standardize formatting in interfaces and repositories
1 parent afea127 commit 3319cc0

33 files changed

Lines changed: 31 additions & 138 deletions

eslint.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export default defineConfig([
1616
{
1717
rules: {
1818
"@typescript-eslint/no-explicit-any": "ignore",
19+
"@typescript-eslint/no-unused-vars": "ignore",
1920
},
2021
},
2122
tseslint.configs.recommended,

mailTemplates/accountConfirmation.ejs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,4 @@
3636
</table>
3737
</body>
3838
</html>
39+

mailTemplates/connectionNotification.ejs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,4 @@
3636
</table>
3737
</body>
3838
</html>
39+

mailTemplates/passwordReset.ejs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,4 @@
4444
</table>
4545
</body>
4646
</html>
47+

src/app.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ server.setConfig(app => {
3636
app.use(express.static(path.join(__dirname, 'public')));
3737
});
3838

39-
// 404 handler
4039
server.setErrorConfig(app => {
4140
app.use((req, res) => {
4241
res.status(404).json({ message: 'Not Found' });

src/controllers/AuthenticatorController.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { IUserService } from '../services/UserService';
99
import { genKey } from '../utils/GenKey';
1010
import { generateUserJwt } from '../utils/Jwt';
1111

12-
// --- UTILS ---
1312
function handleError(res: Response, error: unknown, message: string, status = 500) {
1413
const msg = error instanceof Error ? error.message : String(error);
1514
res.status(status).send({ message, error: msg });

src/controllers/BuyOrderController.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { IBuyOrderService } from '../services/BuyOrderService';
66
import { IItemService } from '../services/ItemService';
77
import { ILogService } from '../services/LogService';
88

9-
// --- UTILS ---
109
function handleError(res: Response, error: unknown, message: string, status = 500) {
1110
const msg = error instanceof Error ? error.message : String(error);
1211
res.status(status).send({ message, error: msg });

src/controllers/GameController.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import { IUserService } from '../services/UserService';
1313
import { createGameBodySchema, gameIdParamSchema, updateGameBodySchema } from '../validators/GameValidator';
1414
const streamPipeline = promisify(pipeline);
1515

16-
// --- UTILS ---
1716
function handleError(res: Response, error: unknown, message: string, status = 500) {
1817
const msg = error instanceof Error ? error.message : String(error);
1918
res.status(status).send({ message, error: msg });
@@ -57,7 +56,6 @@ export class Games {
5756
}
5857
}
5958

60-
// --- LISTING & SEARCH ---
6159
@httpGet('/')
6260
public async listGames(req: Request, res: Response) {
6361
try {
@@ -159,7 +157,6 @@ export class Games {
159157
}
160158
}
161159

162-
// --- CREATION & MODIFICATION ---
163160
@httpPost('/', LoggedCheck.middleware)
164161
public async createGame(req: AuthenticatedRequest, res: Response) {
165162
if (!(await validateOr400(createGameBodySchema, req.body, res))) {
@@ -209,7 +206,6 @@ export class Games {
209206
}
210207
}
211208

212-
// --- ACHAT ---
213209
@httpPost(':gameId/buy', LoggedCheck.middleware)
214210
public async buyGame(req: AuthenticatedRequest, res: Response) {
215211
const { gameId } = req.params;
@@ -255,7 +251,6 @@ export class Games {
255251
}
256252
}
257253

258-
// --- PROPRIÉTÉ ---
259254
@httpPost('/transfer-ownership/:gameId', LoggedCheck.middleware)
260255
public async transferOwnership(req: AuthenticatedRequest, res: Response) {
261256
const { gameId } = req.params;
@@ -359,7 +354,6 @@ export class Games {
359354
if (!link) return res.status(404).send({ message: 'No download link available' });
360355
const githubMatch = link.match(/^https:\/\/github.com\/([^/]+)\/([^/]+)(?:\.git)?$/i);
361356
if (githubMatch) {
362-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
363357
const [_, owner, repo] = githubMatch;
364358
const zipUrl = `https://github.com/${owner}/${repo}/archive/refs/heads/main.zip`;
365359
return res.redirect(zipUrl);
@@ -373,7 +367,6 @@ export class Games {
373367
if (fileRes.body) {
374368
try {
375369
await streamPipeline(fileRes.body, res);
376-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
377370
} catch (err) {
378371
res.status(500).send({ message: 'Error streaming the file.' });
379372
}

src/controllers/GameGiftController.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { IGameService } from '../services/GameService';
77
import { ILogService } from '../services/LogService';
88
import { IUserService } from '../services/UserService';
99

10-
// --- UTILS ---
1110
function handleError(res: Response, error: unknown, message: string, status = 500) {
1211
const msg = error instanceof Error ? error.message : String(error);
1312
res.status(status).send({ message, error: msg });
@@ -22,7 +21,6 @@ export class GameGifts {
2221
@inject('LogService') private logService: ILogService
2322
) {}
2423

25-
// Helper pour créer des logs (signature uniforme)
2624
private async createLog(req: AuthenticatedRequest, action: string, tableName?: string, statusCode?: number, userId?: string) {
2725
try {
2826
await this.logService.createLog({

src/controllers/GameViewController.ts

Whitespace-only changes.

0 commit comments

Comments
 (0)