Most appropriate sub-area of p5.js?
p5.js version
2.2.2
Web browser and version
not applicable
Operating system
not applicable
Steps to reproduce this
Steps:
- Setup https://typescript-eslint.io/
- Use
tseslint.configs.strictTypeChecked base config or enable the typescript-eslint/no-misused-promises rule
Snippet:
new p5((p) => {
p.setup = async () => { // eslint error: Promise-returning function provided to variable where a void return was expected
await loadImage("/img.jpg")
}
}
Suggestion:
i think the fix would just be to add this JSDoc line to setup():
* @return {void|Promise<void>}
Most appropriate sub-area of p5.js?
p5.js version
2.2.2
Web browser and version
not applicable
Operating system
not applicable
Steps to reproduce this
Steps:
tseslint.configs.strictTypeCheckedbase config or enable thetypescript-eslint/no-misused-promisesruleSnippet:
Suggestion:
i think the fix would just be to add this JSDoc line to
setup():* @return {void|Promise<void>}