-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
style: use unknown in try/catch #7709
Conversation
} catch (err: any) { // eslint-disable-line | ||
if (err.code === 'ENOENT') return null! | ||
} catch (err: unknown) { | ||
if (err instanceof Error && 'code' in err && err.code === 'ENOENT') return null! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this return null!
would have type never
, which would mean that readCurrentLockfile
has a non-null return type despite the fact that it can return null
in reality?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't care about it in this PR. This was like this already.
Looks like when code is executed by Jest, Found the solution: https://twitter.com/andhaveaniceday/status/1764442399538131039 |
18df7eb
to
702091a
Compare
No description provided.