xojs / eslint-config-xo

ESLint shareable config for XO

Home Page:https://github.com/xojs/xo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Redundency between `no-eq-null` and `eqeqeq`

coreyfarrell opened this issue · comments

When using value == null this is reported twice by ava. This construct can be preferred for browser targets in some cases, value === null || typeof value === 'undefined' does not get minified to value == null.

Would you be willing to make eqeqeq ignore null comparisons, leave it to no-eq-null? This would make it easier to configure the exception in cases where value == null is intentional.

https://eslint.org/docs/rules/eqeqeq#options

Sorry, I know it's a simple change, but I fundamentally believe value == null should not be used at all. It creates a lot less readable code and its behavior can be surprising to new JS devs. I really don't think anyone should use it just to save a few characters for the browser, which will be negligible in practice with gzip anyway.

I'm unclear why it's helpful for two rules to report the same exact thing. I'm not suggesting that no-eq-null should be removed, just that eqeqeq should avoid reporting what no-eq-null will report.