Fix lint CI: install from lockfile (npm ci) instead of lockless yarn#365
Merged
Conversation
The lint job ran `yarn` with no `yarn.lock` in the repo, so yarn ignored package-lock.json and resolved every dependency fresh from the package.json ranges. prettier isn't a direct dependency — it comes in transitively via gts (^3.6.2) — so CI floated to the newest prettier (3.9.4), while local development pins 3.8.1 through package-lock.json. prettier 3.9.x changed how it wraps union return types (collapsing the leading-`|` multiline form 3.8.1 produces), so `gts check` failed in CI on heap-profiler.ts / heap-profiler-bindings.ts even though the code was correctly formatted for the pinned prettier — and the failure never reproduced locally. Switch install to `npm ci` (and the script to `npm run lint`) so CI uses the exact package-lock.json versions the repo is developed against. This fixes the prettier drift and prevents any future lockless-yarn float for every other tool in the lint chain. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Overall package sizeSelf size: 2.4 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | pprof-format | 2.2.2 | 500.53 kB | 500.53 kB | | source-map | 0.7.6 | 185.63 kB | 185.63 kB | | node-gyp-build | 4.8.4 | 13.86 kB | 13.86 kB |🤖 This report was automatically generated by heaviest-objects-in-the-universe |
nsavoire
approved these changes
Jul 2, 2026
szegedi
added a commit
that referenced
this pull request
Jul 2, 2026
…365) The lint job ran `yarn` with no `yarn.lock` in the repo, so yarn ignored package-lock.json and resolved every dependency fresh from the package.json ranges. prettier isn't a direct dependency — it comes in transitively via gts (^3.6.2) — so CI floated to the newest prettier (3.9.4), while local development pins 3.8.1 through package-lock.json. prettier 3.9.x changed how it wraps union return types (collapsing the leading-`|` multiline form 3.8.1 produces), so `gts check` failed in CI on heap-profiler.ts / heap-profiler-bindings.ts even though the code was correctly formatted for the pinned prettier — and the failure never reproduced locally. Switch install to `npm ci` (and the script to `npm run lint`) so CI uses the exact package-lock.json versions the repo is developed against. This fixes the prettier drift and prevents any future lockless-yarn float for every other tool in the lint chain.
Merged
szegedi
added a commit
that referenced
this pull request
Jul 3, 2026
…365) The lint job ran `yarn` with no `yarn.lock` in the repo, so yarn ignored package-lock.json and resolved every dependency fresh from the package.json ranges. prettier isn't a direct dependency — it comes in transitively via gts (^3.6.2) — so CI floated to the newest prettier (3.9.4), while local development pins 3.8.1 through package-lock.json. prettier 3.9.x changed how it wraps union return types (collapsing the leading-`|` multiline form 3.8.1 produces), so `gts check` failed in CI on heap-profiler.ts / heap-profiler-bindings.ts even though the code was correctly formatted for the pinned prettier — and the failure never reproduced locally. Switch install to `npm ci` (and the script to `npm run lint`) so CI uses the exact package-lock.json versions the repo is developed against. This fixes the prettier drift and prevents any future lockless-yarn float for every other tool in the lint chain.
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.
Problem
The
lintCI job runsyarnwith noyarn.lockcommitted. Yarn ignorespackage-lock.json(npm's lockfile), so it resolves every dependency fresh from thepackage.jsonversion ranges on each run.prettieris not a direct dependency — it's pulled transitively viagts(prettier@^3.6.2). So CI floats to the newest prettier (currently 3.9.4), while local development pins 3.8.1 throughpackage-lock.json.prettier 3.9.x changed union-return-type wrapping, collapsing the leading-
|multiline form that 3.8.1 emits:Result:
gts checkfails in CI onheap-profiler.ts/heap-profiler-bindings.tseven though the code is correctly formatted for the pinned prettier — and the failure never reproduces locally.Fix
Switch the install to
npm ci(and the script tonpm run lint) so CI uses the exactpackage-lock.jsonversions the repo is developed against. This fixes the prettier drift at the root and prevents future lockless-yarn float for every other tool in the lint chain.Note
.github/workflows/package-size.ymluses the same locklessyarninstall and has the same latent drift risk; left out of scope here since it isn't currently failing.