google / eslint-config-google

ESLint shareable config for the Google JavaScript style guide
Apache License 2.0
1.75k stars 139 forks source link

prefer-const should be enabled? #51

Closed 43081j closed 6 years ago

43081j commented 6 years ago

It seems like it isn't enabled and eslint:recommended doesn't enable it either.

However, in the style guide here:

Declare all local variables with either const or let. Use const by default, unless a variable needs to be reassigned. The var keyword must not be used.

So surely this means it should be an error to use let for a variable which is not reassigned?

edit:

seems this is fixed by #49 if it gets merged.

philipwalton commented 6 years ago

Yeah, I've pinged the author of that PR to see if he'll sign the CLA. If not (or if he doesn't respond) I can add this myself.