refactor: readability pass — naming, comments, simplicity#45
Merged
Conversation
Rename vague variables to describe what values actually hold: - rebuildFromVault: files/items → markdownFiles/noteContents, rel/full → relativePath/absolutePath, item → note - fullTextSearch: rel → relatedNote - file-watcher: relPath/rel → relativePath, seg → segment - memory-store: last → lastMatchIndex - consent-page: esc/s → escapeHtml/text/scope - vault-patcher: bind fenceMatch[1] to fenceChars (2 functions) - listPropertyKeys: je → property SQL alias Add coerceToArray helper for repeated nested ternary in upsertNote. Rename data → frontmatter in upsertNote for top-to-bottom clarity. Add clarifying comments on dynamic WHERE builder, transaction API, and YAML date parsing. Log errors in fullTextSearch instead of swallowing silently. Replace .map(() => str) with Array.fill in findOrphans for clearer intent. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace acc.push() mutation with [...acc, item] spread. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <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
rebuildFromVault:files/items→markdownFiles/noteContents,rel/full→relativePath/absolutePath,item→note,seg→segmentupsertNote:data→frontmatter, extractcoerceToArrayhelper for repeated nested ternaryfullTextSearch:rel→relatedNote, log errors instead of silentcatch { return [] }findOrphans:Array.fill()over.map(() => str)for clearer intentlistPropertyKeys:je→propertySQL aliasvault-patcher: bindfenceMatch[1]tofenceCharsin both functions (consistency withextractLinks)consent-page:esc/s→escapeHtml/text/scopememory-store:last→lastMatchIndexfile-watcher:relPath/rel→relativePath,seg→segmentTest plan
npx tsc --noEmit— clean compilenpm test— 461 tests pass (13 files)npm run lint— clean🤖 Generated with Claude Code