sindresorhus/eslint-plugin-unicorn
Rule proposal: `prefer-nullish-coalescing`
Closed
#471 opened on Dec 6, 2019
help wantednew rule
Repository metrics
- Stars
- (5,022 stars)
- PR merge metrics
- (Avg merge 1d 16h) (399 merged PRs in 30d)
Description
https://github.com/tc39/proposal-nullish-coalescing
let foo = (undefined || null) || bar;
// equals
let foo = (undefined || null) ?? bar;
anyway, it not safe for foo || bar -> foo ?? bar, we should use ESLint suggestion api