Auto Optional Chainer is a Visual Studio Code extension that automatically adds optional chaining (?.) in JavaScript and TypeScript code where needed. This helps prevent runtime errors caused by accessing properties on undefined or null values.
Features
Automatically inserts optional chaining in JavaScript and TypeScript files.
Supports JSX and TSX files.
Smart detection to avoid modifying console statements and built-in objects (Math, Number, String, Date, React, Object, Array, RegExp, JSON).
Preserves string literals and template literals while processing interpolated expressions inside them.
Provides a quick command (Apply Optional Chaining) to process the active file.