Enforce dot notation whenever possible

Proprietary

Converts bracket notation property accesses with constant, identifier-safe keys to dot notation. For example, obj["prop"] becomes obj.prop and obj?.["prop"] becomes obj?.prop. Replicates the autofix of the ESLint rule dot-notation under its default options. In TypeScript, it converts only properties the receiver's type declares on a type that is not a class, so bracket access to private and protected members and to index signatures, which tsc rejects as dot access, is left alone.

io.moderne.javascript.cleanup.DotNotation
mod run . --recipe=io.moderne.javascript.cleanup.DotNotation

Install it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.