prefer-optional-chain Prefer optional chaining to equivalent nullish conditionals A conditional that returns undefined for a nullish receiver manually implements optional access. Instead, you SHOULD use optional chaining at the guarded access. The guarded receiver must produce the same value without observable effects each time it appears. - Category: style - Level: warning - Fix: automatic - Scope: module Reported interface User { name: string; } function name(user: User | undefined): string | undefined { return user === undefined ? undefined : user.name; } Accepted interface User { name: string; } function name(user: User | undefined): string | undefined { return user?.name; } Prior art - typescript-eslint ยท prefer-optional-chain language/linter/src/rules/style/preferoptionalchain.rs:8