Chore/quality baseline#2
Open
jiaiqi wants to merge 4 commits into
Open
Conversation
added 4 commits
June 28, 2026 13:49
- Add ESLint 9 flat config (eslint.config.mjs) for TS + React hooks
- Existing-debt rules (any/unused-vars/react-compiler heuristics) set to
warn so current code passes; zero-violation safety rules stay error
- no-undef disabled for TS (TypeScript already covers it)
- Add lint / lint:fix scripts and eslint devDependencies
- Add .github/workflows/ci.yml running typecheck + lint on PR and main push
- Apply safe autofixes (let->const, as const); restore stale eslint-disable
directives with current rule name (no-require-imports)
Baseline: 0 errors, ~1540 warnings (tracked debt). typecheck + lint pass.
- Add Vitest 4 with dedicated vitest.config.ts (node env, tests/ dir)
- Add test / test:watch scripts; wire 'npm test' into CI workflow
- 55 tests covering pure, deterministic logic:
- exportDateRange: preset ranges, leap-day boundary, date parsing
validation, legacy config migration (7d/30d/90d), serialize round-trip
- LRUCache: LRU eviction order, recency on get, update semantics
- pathUtils: expandHomePath (~, ~/, ~\, edge cases)
All green: typecheck + lint + test.
Previously the app had no general-purpose logger: ~500 console.* calls
went to stdout/stderr (invisible in packaged builds) and the log:debug
IPC channel was exposed in preload but had no main-process handler.
- Add electron-log with a logger service (electron/services/logger.ts):
- rotating file log at {userData}/logs/main.log (5MB cap)
- redirect main-process console.* to the log file (zero call-site edits)
- catch uncaughtException / unhandledRejection (no dialog)
- log app lifecycle and process-crash events
- Initialize logger early in main.ts; implement the missing log:debug
handler so renderer errors are persisted
- Forward renderer window.onerror / unhandledrejection from main.tsx
- Externalize electron-log in the main-process vite build
Privacy: logs stay entirely on the user's machine; no network upload
(consistent with the app's no-data-leaves-device policy). Verified with
typecheck + lint + test + vite build.
Move version/track logic out of main.ts into electron/utils/updateTrack.ts (pure, no electron deps) and add 23 unit tests: - inferUpdateTrackFromVersion: stable/preview/dev detection from version - normalizeUpdateTrack, getUpdaterFeedUrlByTrack - compareVersions / isVersionNewer: semver core + prerelease ordering main.ts now imports these; behavior preserved (isRemoteVersionNewer keeps its autoUpdater fast-path and uses isVersionNewer only as fallback). Verified: typecheck + lint + test (78) + vite build all green.
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.
No description provided.