sindresorhus / emittery

Simple and modern async event emitter
MIT License
1.71k stars 71 forks source link

Mixin syntax gives error #117

Open sp00x opened 1 month ago

sp00x commented 1 month ago

I've never had any success with the Mixin following the example in the docs - Is the syntax outdated for recent Node and TypeScript versions?

@Emittery.mixin('emittery')
class Foo {
}

Gives

Unable to resolve signature of class decorator when called as an expression.
The runtime will invoke the decorator with 2 arguments, but the decorator expects 1.(1238)

on the @Emittery.mixin line

I've tried specifying the method names also to no better result

cyrilchapon commented 5 days ago

try

    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,

in tsconfig.json