You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by branchseer January 8, 2025
oxc-transform currently follows babel's rules on enum transformation. IMHO it's a little bit weird about whether an identifier should be resolved to the enum member:
Confirmed that this weird behavior is also present in Babel. Babel REPL
I am no TypeScript expert, so I may be wrong, but my understanding is: TSC is the "source of truth" on TypeScript transforms, and Babel's TS transform should replicate TSC's behavior. If it doesn't, then that's a bug in Babel.
@branchseer May I suggest raising an issue on Babel? That would help "flush out" answer on whether they diverged from TSC for any good reason, or if it's simply a bug.
Discussed in #8341
Originally posted by branchseer January 8, 2025
oxc-transform currently follows babel's rules on enum transformation. IMHO it's a little bit weird about whether an identifier should be resolved to the enum member:
https://playground.oxc.rs/#eNqNkcFqwzAMhl9F+NIEwroOdunooD0Udhh7gVycREkNjlRsp11X8u6Tk6UbXRk7+Zcs/f+HfValWqqckiSF1TOccwI4aAdrWMFsh9by7Cn2kLoWtszjBAz3i2zUG9HrDOZz6RoPDj3bA1YQGMIOx9UW2wIdmBpMmHkomXzQFKJBn1OfJqnE/BNjIxc/MF512N05TRW3SfoL6U0Q3NF4zGRYiK7puAvC5Uveo3AVhipDzTVWTl/BH2Pw7djv0Jc6ervoSHw7IhsfQjfa0F9PJhQ5qUyxWp6V6yge/kRBv6tlcB1myhoKkx5CLsWpLdhOVRBWX7Nrx0afqb12Hp0Yio4mk75MDg0VtGtQEhT6h/vFo5KJkitsMLJI0RoytZmW5WeDY7u1fIzLB3QFe0GqtfXY9/0nDIDKdw==
In contrast, tsc has a simpler rule:
https://www.typescriptlang.org/play/?#code/PTAEEFQSwZ1BDANgd3gTzgJwKYwPaIBu2AJqAC54UAW2o2AdgK4C2oL2LARtpgHQAoIQAphASlABeAHygA3gNChC8TBCmgA5AHNEeLkk0BuRfWZsAYnioKlSyJNABGADSmlAIQ3gXoUwF8BfzFxEwFRCRl5UxU1By1dfUMTJUZWUA9VaLt1RwBZeHJqPkx4BhI8FnE3HK9HHwCgkLEwgTS2TIAvbNzQAqKSsoqqsRqM7zdAoA
Would it be better to switch to tsc's rule?
The text was updated successfully, but these errors were encountered: