Production/scripts/code_quality/check_function_duplicate.ts
Ce check repère les noms dupliqués de déclarations TypeScript:
Objectif:
Le script:
Commande standard (depuis le dossier AM):
npm run check:function-duplicate
[check:function-duplicate] Starting duplicate declaration scan
Project root: /mnt/data/vmenon/Other_Work/efrei-dev/AM
Search scope: packages, apps
TypeScript files to scan: 0
[OK] No duplicate declaration names found in 0.01s.
En cas d'échec, la sortie liste chaque doublon trouvé, avec toutes ses occurrences.
[FAIL] Found 2 duplicate declaration name(s):
[function] getUserByDiscordId (2 occurrences)
apps/api/src/repositories/users.ts:27
packages/api-client/user.ts:10
Troubleshooting:
- Keep one declaration and remove/rename duplicates.
- Common fix: move shared declarations to packages/shared.
- Re-run: npm run check:function-duplicate
Summary: 2 duplicate declaration(s) found in 0.42s.