Skip to content

[BUG] Enums being referenced as types #373

@darthmeme

Description

@darthmeme

Describe the bug
When setting enumsAsTypes: false, the enums get correctly generated but any references to it are still using types. For example if I have a enum TestEnum

enum TestEnum {
  ONE
  TWO
  THREE
}

Part of the output looks like

export enum TestEnum {
  ONE
  TWO
  THREE
}

export type ResolversTypes = {
  TestEnum: ResolverTypeWrapper<'ONE' | 'TWO' | 'THREE'>;
}

So the LSP will not suggest using the export enum type but rather string literals.

To Reproduce
Clean install, create an enum and set typesPluginsConfig.enumsAsTypes to false

Expected behavior
Any references to the enums in the generated files should actually use the enum

Versions

  • OS: macOS
  • OS Version: 15.4.1
  • Package name and version "@eddeee888/gcg-typescript-resolver-files": "0.12.1"

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions