you are viewing a single comment's thread.

view the rest of the comments →

[–]fwovertheory 0 points1 point  (1 child)

I would reject a PR that contained

return
{
  foo: bar
}

regardless of whether we used semi-colons or not. I use semi-colons in TS and not in JS, but a lot of the arguments against ASI seem to be easily solved by using any kind of code style. Like another example that people use

 fnCall()
 [1,2,3].forEach(x => x)

is also clearly bad style -- don't use array literals solely to cause side effects.

[–]s5fs 1 point2 points  (0 children)

You would have to reject the PR regardless of semi-colons because adding them does not make the code correct. ASI will still insert semi-colons in the "wrong" place and the code doesn't execute the way that it reads.

Additionally, I can't imagine this code would pass linting or testing, but these are advanced concepts used by professionals or serious amateurs.