The description found here is very short:
Disallows object access via string literals.
Is there any further documentation or example?
The description found here is very short:
Disallows object access via string literals.
Is there any further documentation or example?
It means you can't access objects using the bracket notation. For example:
object["property"]
This way, a simple typo will throw an error and that's why it should be avoided. Instead, it is encouraged to use strongly-typed access.
obj["prop-erty"]
(which are allowed by this rule). –
Molecule © 2022 - 2024 — McMap. All rights reserved.