jscs-dev / node-jscs

:arrow_heading_up: JavaScript Code Style checker (unmaintained)
https://jscs-dev.github.io
MIT License
4.96k stars 513 forks source link

requireNumericLiterals: Prevent erroring when first argument is an Identifier. #2133

Closed rwjblue closed 8 years ago

rwjblue commented 8 years ago

Prior to this fix, the following would trigger an error:

let foo = '123';
parseInt(foo, 16);

After this change, an error is only triggered when using an actual literal (as intended and indicated by the rule name).

Addresses https://github.com/DockYard/ember-suave/pull/80#issuecomment-183779369.

/cc @hzoo

markelog commented 8 years ago

Thanks

hzoo commented 8 years ago

Cool, thanks @rwjblue!