|
|
|
|
|
by hombre_fatal
2232 days ago
|
|
You need to know when semicolons are necessary whether you use them or not. And the whole point here is that tooling eslint/prettier prevents bugs. Prettier will turn this: const x = foo()
[1, 2, 3].forEach(...)
into this: const x = foo()[1, 2, 3].forEach(...)
Which makes the problem pretty obvious.Btw, if you decide to avoid semicolons, one of the only rules you need to know is to prefix any line with a semicolon if it starts with "[(. |
|