Don't generate identifiers starting with digits
Describe the bug
If a Hilla endpoint is passing or returning an object with a public getter/setter that starts with a digit, Hilla auto-generates TS types that start with digits as identifiers, leading to compilation error (as TS identifiers should not start with digits)a
Expected-behavior
Hilla wouldn't auto-generates TS types that have identifiers starting with a digit (perhaps, logging a warning when that happens).
Reproduction
Run a Hilla project with this endpoint:
@Endpoint
@AnonymousAllowed
public class HillaEndpoint {
public Foo test() {
return new Foo();
}
class Foo {
public boolean is123asdf() {
return true;
}
}
}
System Info
Hilla 2.4.0.beta1
Throwing an exception in the Java parser could be a good first step.
Not sure if an exception would work, sometimes users aren't able to modify the response type. In my experience it was from returning ResponseEntity that was writing out the models for the http status codes. (1xxInformational() for example).