prefer-nullish-filter-predicate
Prefer an explicit nullish predicate when filter(Boolean) removes only nullish values but does not narrow the result type.
Why
An explicit nullish predicate preserves the same runtime elements while letting TypeScript remove null and undefined from the result.
Fix
Replace filter(Boolean) with filter((value) => value !== null && value !== undefined).
Examples
declare const users: readonly ({ id: string } | null)[];const present = users.filter(Boolean);declare const users: readonly ({ id: string } | null)[];const present = users.filter((user) => user !== null && user !== undefined);