Closed

Description
Repro
function myFunction(): unknown {
// triggers no-unsafe-assignment because JSON.parse returns any
let val: unknown = JSON.parse(someStringVar);
// triggers no-unsafe-return because JSON.parse returns any
return JSON.parse(someStringVar);
}
Expected Result
This should not throw an error because a direct any => unknown cast cannot possibly be unsafe. Requiring an as unknown
everywhere is unnecessary noise.
Additional notes
Ideally, any
should not be used across a code base, and I like that the current default rules enforce this. However, a lot of existing APIs still use any
, including the TypeScript library itself, and we have to make do with what we have.