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
This is more likely a typescript thing, I don't know exactly if it can be applied to Javascript. But I stumbled upon a case where
construnningInIframeContext=ref(false)constsomeMethod=()=>{if(runningInIframeContext){// some logic here}}
This resulted to the if statement evaluating to true all the time, I guess because it's truthy. I should have used runningInIframeContext.value which fixed that bug. But it would be wonderful if vetur could complain that you shouldn't check things in an if statement that is of type Ref or Reactive. I'm not sure if this is the right place, feel free to shout out if this a responsibility of another tool or easy to set up using typescript-eslint or whatever.
The text was updated successfully, but these errors were encountered:
Feature Request
This is more likely a typescript thing, I don't know exactly if it can be applied to Javascript. But I stumbled upon a case where
This resulted to the if statement evaluating to true all the time, I guess because it's truthy. I should have used
runningInIframeContext.value
which fixed that bug. But it would be wonderful if vetur could complain that you shouldn't check things in an if statement that is of typeRef
orReactive
. I'm not sure if this is the right place, feel free to shout out if this a responsibility of another tool or easy to set up usingtypescript-eslint
or whatever.The text was updated successfully, but these errors were encountered: