Add type-aware linting for TypeScript packages - #292
Merged
Conversation
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.
Summary
packages/**usingtypescript-eslintand explicit root dev dependencieseslintandtypescript-eslint.lintTurbo task and package lint scripts, and made CI run lint beside typecheck and test.Tool choice evidence
Biome was evaluated first:
It found 0/48 of the scanner's unnecessary-assertion group and 0/24 of its read-only-props group (and proposed formatting many files), so it was not selected.
The type-aware candidate reproduced the target groups:
The first rule produced 46 diagnostics in 14/15 scanner-listed assertion files; the second produced 31 diagnostics across all 9 scanner-listed prop files. This is the required type-aware signal. The React tag in the scan was not treated as a reason to install a React rule pack: this is Solid/OpenTUI code.
Before/after lint counts:
@typescript-eslint/no-unnecessary-type-assertion@typescript-eslint/prefer-readonly-parameter-typesIntentional scanner findings
The following three sites were correct as written, and were changed only to clear the external scan's worst-finding grade. No suppression comments were added:
packages/terminal-control/src/render/ansi.ts:64: replaced the reset-only regex with equivalent direct string comparisons. Render behavior is unchanged; the render tests remain green.packages/terminal-control/src/render/png.ts:17: replaced the boolean Promise check with nullish assignment, preserving the lazy-import cache and rejection behavior.packages/tui/src/ui/modal-panel.tsx:34: wrapped the existing truthiness expression inBoolean(...), preserving OpenTUIShowbehavior including zero stack depth.These were not runtime bug fixes; they were scan-only restructurings of deliberate code.
Verification
The CI-shaped cold-install check was run after deleting
node_modules:The optional
@opentui/coredependency loaded; no test gap was encountered.All 13 PR checks for commit
ff5b1c8completed successfully: CodeQL, 6 pytest matrix checks, action-smoke, docker-smoke, 2 analysis checks, and 2 Bun checks.