Convert to optional chaining

Quickly convert repeated property accesses to use optional chaining.

This refactoring works in both JavaScript and TypeScript and can help you quickly clean up and simplify code