javascript icon indicating copy to clipboard operation
javascript copied to clipboard

why is this flagged?

Open smlombardi opened this issue 11 years ago • 4 comments

This block of code:

_this.numericStepper = {
      'limit': [0], // no negative numbers
      'wheelStep': 1,
      'arrowStep': 1
    };

I get an warning "extra quotes for key". Not sure why...

smlombardi avatar Mar 25 '15 00:03 smlombardi

It's because you don't actually need the quotes for keys unless you wish to use a dash in the key.

tschwartz avatar Mar 25 '15 01:03 tschwartz

If I take them off, js hint flags it an error.

On Tuesday, March 24, 2015, Tyler Schwartz [email protected] wrote:

It's because you don't actually need the quotes for keys unless you wish to use a dash in the key.

— Reply to this email directly or view it on GitHub https://github.com/airbnb/javascript/issues/257#issuecomment-85776551.

smlombardi avatar Mar 25 '15 02:03 smlombardi

This isn't going to be of much help... But I copied your code into a file, copied the airbnb .jshintrc local to that file and ran JS Hint on it and had not a single error.

tschwartz avatar Mar 25 '15 14:03 tschwartz

Just copied this code into http://jshint.com/ and it works fine. Paste your .jshintrc config?

goatslacker avatar Apr 02 '15 05:04 goatslacker