Skip to content

Typescript enum names violate uid generation #9997

@Wolvereness

Description

@Wolvereness

Bug Report

Current Behavior

generateUid fails to consider members of an enum via typescript.

Input Code

enum E {
  _E,
}
if ("_E" === path.scope.generateUid("E")) throw "Not actually unique";

Expected behavior/code

To generate a Uid that considers the enum values

Babel Configuration (.babelrc, package.json, cli command)

TEST_ONLY=babel-plugin-transform-typescript make test-only

Environment

  • Babel version(s): 165ef29
  • Node/npm version: Node v8.12.0
  • OS: Windows 10
  • Monorepo: ??
  • How you are using Babel: see above

Additional context/Screenshots

Found this while fixing up the typescript namespace implementation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    i: needs triageoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions