Repository navigation
Description
Problem Statement
tsconfig.json runs with "strict": false and five strict flags turned on one by one. The rest of strict mode is off: strictNullChecks and strictFunctionTypes would flag 149 places today. Those include places where the code reads a value that can be missing (an alignment's data type before parsing, a regex match after a test) and places where a component accepts a setter of the wrong value type. Nothing in CI stops new code adding more.
Solution
The app behaves as it does now. Underneath, tsconfig.json sets "strict": true and drops the flags strict covers, and yarn typecheck passes with no new @ts-ignore or @ts-expect-error. Test files are held to strict mode too. Real bugs that strict mode exposes and whose fix changes what the user sees are filed as their own bug issues, not fixed here.
User Stories
- As a developer, I want the typecheck to reject reading a value that may be missing, so that "Cannot read properties of undefined" crashes are caught before release.
- As a developer, I want an option component to accept only a store option of the value type it renders, so that a number option can't silently receive a string.
- As a developer, I want test files under the same compiler rules as the code they test, so that fixtures can't hide null-shaped bugs.
- As a person using raxmlGUI, I want nothing to change, so that this cleanup costs me nothing.
Implementation Decisions
Each decision lives on its ticket under Map: strict TypeScript:
- How Alignment and Run represent data that isn't parsed yet: typechecked parse result with required fields; the store keeps late-set fields
| undefinedand widens the types that copy them; lookups that can't miss throw anError. - How tests and InputFile build store objects without a parent:
InputFile.rundrops= null;RunParentstays required; tests use the{} as RunParentcast idiom. - How option components type setValue under strictFunctionTypes: generic
OptionSelectOptionLike<Value>andOptionSelect, one commented cast for MUI's change event, every embedding field names its value type. - Slice and order the strict TypeScript spec: four children;
strictFunctionTypesturns on in the first;"strict": truelands with the tests.
Production code narrows for real and uses ! only with a one-line comment giving the reason; tests may use !. One tsconfig; no typescript-strict-plugin.
Testing Decisions
- The changes are type-only: no new tests. Every child passes
yarn verify. - While
strictNullChecksis off, a child proves itself withtsc --noEmit -p tsconfig.json --strictrun before and after: zero errors in the non-test files it owns, and a total that does not rise. Both counts go in the PR description. - The last child turns strict on, so CI's
yarn typecheckbecomes the check from then on.
Out of Scope
noUncheckedIndexedAccess, exactOptionalPropertyTypes and other flags beyond strict; enforcing the ! rule with @typescript-eslint/no-non-null-assertion; generic OptionTextField/OptionCheck; a shared test factory for store parents; behavior fixes for bugs strict mode exposes, such as Applying a modeltest result with an unlisted protein matrix throws a TypeError.
Further Notes
Starting point at 2dbadc8: 149 errors under --strict. Order: the three production children run in parallel; the tests child waits on all three.
Activity
jtklein-agents commentedon Nov 27, 2026
Landed upstream in AntonelliLab#530.