Skip to content

Conversation

@YousefAliUK
Copy link

Hey! 👋

I was going through the codebase and noticed a few things that could be improved, so I went ahead and fixed them.

What I found and fixed:

  • The db.ts file was empty but being imported elsewhere, which would cause issues
  • There was some unreachable code in repoAdder.ts - an if statement checking for a condition that could never be true based on the outer if
  • The retry logic in fetchExtensions.ts was incrementing the counter twice, which would skip retry attempts
  • A few places were using Number (the wrapper object) instead of number (the primitive type)
  • There were duplicate meta tags in app.html including conflicting theme-color values
  • Some async operations were missing await
  • A comment said the limit was 50 but the code was actually 5

Also cleaned up:

I noticed a lot of ../../../ imports which get hard to follow, so I set up path aliases ($components, $assets, $api) to make the imports cleaner and easier to read.

Also translated some French comments to English and fixed a couple of typos.

After these changes, the type checker went from 7 errors down to 1 - and that remaining one is expected since apiKeys.js needs to be created by users with their own tokens.

Let me know if you have any questions or want me to change anything!

Copilot AI review requested due to automatic review settings January 8, 2026 20:37
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 multiple code quality issues and modernizes the import structure using path aliases. The changes fix several bugs, improve type safety, remove duplicate HTML meta tags, and translate French comments to English.

Key changes:

  • Fixed unreachable code and retry logic bugs that could cause functional issues
  • Added missing await keywords for proper async operation handling
  • Replaced Number wrapper type with primitive number type throughout
  • Established path aliases ($components, $assets, $api) for cleaner imports
  • Created previously missing db.ts export file

Reviewed changes

Copilot reviewed 17 out of 18 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
svelte.config.js Adds path alias configuration for cleaner imports
src/routes/components/topics/TopicsContainer.svelte Updates imports to use path aliases and fixes file extensions
src/routes/components/topics/SelectedTopics.svelte Updates imports to use new $lib and $assets aliases
src/routes/components/stars/StarSelector.svelte Changes Number wrapper type to primitive number type
src/routes/components/repo/Repo.svelte Updates imports to use path aliases
src/routes/components/repo/NumberOfRepo.svelte Fixes types, comment spelling, and import paths
src/routes/components/bookmark/BookmarkedRepos.svelte Updates to use $components alias for cleaner imports
src/routes/api/get-topics/+server.ts Removes unused imports and updates to path aliases
src/routes/api/get-random-repo/+server.ts Updates import paths and fixes comment accuracy (5 vs 50)
src/routes/api/get-number-of-repo/+server.ts Removes unused imports and redundant JSDoc
src/routes/api/database/db.ts Creates previously missing file with sequelize export
src/routes/+page.svelte Updates all imports to use new path aliases and fixes types
src/lib/server/repoAdder.ts Fixes unreachable code bug, adds missing awaits, translates French comments
src/lib/server/index.ts Updates file extensions from .ts to .js for correct imports
src/lib/fetchExtensions.ts Fixes double-increment bug in retry logic
src/app.html Removes duplicate meta tags and unifies theme-color value
package-lock.json Updates lockfile format with peer dependency markers
README.md Corrects grammar ("give" → "gives")

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant