UNPKG

@putout/plugin-apply-nullish-coalescing

Version:

🐊Putout plugin add ability to apply nullish coalescing operator (??)

8 lines (6 loc) 293 B
export const report = () => 'Nullish coalescing should be used'; export const replace = () => ({ 'const __a = __b || __c': 'const __a = __b ?? __c', '__a = typeof __a === "undefined" ? __b : __a': '__a = __a ?? __b', '__a = __a === undefined ? __b : __a': '__a = __a ?? __b', });