Skip to content

TypeScript explicit_casts: an import/export alias (import * as React, import { A as B }, export { X as Y }) counts as a cast #9458

Backlog

Description

@squid-protocol

Found by the SOP-002 gap-cell decoy suite (protocol SOP-002-v1, epic #8863).

Construct: TypeScript import and export aliases. The explicit_casts branch \bas\s+[A-Z]\w* matches the as Name of a rename in an import or export clause, which binds a name and converts no value.

Snippets and actual hits (expected 0 each):

  • import * as React from "react"; -> 1
  • import { A as B } from "./a"; -> 1
  • export { X as Y }; -> 1

The cast document.getElementById("app") as HTMLElement fires as it should. import * as React from "react" is on the first lines of most .tsx files, so the over-count is large.

Rule: gitgalaxy/standards/language_standards/languages/typescript.py, explicit_casts. Same shape as the Kotlin import-alias issue #9425, separate rule.

Locked in tests/decoys/test_decoy_typescript.py as xfail(strict=True).

Activity

  1. added
    bug
    on Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions