Skip to content

PackageToJS: Replace @ts-ignore with @ts-expect-error in templates#643

Open
krodak wants to merge 1 commit intoswiftwasm:mainfrom
PassiveLogic:kr/ts-expect-error-templates
Open

PackageToJS: Replace @ts-ignore with @ts-expect-error in templates#643
krodak wants to merge 1 commit intoswiftwasm:mainfrom
PassiveLogic:kr/ts-expect-error-templates

Conversation

@krodak
Copy link
Member

@krodak krodak commented Feb 17, 2026

Overview

instantiate.js uses // @ts-ignore (4 instances) to suppress TypeScript errors on import.meta.PACKAGE_TO_JS_* properties and the conditional bridge-js.js import. These are inside /* #if */ preprocessor blocks, so after preprocessing only some survive into the final output.

@ts-expect-error is stricter than @ts-ignore - it errors if the suppressed line doesn't actually produce a type error, which catches stale suppressions. @ts-ignore silently swallows everything, including suppressions that are no longer needed.

This also resolves @typescript-eslint/ban-ts-comment violations in the generated output. The rule bans bare @ts-ignore by default since @ts-expect-error is the safer alternative.

Line 163 already uses @ts-expect-error with a description - this makes the rest consistent.

@krodak krodak self-assigned this Feb 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant