Merged
Conversation
Signed-off-by: BoxBoxJason <contact@boxboxjason.dev>
Signed-off-by: BoxBoxJason <contact@boxboxjason.dev>
Signed-off-by: BoxBoxJason <contact@boxboxjason.dev>
Signed-off-by: BoxBoxJason <contact@boxboxjason.dev>
There was a problem hiding this comment.
Pull request overview
This PR tightens TypeScript/ESLint rules and applies a broad set of type-safety and promise-handling changes across the VS Code extension (backend), webview (frontend), and tests, with the goal of reducing uncaught runtime exceptions and unsafe patterns.
Changes:
- Introduces a new flat ESLint config and adds/updates lint-related dependencies.
- Hardens types across webview messaging, controllers/models (including
unknownusage and generics for DB helpers), and various handlers. - Refactors multiple async call sites to reduce floating promises and improve error handling.
Reviewed changes
Copilot reviewed 38 out of 40 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| src/views/window.d.ts | Adds global window.vscode/window.imageUris typings for the webview. |
| src/views/requests/backend.ts | Hardens message handling/types for backend webview requests. |
| src/views/management.ts | Awaits backend message handling; minor refactors. |
| src/views/index.tsx | Types imageUris access more safely. |
| src/views/icons.ts | Changes PostMessage.data to unknown; minor refactors. |
| src/views/components/UserStats.tsx | Uses typed window.vscode and typed payload parsing; refactors state typing. |
| src/views/components/SearchBar.tsx | Tightens filter typing (Record<string, unknown>) and payload parsing. |
| src/views/components/AchievementsHolder.tsx | Tightens filter typing and payload parsing. |
| src/views/components/AchievementDisplay.tsx | Improves imageUris typing and date parsing flexibility. |
| src/utils/types.ts | Makes parseValue accept/return unknown, safer parsing for JSON/date/number. |
| src/utils/logger.ts | Switches logger varargs to unknown[]; removes console logging; minor formatting. |
| src/test/utils.ts | Refactors mock extension context typing/formatting. |
| src/test/runTest.ts | Cleans up test runner and uses void main() pattern. |
| src/test/listeners/files.test.ts | Minor const refactors in tests. |
| src/test/listeners/extensions.test.ts | Minor test refactors; avoids unused params. |
| src/test/extension.ui.test.ts | Avoids unused rest args; minor formatting. |
| src/test/database.test.ts | Adds generics to DB helper calls and asserts on nullable results. |
| src/test/connection-streak.test.ts | Minor const refactor. |
| src/listeners/git.ts | Improves typing around git extension/repo commit handler wiring. |
| src/listeners/files.ts | Refactors map declaration to const. |
| src/listeners/extensions.ts | Minor refactors; better typing for caught errors and unused params. |
| src/listeners/debug.ts | Minor refactors; avoids unused params; formatting. |
| src/listeners/awarder.ts | Adds explicit rejection handling for showInformationMessage().then(...). |
| src/extension.ts | Refactors read-only UI flow and some minor style/async handling. |
| src/database/model/tables/Progression.ts | Adds stronger typing for rows/params and generic DB helper usage. |
| src/database/model/tables/DailySession.ts | Strengthens DB helper typing and null-handling for aggregates. |
| src/database/model/tables/Achievement.ts | Strengthens typing for SQL params, criteria maps, and DB helper usage. |
| src/database/model/model.ts | Changes DB helper signatures to generic get<T>/getAll<T> with SqlValue[]. |
| src/database/model/migrations.ts | Minor default param formatting. |
| src/database/model/init/init.ts | Minor const refactor. |
| src/database/controller/timespent.ts | Minor formatting and simpler filtering logic. |
| src/database/controller/progressions.ts | Refactors loops/params; marks async calls with void. |
| src/database/controller/achievements.ts | Minor const refactors in filter parsing. |
| src/config/config.ts | Refactors async UI prompts; tightens updateConfig param type. |
| package.json | Bumps version to 0.4.1 and adds new ESLint-related devDependencies. |
| package-lock.json | Lockfile updates for new dependencies/version bump. |
| eslint.config.mjs | Adds flat ESLint config, Promise rules, and broader globals/ruleset. |
| CHANGELOG.md | Changelog regenerated/updated (but currently inconsistent with package version). |
Comments suppressed due to low confidence (1)
src/views/components/UserStats.tsx:30
useEffectis missing a dependency array, so it runs after every render, re-registering themessageevent listener and re-sending theRETRIEVE_PROFILErequest each time. This will cause duplicated listeners / repeated messages and can quickly spiral into performance issues. Add[](or the correct dependencies) so the listener is registered once and cleaned up correctly.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: BoxBoxJason <contact@boxboxjason.dev>
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.
This PR updates the eslint configuration to catch a lot more errors.
This fixes many uncaught exceptions and other promises errors, as well as poorly designed patterns, regular syntax errors, type hardening,...
This resolves some uncaught runtime exception erros (non blocking) that were happening