'Why does prettier want to prefix my IIAFE with ";"?
I have had async funcs in my useEffect hooks from a javascript project that I am now converting to typescript:
(async ():Promise<void> => {
const stuff = await doStuff()
setThings(stuff)
})()
Worked without issues before but now in typescript I am getting an error:
...
"severity": 8,
"message": "Replace `(async·():` with `;(async·():·`",
"source": "eslint",
...
Solution 1:[1]
To simplify the response based on @yen's comments- when I enabled semicolons for prettier (and reloaded) it seemed to understand where everything was supposed to be. I suppose I will use semis in JS/TS from now on, it seems to be a best practice anyway.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Walter |
