I wonder if "starting with semicolons" is a new standard after ASI and no-semicolon.
But mine is a little different async IIFE.
;(async () => { // code })().catch(console.error)
Other special cases.
;[ ... ].forEach ;(a as any).key
Also, there is a rule in ESLint called no-return-await, so
no-return-await
async function foo () { return await fetch('/api') } // is same as async function foo () { return fetch('/api') } // is same as function foo () { return fetch('/api') }
Yes, you can await sync functions as well, as long as it returns a Promise.
Yes. I have an ESLint rule enforcing those rules... Those are nice!
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I wonder if "starting with semicolons" is a new standard after ASI and no-semicolon.
But mine is a little different async IIFE.
Other special cases.
Also, there is a rule in ESLint called
no-return-await
, soYes, you can await sync functions as well, as long as it returns a Promise.
Yes. I have an ESLint rule enforcing those rules... Those are nice!