ProbeJS

ProbeJS

972k Downloads

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

erisdev opened this issue ยท 3 comments

commented

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;
}
commented

Tried to fix in 7889081

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

commented

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.

commented

It should be fixed in the new version.