Fix appVersion IPC, ICS/vCard spec nits, and add ESLint to CI - #450
Merged
Conversation
- appVersion now comes from app.getVersion() via IPC (sendSync) instead of process.env.npm_package_version, which is empty in packaged builds (#432) - Fold ICS/vCard content lines at 75 octets per RFC 5545/6350, sanitize the vCard EMAIL TYPE parameter, and decode astral HTML entities with String.fromCodePoint instead of String.fromCharCode (#440) - Add flat ESLint config (typescript-eslint + react-hooks) and wire it into CI and preversion; fix the lint findings it turned up, including a real conditional hook call in ProjectTab (#443) Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.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.
Summary
Batches three pre-1.0 audit fixes:
window.sourcerer.appVersionrelied onprocess.env.npm_package_version, which is only set when launched via an npm script, so it's empty in packaged builds (broken version link + 404 on GitHub in Settings). Now exposed from the main process viaapp.getVersion()over a synchronous IPC call (app:get-version), matching the pattern the About panel already uses. Not verified against an actual packaged build — that check is called out as needing a human pass.generateIcal/buildVCardnow fold content lines at 75 octets per RFC 5545 / RFC 6350, with continuation lines prefixed by a single space and folds guaranteed not to split multi-byte UTF-8 sequences (new sharedfoldLinehelper insrc/main/utils.ts, covered bysrc/test/fold-line.test.ts).buildVCard'sEMAIL;TYPE=...parameter is now sanitized to alphanumerics (falling back toINTERNET) instead of interpolating the raw, user-editable email label.cleanHeadlinenow decodes numeric/hex HTML entities withString.fromCodePointinstead ofString.fromCharCode, so astral codepoints (e.g. emoji in RSS/Google Alerts headlines) decode correctly instead of producing garbage surrogate halves.typescript-eslintrecommended +eslint-plugin-react-hooks'srules-of-hooks/exhaustive-deps, split Node vs browser globals forsrc/main+src/preload+src/testvssrc/renderer), alintscript, and wired it intoci.ymlandpreversion. Scripts/build config outside the TS project (scripts/,build/,electron-builder.config.js) are excluded, matching what's already typechecked.Turning the linter on surfaced a real bug: in
ProjectTab.tsx,useListboxKeyboardwas called after an earlyif (!membership) return null;, so the hook was skipped whenever a contact had no project memberships — a genuine conditional-hook violation. Moved the hook (and the option-filtering it depends on) above the early return. Also fixed a handful of mechanical findings (an unusedlet, a dead assignment, an unnecessary regex escape, unused type imports, a stale/unused test mock) and left the remainingexhaustive-depsfindings as warnings, since they don't block CI and each would need individual judgement calls about effect timing.Test plan
npm run typecheckpassesnpm run lintpasses (0 errors, 7 pre-existingexhaustive-depswarnings, non-blocking)npm test— 490/490 passing, including newfoldLinecoverageappVersionrenders correctly in an installed/packaged build (not verifiable from source)Closes #432
Closes #440
Closes #443
🤖 Generated with Claude Code