Open wesbillman opened 3 weeks ago
We're supposed to be using lowerCamelCase everywhere for values and UpperCamelCase everywhere for types.
It would be good to have explicit named functions for this though, as opposed to us implicitly using strcase.ToLowerCamel()
et al
Caveat to this is that for non-FTL names we should use whatever the casing is for that system. eg. for JSON REST API's we should use whatever the most common naming convention for JSON is. FTR Proto's JSON encoding uses lowerCamel.
It would be good to have explicit named functions for this though, as opposed to us implicitly using
strcase.ToLowerCamel()
et al
Yeah that's the spirit of this ticket for the console
side. We currently have quite a few toLower()
calls in the ts
code, which I would prefer to have a noralizeDecl
or something to keep things consistent. So the ftl
side is consistent with like getEcho
, but console
isn't so much.
It's also a bit brittle on the console
because a url with typealias
will fail, where typeAlias
would succeed so we just need to be a bit more tolerant there I think.
Aha! I see, I thought you were referring to the backend, where it's also true.
Some examples:
typealias
vs.typeAlias
in urls and other areas where we check decl case?getuser
vs.getUser
for decl names in urls, etc?We've seen a couple bugs lately specifically with
typealias/typeAlias
that are a bit tricky to track down. Maybe we need somenormalizeX
functions to keep things consistent?