Dear Zeppelin devs,
In our current implementation of "eslintrc" semicolons disallow, and
generally, there are two schools of thought. The first is that we should
treat ASI as if it didn’t exist and always include semicolons manually. The
rationale is that it’s easier to always include semicolons than to try to
remember when they are or are not required, and thus decreases the
possibility of introducing an error.
However, the ASI mechanism can sometimes be tricky to people who are using
semicolons. For example, consider this code:
*return*
*{*
* name: "ESLint"*
*};*
This may look like a return statement that returns an object literal,
however, the JavaScript engine will interpret this code as:
*return;*
*{*
* name: "ESLint";*
*}*
Effectively, a semicolon is inserted after the return statement, causing
the code below it (a labeled literal inside a block) to be unreachable.
This rule and the no-unreachable rule will protect your code from such
cases.
Want to know your opinion on should we change this (eslintrc) to always
allow semicolons, which will make JS less error/accident prone and more
readable.
--
Thankx and Regards,
Prabhjyot Singh