This is my JavaScript code:
class Dispatcher extends EventTarget {}
const dsp = new Dispatcher();
dsp.addEventListener('SOME_EVENT', function (event) {
console.log(event);
});
const evt = new Event('SOME_EVENT');
dsp.dispatchEvent(evt);
My IDE (PhpStorm) display this warning:
Argument type __Event is not assignable to parameter type Event
But the code runs perfectly:
/usr/bin/node /home/alex/.../main.js
Event {
type: 'SOME_EVENT',
defaultPrevented: false,
cancelable: false,
timeStamp: 33.53751400113106
}
Process finished with exit code 0
Why the Event constructor returns the __Event object?

All you need to do is delete the
./.idea/folder from the root directory. The warning message will disappear.