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.

Camelcase rule change for #9470

See original GitHub issue

What rule do you want to change?

camelcase: fix quoted properties being ignored (#9470) but allow use of the old behavior through an option.

Does this change cause the rule to produce more or fewer warnings?

More.

How will the change be implemented? (New option, new default behavior, etc.)?

The default behavior will be to warn about non-camelcase quoted properties, and the previous behavior of ignoring quoted properties will be behind a new option, ignoreQuotedProperties.

Please provide some example code that this change will affect:

var foo = {
    barBaz: 1,
    "qux_quux": 2
};
foo.camelCased = 10;
foo["snake_cased"] = 11;

What does the rule currently do for this code?

Currently, the camelcase rule emits no warnings for this code.

What will the rule do after it’s changed?

A warning will be produced for the "qux_quux" and "snake_cased" properties because they are not camelcase. If ignoreQuotedProperties is enabled, the old behavior is retained and no warnings are produced.

Are you willing to submit a pull request to implement this change?

Yes, see #12777.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
mdjermanoviccommented, Mar 25, 2020

If we have ignoreQuotedProperties default to true instead of false this will be non-breaking, what do you think?

I think the default value should be non-breaking true.

The actual behavior of this rule may be an oversight, but it has some use cases (e.g., to quote names required by a third-party API), so it might be better to retain it for the start and maybe change the default later in another major version.

0reactions
eslint-deprecated[bot]commented, Apr 29, 2020

Unfortunately, it looks like there wasn’t enough interest from the team or community to implement this change. While we wish we’d be able to accommodate everyone’s requests, we do need to prioritize. We’ve found that issues failing to reach accepted status after 21 days tend to never be accepted, and as such, we close those issues. This doesn’t mean the idea isn’t interesting or useful, just that it’s not something the team can commit to.

Thanks for contributing to ESLint and we appreciate your understanding.

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. If your style guide calls for camelCasing your variable names, then this rule is for...
Read more >
[camelcase] Remove rule from recommended config #1358
I'd like to request that the camelcase rule is removed from the recommended config to match ESLint: https://eslint.org/docs/rules/camelcase ...
Read more >
Disable check of camel case rule in eslint - Stack Overflow
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 >
Untitled
Radio station frequencies nottingham, Sleds kohi, Eat out in coupon, Muka lawak kartun, L style carbon shafts, Kickoff rule change ncaa!
Read more >
Untitled
Hanging paper lamps ikea, Real estate law center pc pasadena ca, ... Mago merlino film 1998, Jabra pro 9470 listen to music, Teac...
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