Repository navigation
Check every index read, everywhere: noUncheckedIndexedAccess in tsconfig.json - #417
Merged
Merged
Conversation
…fig.json The workspace libraries' last 84 findings handled, so the flag moves from the app's and the embed's own configs into tsconfig.json, and every build -- both libraries, the table web component, the app, the embed -- enforces it. The counted check that held the libraries, its baseline and its CI and preflight steps are removed. reactome-table's store is the spreadsheet behind the GSA form's data entry and had two unit tests. A session test now drives it through generate, import, type, move, select, paste, delete, add and remove rows and columns, and snapshots its state after every step; the snapshots were recorded against the old code, and the rewrite reproduces them exactly. Reads that always threw on a missing row or cell still do, through rowAt/cellAt/maxAt, now saying where. reactome-gsa-form: a parameter type the form does not know, one the GSA service added since, is read as text rather than throwing (parserFor, with a spec); an empty method list or an annotation table with no header row gives an empty value rather than a crash. With the flag in the root config, type-aware lint sees spec and e2e files under it too: three index reads there are guarded. Closes #345. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… stay null From review: - Deleting the row (or column) the selection was in left selectedCoords pointing at it. Cells.select read that row to un-mark it and threw, which ended the store's state stream and left the GSA form's table unusable -- reachable with the delete-row button. Already on main. A cell that is gone has nothing to un-mark now; the session spec gains the step (fails without the fix; earlier snapshots unchanged). - A GSA annotation value missing from a short values list was turned into "" by this PR; it stays undefined (sent as null), as it always was. Co-Authored-By: Claude Opus 5.5 <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.
Closes #345. The last 84 findings, in the two workspace libraries, are handled.
noUncheckedIndexedAccessis now intsconfig.json, so every build enforces it: both libraries,reactome-table-wc, the app and the embed. The flag comes out of the app and embed configs (they inherit it). The temporary counted check (scripts/check-indexed-access.mjs, its baseline, spec, npm script, and preflight and CI steps) is removed.Over #413–#417: 346 findings (77 website, 95 + 85 pathway browser, 84 libraries, 5 templates), with no non-null assertions added (
no-non-null-assertionstayed at 232).reactome-table: the GSA form's spreadsheet
table.store.tsindexes a 2-D grid throughout and had two unit tests. So before rewriting it:table.store.session.spec.ts(new) drives the store through an editing session: generate, mapped import, typing (with the column maximum rising and falling), wrapping moves, range select, paste, delete, add and remove rows and columns by name and index, and an unmapped import. It snapshots the full state (cell values, selection marks, hidden cell, column maxima, start/stop, focus) after every step, plus every selector.trim()in paste fails two of its tests.The rewrite keeps the store's behaviour on a missing row or cell. Reads that always threw on one still throw, through
rowAt/cellAt/maxAt, which now name the coordinates. Reads across rows that are rectangular by construction (pushAllandaddRowkeep them so) go throughatColumn, an explicit cast with that reason.Ranges.minMaxusesMath.min/maxin place of a two-element sort.reactome-gsa-form
typeToParse[type](…), taking the form down. It's now read as text:parserFor, with a new spec.?.slice). An empty annotation table still throws ininitAnnotationColumns(now aRangeErrorsaying the table has no rows), as it did before.comparisonGroup2Valuesalready handled a missing list; its signature now says so.Fixed after review
Cells.selectthrew reading the stale selection. That ended the store's state stream and left the GSA form's table unusable. A cell that's gone now has nothing to un-mark. The session spec gains that step: it fails without the fix, and the earlier snapshots are unchanged (additions only).valueslist shorter thansample_ids) staysundefined(sent asnull), as before. An earlier commit here had made it"".RangeErrorforTypeError), at the same point.Templates found by the library builds
table.component.htmlcolSpan.Lint
With the flag in the root config, type-aware lint also sees spec and e2e files under it. Three index reads there (
e2e/reacfoam.spec.ts,chat-handoff.spec.ts) now type-check as errors, which lint counts asany. They're guarded. Lint is unchanged at its baseline.Tests
build:libs,ng build reactome-table-wc,npm run buildandbuild:embedall succeed.check:lint,check:deadandformat:checkunchanged at their baselines.🤖 Generated with Claude Code