Closed dongbohu closed 7 years ago
(4) I am surprised that Google's coding style guide doesn't recommend using === (instead of ==) and !== (instead of !=) operators. Any special reason?
I don't know of the exact reason, but I suspect that since most Google JavaScript code uses Closure Compiler (and thus the types of variables are known), it's not necessary to use ===
.
One example the style guide gives is specifically about allowing ==
when comparing two things where you're sure of their type. For example:
if (typeof foo == 'function') {
// ...
}
Thank you for your reply. By the way, it seems you forgot to correct the typo of "enfore" (now on line 218 of index.js).
By the way, in my original post, the typo should be on line 218 instead of 216. My fault.
Thanks, fixed via 0037169ba795ea0db7c488c83c063bbf2e712d73.
A few minor issues in index.js:
(1) Line 36: What is no-condition option/ I couldn't find it from eslint rules documentation.
(2) ESLint 3.8.0 has a new rule func-name-matching, you may wan to include it between lines 191 and 192 for completeness.
(3) Line 218: there is a typo in the inline comments: enfore should be enforce.
(4) I am surprised that Google's coding style guide doesn't recommend using === (instead of ==) and !== (instead of !=) operators. Any special reason?
Thanks.