refactor: convert @ts-ignore to @ts-expect-error where the error always fires#7243
Open
tomas-zijdemans wants to merge 1 commit into
Open
refactor: convert @ts-ignore to @ts-expect-error where the error always fires#7243tomas-zijdemans wants to merge 1 commit into
tomas-zijdemans wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7243 +/- ##
=======================================
Coverage 95.00% 95.00%
=======================================
Files 617 617
Lines 51674 51674
Branches 9326 9326
=======================================
+ Hits 49093 49094 +1
Misses 2038 2038
+ Partials 543 542 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Converts 16
@ts-ignorecomments across 8 files to@ts-expect-error. No runtime changes, comments only.@ts-ignoresuppresses an error whether or not it exists, so when a suppressed error gets fixed upstream, the stale comment sticks around and hides future problems.@ts-expect-errorfails the build the moment the error disappears, which makes it self-cleaning. The compiler now guards these 16 spots for free.I audited all 22
@ts-ignorecomments in the repo and only converted the ones where the error is guaranteed in every configuration:csv,collections,crypto,text)testing/mock.ts: the TS2509 inconstructorSpyis inherent to extending a generic constructorrandom/_test_utils.ts: typed-array mocking that can't satisfy the constructor types_tools/check_docs.ts: accessing.docon the un-narrowedJsDocTagunionThe remaining 8 stay as
@ts-ignoreon purpose. Their errors are conditional:Deno.lintonly exists in Deno >= 2.2 types, themedia_typescomments work around dnt issue #148 (no error under Deno),time_test.tsdepends on runtime lib types, and the FFI type incli/_toolsneeds--unstable-ffi. Converting those would break the cross-version CI matrix.