Prunoideae / ProbeJS

Supercharging your modpack experience.
GNU General Public License v3.0
46 stars 14 forks source link

Generated class typings contain syntax errors when class fields have non-identifier names #24

Closed erisdev closed 1 year ago

erisdev commented 1 year ago

Sorry, that's a bit of a mouthful. What I mean is ProbeJS is trying to emit typings with methods named things like handler$dma001$fog-looks-good-now$renderSky or handler$dbb000$lib39-phantom$lib39Phantom$getBlockShape.

I am on Quilt 0.18.6, but this problem could potentially crop up on other loaders as well.

I assume these are mangled names generated by the mixin thingy and probably shouldn't be emitted in the first place, but if you are a completionist, you can also wrap non-identifier method & property names in quotes and TypeScript will parse them correctly, e.g. this is valid syntax:

class Dingus {
    "An arbitrary string as a method name? Say it ain't so, bud."(): void;
}
Prunoideae commented 1 year ago

They look like to be auto generated from mixin or something. ProbeJS would exclude all synthetic methods by default which was what I thought to be safe enough, but I guess I still need to do some method name validity check.

Prunoideae commented 1 year ago

Tried to fix in 7889081df4eb71909a877e31b6d48b928824a2ff

Need to wait for KubeJS to release a new version to get this version released.

Prunoideae commented 1 year ago

It should be fixed in the new version.