dot-notation should not apply for reserved words
See original GitHub issueI have the following code:
vars["if"] = true
I use bracket notation because if
is a reserved word, and minifiers like yuicompressor
fail if you use vars.if = true
instead.
I want to require dot notation except for cases where there may be a reserved word that could cause problems.
Issue Analytics
- State:
- Created 9 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Workaround to allow reserved words to be used as property ...
I want to use class as a property name of an object, and access it using dot notation. Preamble. I already know that,...
Read more >dot-notation - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >`dot-notation` with `allowKeywords` false incorrectly reports ...
Wait - I'm not saying it's not a reserved word. I'm saying it's not a syntax error - and eslint reports it as...
Read more >Property accessors - JavaScript - MDN Web Docs - Mozilla
Dot notation. In the object.propertyName syntax, the propertyName must be a valid JavaScript identifier which can also be a reserved word.
Read more >Tag: Dot Notation - somewhat abstract
However, as soon as we want a distinct list, the dot notation starts to win out again because C# does not contain a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You want false, not true.
Should do the trick. Documentation states that
allowKeywords
is turned on by default, so passing an option should be necessary. If you are seeing an error withoutallowKeywords
, but not seeing it with it, could you reply with that information, so we could fix documentation?