Repository navigation
🧪 Type-check needstable.js in CI - #1928
Merged
Merged
Conversation
`needstable.js` is plain JavaScript typed through `// @ts-check` and JSDoc, and `design/needstable-contract.md` §4 records the one command that checks those types -- but nothing ran it, so a JSDoc type could regress silently. The command becomes a poe task, `typecheck-js-needs`, with the typescript version pinned (an unpinned `npx -p typescript` resolves whatever compiler is newest that day), and the Lint job runs the task rather than a copy of the command, so the local gate and the CI gate cannot drift. Lint rather than `tests-js`: it needs no browser, no sphinx and no interpreter matrix, and Lint is a required status context. No `setup-node` -- `ubuntu-latest` ships node, and `npx -y -p` fetches the pinned compiler for the run. The task lists one path per line, so adding a script to the gate is one line; only `needstable.js` qualifies today.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1928 +/- ##
==========================================
+ Coverage 91.84% 92.03% +0.19%
==========================================
Files 105 105
Lines 16231 16279 +48
==========================================
+ Hits 14907 14983 +76
+ Misses 1324 1296 -28
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
chrisjsewell
added a commit
that referenced
this pull request
Sep 8, 2026
#1928 made `tsc` a Lint gate for `needstable.js` and said the second path line was #1922's to add: the collapse script was jQuery-era, carried no `// @ts-check` and did not pass `--strict`. It does now, so the `typecheck-js-needs` task lists it, and the step and the AGENTS.md line that named one script name both. Proof the gate reaches the new file: with `setHidden(parts.visibleIcon, showRows)` changed to pass `"yes"`, the task exits non-zero with src/sphinx_needs/libs/html/sphinx_needs_collapse.js(102,38): error TS2345: Argument of type 'string' is not assignable to parameter of type 'boolean'. `design/needstable-contract.md` §4 is left alone: it is the needtable's contract, and the recipe it records is unchanged.
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.
needstable.js(#1920) is plain JavaScript typed through// @ts-checkand JSDoc, anddesign/needstable-contract.md§4 records the single command that checks those types. It passes at the tip, but nothing ran it, so any later edit could regress a type silently. This makes it a gate.typecheck-js-needs, holds the command with the typescript version pinned (typescript@5.9.3): an unpinnednpx -p typescriptresolves whatever compiler is newest that day, which would let a TypeScript release turn a pull request red with nothing here having changed. To bump it, edit that one literal and run the task. 5.9.3 is the newest 5.9.x; the file is also clean under 7.0.2, today'slatest.poe lint. Lint rather than thetests-jslane: it needs no browser, no sphinx and no interpreter matrix, and Lint is a required status context in its own right. Nosetup-node:ubuntu-latestships node and npm, andnpx -y -pfetches the pinned compiler into the runner's npm cache for the run (about 2.5 s cold on an empty cache, 23 MB unpacked).needstable.jsonly.sphinx_needs_collapse.jsis jQuery-era, carries no// @ts-checkand does not pass--strict; ✨ Port sphinx_needs_collapse.js off jQuery and drop sphinxcontrib-jquery #1922 ports it and is the pull request that adds the second line. The task lists one path per line, so that is a one-line change.AGENTS.mdcommands block gains the task. No changelog entry: nothing user-visible changed.Proof the fence bites: with
this.sortColumn = -1(declared@type {number}) changed to a string, the task exits 2 withCloses #1924