Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

false positive in variable-name rule #599

Closed
HamletDRC opened this issue Aug 23, 2015 · 2 comments
Closed

false positive in variable-name rule #599

HamletDRC opened this issue Aug 23, 2015 · 2 comments

Comments

@HamletDRC
Copy link
Contributor

There is a false positive in the variable-name issue.

My code:

    var localStorageItem = ...;
    try {
        JSON.parse(localStorageItem);
     } catch (SyntaxError) {
         return null;
     }

SyntaxError gives the error:
variable name must be in camelcase or uppercase

It should not.

@adidahiya
Copy link
Contributor

you're assigning the error value to a new var named SyntaxError... what do you expect instead? do you want to disable this rule for all catch statements?

#522 is probably the right way to deal with this

@HamletDRC
Copy link
Contributor Author

You are correct, this is not a false positive.

I was reading SyntaxError as a class reference, not as a variable reference. I blame too much time coding Java. Sorry for the false issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants