Structure → Sort declarations consistently in files#81
Merged
Conversation
revett
force-pushed
the
revett/structure-files
branch
from
July 20, 2026 22:08
77b75c7 to
637ff80
Compare
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.
Greptile Summary
This PR introduces a new File Layout rule to the TypeScript-as-Go skill guide (v0.4.0 → v0.5.1) and mechanically applies it across all 15 source files: declarations are sorted by kind first (exported constants → private constants → exported types → private types → exported functions → private functions → framework class shell), then alphabetically within each kind.
settings.test.tsreorders two case arrays to lead with the happy-path test, consistent with the new test-file narrative rule.Confidence Score: 5/5
Pure mechanical reordering with no logic changes; safe to merge.
Every changed file contains only moved declarations — no function bodies, types, or exported signatures were altered. The SKILL.md update adds the layout rule that this PR then applies uniformly, and the test file changes follow the new narrative ordering guidance.
No files require special attention.
Important Files Changed
Comments Outside Diff (1)
src/settings/settings.test.ts, line 14-92 (link)The new layout rule says test files must group cases by the symbol under test "following the same order the source file declares them." After this PR,
settings.tsexports alphabetically:draftForDisplay(d) →endpointFor(e) →hasConnectionConfig(h) →normalizeSettings(n) →regionFor(r) →settingsEqual(s). The test file currently opens withnormalizeCasesand closes withdraftForDisplayCases, which is the reverse of that order. The group ordering should be:draftForDisplay→endpointFor→hasConnectionConfig→normalizeSettings→regionFor→settingsEqual.Context Used: .agents/skills/typescript-as-go/SKILL.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Reviews (3): Last reviewed commit: "Merge branch 'main' into revett/structur..." | Re-trigger Greptile
Context used: