However, esformatter-quote-props throws an error when it has to handle them itself. If I run esformatter again on the result, an error occurs:
$ esformatter --plugins esformatter-quote-props
var choices = {0777: true};
^D
Value needs to be a string
The attached pull request fixes this bug by simply making sure that the object passed to unquotedValidator is always a string. The tests were also updated to trigger the bug (see first commit).
According to the MDN docs, numeric property names are valid in JavaScript. Thus, esformatter-quote-props does remove the quotes around them:
Before:
After:
However, esformatter-quote-props throws an error when it has to handle them itself. If I run esformatter again on the result, an error occurs:
The attached pull request fixes this bug by simply making sure that the object passed to
unquotedValidator
is always a string. The tests were also updated to trigger the bug (see first commit).Please merge if you like!