Can't specify object keys that aren't camel case, even when quoted
See original GitHub issueIt appears I’m going to have to create pragmas to ignore some rules.
With the following object:
const obj = {some_key: 1234}; // 'some_key' is required by the consuming library
XO dies with
Identifier some_key is not in camel case. camelcase
However, when quoting it (thinking maybe it would ease the error), it errored out with:
Unnecessarily quoted property some_key found. quote-props
It appears there’s no proper way in XO to do this without ignoring some lines (which is ugly).
What XO should do is detect when errors arise in quote-props
would cause other errors if unquoted and ignore such cases, though I would imagine this would require some hefty plugin code.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:16 (9 by maintainers)
Top Results From Across the Web
Why does Firefox console only quote some object keys?
You can't use .notation on a string and you can't have white space. I am sure this is why camelCase is an important...
Read more >Is it bad practice to use hyphens in JSON keys?
People usually use camelCase for JSON because it's always good practice to follow the naming conventions of the programming environment and it's standard ......
Read more >CamelCase vs underscores: Scientific showdown - whatheco.de
In my experience, more better coders use underscore. Camel case seems to have cropped-up from Java, mainly. By the way: I type Dvorak....
Read more >camelcase-keys
Convert object keys to camel case. Latest version: 8.0.2, ... Start using camelcase-keys in your project by running `npm i camelcase-keys`.
Read more >Groovy Language Documentation
The reserved keywords can't in general be used for variable, ... of a property name are lowercase and for multi-word properties that camel...
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 Free
Top 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
camelcase
has an option to ignore object keys. i.e.The problem is that ESLint rules have no knowledge of each other and the ESLint team doesn’t seem interested in solving such problem. We could maybe work around it in XO by checking the results and handle conflicts.