protobuf-ts icon indicating copy to clipboard operation
protobuf-ts copied to clipboard

Enums are not converted from snake_case

Open Zamiell opened this issue 2 years ago • 4 comments

Based on my brief testing, it does not seem that enum keys are converted from snake_case to PascalCase. (I presume that PascalCase should be used over camelCase, since it is idiomatic.)

For example, I would expect the following proto code:

enum Status {
  launched = 1;
  init_game = 2;
  in_game = 3;
  in_replay = 4;
  ended = 5;
  quit = 6;
  unknown = 99;
}

To be converted to:

enum Status {
  Launched = 1,
  InitGame = 2,
  InGame = 3,
  InReplay = 4,
  Ended = 5,
  Quit = 6,
  Unknown = 99,
}

But instead, the enum keys are unchanged, and remain snake_case.

Zamiell avatar Apr 22 '22 10:04 Zamiell