You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When accessing an object value using bracket notation, it will always be reformatted into dot notation, even if the key contains characters that are not valid in dot notation.
Expected behavior
Bracket notation should not be reformatted to use dot notation if the key contains spaces or other invalid characters.
As a matter of opinion, I'm not convinced that it's sensible to unilaterally enforce dot notation. While it is typically more readable, bracket notation can do some things that dot notation simply cannot (for example: text interpolation inside key values, accessing values whose keys contain syntactically significant characters). Without the ability to selectively disable formatting, this aggressive formatting rule effectively locks you out of that functionality.
Checklist
I have checked the known issues to make sure this isn’t already a known issue.
The text was updated successfully, but these errors were encountered:
Description
When accessing an object value using bracket notation, it will always be reformatted into dot notation, even if the key contains characters that are not valid in dot notation.
Expected behavior
Bracket notation should not be reformatted to use dot notation if the key contains spaces or other invalid characters.
To Reproduce
Original Source Code:
This will successfully print the value "baz".
Formatted Source Code:
This will not print the value inside the object, and will present an error.
Notes
As a matter of opinion, I'm not convinced that it's sensible to unilaterally enforce dot notation. While it is typically more readable, bracket notation can do some things that dot notation simply cannot (for example: text interpolation inside key values, accessing values whose keys contain syntactically significant characters). Without the ability to selectively disable formatting, this aggressive formatting rule effectively locks you out of that functionality.
Checklist
The text was updated successfully, but these errors were encountered: