1

I enabled Node coding assistance under "Settings -> Languages & Frameworks -> Node.js", yet it is not able to resolve EventEmitter functions like on() when extended to a child and also functions like fork() and variables like isMaster under node.js cluster module.

Any known bug or resolution tips ?

enter image description here

1 Answer 1

2

Unfortunately due to a way cluster is defined in @types/node its inferred type is any, so no completion/resolving is possible:(

enter image description here

As a workaround, I'd suggest specifying the type explicitly with JSDoc:

/**
 * 
 * @type {module:cluster.Cluster}
 */
const cluster = require('cluster');
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.