Skip to content

fix(typeorm-codegen): avoid unused Column import in generated models #547

Description

@Astton

With @subsquid/typeorm-codegen 2.4.0, every generated entity begins by registering Entity, Column, and PrimaryColumn imports. Column is only needed for enum fields, so models containing no enum fields generate an unused Column as Column_ import.

For example, an entity composed of ID, String, Int, BigInt, and DateTime fields generates Column_ even though the generated class never references it. This creates unused-import findings in static analysis tools such as CodeQL.

Could the generator register Column only in the enum-field branch, alongside the existing decorator-specific imports? That would keep generated models clean without downstream post-processing.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions