You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you use the .update(...) method on a writable store and don't explicitly return a value the store will be set to undefined. That might be on purpose, but I'm willing to bet that more often than not it's accidental.
Description
The rule should look for .update() calls that match the signature of writable.update() and ensure that all code paths return some value. Doesn't have to the be the original value or anything specific, I just think being able to require the usage of return <thing>; to make it really explicit that a value is being set would be useful and prevent errors.
Motivation
If you use the
.update(...)
method on a writable store and don't explicitly return a value the store will be set toundefined
. That might be on purpose, but I'm willing to bet that more often than not it's accidental.Description
The rule should look for
.update()
calls that match the signature ofwritable.update()
and ensure that all code paths return some value. Doesn't have to the be the original value or anything specific, I just think being able to require the usage ofreturn <thing>;
to make it really explicit that a value is being set would be useful and prevent errors.Examples
Additional comments
No response
The text was updated successfully, but these errors were encountered: