noPropertyAccessFromIndexSignature

When this flag is enabled, TypeScript will no longer allow you to use the dot syntax (.) to access fields which may not be defined.

This setting ensures consistency between accessing a field via the “dot” (obj.key) syntax, and “indexed” (obj["key"]) and the way which the property is declared in the type.

Was this page helpful?