Why does prettier want to prefix my IIAFE with ";"?

488 views Asked by At

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",
...
1

There are 1 answers

0
Walter On

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.