question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"destructured" option for camelCase rule

See original GitHub issue

when destructuring an underscore_spaced request: const { category_id: category } = query; camelCase errors that category_id is not in camel case

It would be nice to have a “destructuring” option, or just ignore when destructuring non-camel-case props to camelCase.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
FunkMonkeycommented, Jun 3, 2016

This still seems to be an issue when destructuring imports, f. ex.:

import { foo_bar } from 'foo';

It is especially problematic as the user has no control over the naming in external libraries.

1reaction
btmillscommented, Jul 29, 2015

Since the pattern key is “external” code*, my first reaction is that we should be ignoring that by default, no option necessary. Thoughts?

*If it comes from a response, then it’s truly external. If it comes from an object created elsewhere, camelcase will catch the issue then. Either way, the local variable is what matters.

Read more comments on GitHub >

github_iconTop Results From Across the Web

camelcase - ESLint - Pluggable JavaScript Linter
This rule focuses on using the camelcase approach. ... Please note that this option applies only to identifiers inside destructuring patterns.
Read more >
Disable check of camel case rule in eslint
I am trying to disable them and address them one at a time. The code below shows that I can disable them all...
Read more >
naming-convention | typescript-eslint
This rule allows you to enforce conventions for any identifier, using granular selectors to create a fine-grained style guide. note. This rule only...
Read more >
vue/custom-event-name-casing
This rule aims to warn the custom event names other than the configured casing. (Default is camelCase.) Vue 2 recommends using kebab-case ......
Read more >
camelCase in front, snake_case in the back : r/javascript
Indeed, either rename the variables during destructuring, have your deserializer on the front end automatically convert to camel case or ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found