Skip to content

Files

Latest commit

 

History

History
13 lines (7 loc) · 489 Bytes

no-string-literal.md

File metadata and controls

13 lines (7 loc) · 489 Bytes

Pattern: Object access via string literal

Issue: -

Description

Forbids unnecessary string literal property access. Allows obj["prop-erty"] (can’t be a regular property access). Disallows obj["property"] (should be obj.property).

Rationale: If \--noImplicitAny is turned off, property access via a string literal will be any if the property does not exist.

Further Reading