chore: fix the prettier format glob to target .ts sources - #276
Open
joris974 wants to merge 1 commit into
Open
Conversation
`format` was `prettier --write 'src/**/*.js'`, but this is a TypeScript repo with no .js sources under src/. Prettier treats an unmatched pattern as an error, so `pnpm format` failed with exit code 2: [error] No files matching the pattern were found: "src/**/*.js". Pointing the glob at 'src/**/*.ts' matches the six real sources and mirrors what .restyled.yaml already enforces. No reformat resulted -- all six files report "(unchanged)". Found by the Dead Weight audit of Freckle JS/TS repos. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
joris974
marked this pull request as ready for review
August 25, 2026 20:21
joris974
enabled auto-merge
August 25, 2026 22:04
joris974
disabled auto-merge
August 25, 2026 22:11
joris974
enabled auto-merge
August 25, 2026 22:12
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.
What
A one-line change to
package.json:That is the whole diff — 1 insertion, 1 deletion. No source changes, no
dist/changes, nothing touched independencies.Why
This is a TypeScript package.
src/containseither.ts,formatting.ts,index.ts,index.test.ts,path.ts,test-helper.ts— and zero.jsfiles. The glob could never match anything.A correction to the audit's expectations
The audit made two predictions about this one. Neither held, and both are worth knowing before you read the diff.
1.
pnpm formatwas not silently succeeding — it was failing. The audit expected the script to "exit green having done nothing". Prettier 3.9.6 treats an unmatched pattern as a hard error:So this was visibly broken rather than quietly useless — which is the better version of the problem, since nobody could have mistaken it for working.
2. There is no formatting backlog. The audit expected a large first-run reformat diff. There is none:
All six files were already prettier-clean. The reason is
.restyled.yaml, which already lists the.tsglob under its prettier restyler:The Restyled bot has been formatting these files all along — which is exactly why a broken local
formatscript could sit here unnoticed. This PR just aligns the npm script with what CI already enforces.Verification
Node 22.22.3,
pnpm@11.23.0(matching thepackageManagerfield),pnpm install --frozen-lockfile.pnpm build(tsc -p tsconfig.build.json -d) — clean, andgit statusshows nodist/change. Expected: no source file was modified.pnpm test:Same 82 tests as the baseline run on
mainbefore the change../check-git-clean.shon the committed branch — PASS, no unstaged diff.Branched from
mainateda9cd8(the merge of #275), confirmed current againstorigin/mainat push time. Scope is strictly theformatscript, as requested — #273 (lodash) is untouched.One pre-existing bug I did not fix
pnpm check-git-cleancannot run, onmainor here:The file is committed without the executable bit, so
"check-git-clean": "./check-git-clean.sh"dies withPermission denied(exit 126). I verified the script's logic by invoking it asbash ./check-git-clean.sh— that is the PASS reported above. No workflow in.github/calls it, so nothing is broken today. Fix would begit update-index --chmod=+x check-git-clean.sh; left out to keep this PR to one line. Note the identical problem exists innon-empty-js.Release impact
chore:under the conventionalcommits preset -> no release. A dev-script glob, no published artifact affected.Generated from the Dead Weight audit of 31 active Freckle JS/TS repos.
🤖 Generated with Claude Code