I thought you are going to explain...
I currently use no semicolon, but some of the most common scenario at the beginning of the line include
;(() => { // scoped JS code })() ;(a as any).b = c ;[1, 2, 5].map(fn)
ESLint in VSCode will complain, if a semicolon is needed.
Actually I was going to write a blog post about it. But I was researching first in order not to forget things. There are indeed at least two cases where semicolons aren't optional. I wonder whether there are more....?
You know it is call ASI, right? -- this SO post
Normally, I wouldn't run into something like
return { foo: 1 }
Although, I do get things like this from Prettier. (I didn't create it myself.)
const foo = 'very long text'
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 thought you are going to explain...
I currently use no semicolon, but some of the most common scenario at the beginning of the line include
ESLint in VSCode will complain, if a semicolon is needed.
Actually I was going to write a blog post about it. But I was researching first in order not to forget things. There are indeed at least two cases where semicolons aren't optional. I wonder whether there are more....?
You know it is call ASI, right? -- this SO post
Normally, I wouldn't run into something like
Although, I do get things like this from Prettier. (I didn't create it myself.)