As of jQuery 1.9+ $.parseJSON
is identical to native JSON.parse
and will not
attempt to "fix" invalid JSON.
To retain the old behaviour and "fix" invalid falsy behaviour, use:
JSON.parse(input || 'null')
Examples of incorrect code for this rule:
$.parseJSON(input)
jQuery.parseJSON(input)
Examples of correct code for this rule:
JSON.parse(input)
JSON.parse(input || 'null')