When dealing with external and unknown data and parsing with JSON.parse
, there can be situations where parsing can fail and can lead to uncaught errors in codebase. This rule would flag every JSON.parse
which doesn’t have (at least one?) try
/catch
block as ancestor. Rule could potentially be fixable.
const response = undefined;
const data = JSON.parse(response);
const response = undefined;
let data;
try {
data = JSON.parse(response);
} catch {
data = {};
}
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too