Fix various code issues and clean up imports#2
Open
YousefAliUK wants to merge 2 commits intozonetecde:mainfrom
Open
Fix various code issues and clean up imports#2YousefAliUK wants to merge 2 commits intozonetecde:mainfrom
YousefAliUK wants to merge 2 commits intozonetecde:mainfrom
Conversation
There was a problem hiding this comment.
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
awaitkeywords for proper async operation handling - Replaced
Numberwrapper type with primitivenumbertype 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.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
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:
Number(the wrapper object) instead ofnumber(the primitive type)awaitAlso 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.jsneeds to be created by users with their own tokens.Let me know if you have any questions or want me to change anything!