mattpocock / ts-error-translator

VSCode extension to turn TypeScript errors into plain English
https://ts-error-translator.vercel.app
2.36k stars 90 forks source link

Wrong Explanation for 1313 #248

Open moritztim opened 8 months ago

moritztim commented 8 months ago

https://ts-error-translator.vercel.app/?error=CoCwpgBARg9gJgTwjAZhAhgOwgcgJYo4QDOALuqWALZiakQDGWmM9Ukp4E1ADqUmQrVapAHRA

Current explanation:

Explanation I don't know what to do with something like this:

if (;){
// do stuff
}

But it would make much more sense if you added a condition inside the parentheses:

if (name==="Georgia"){
// do stuff
}

What's wrong

This is the error you get for the example in the explanation is this on line 1:

Declaration or statement expected.ts(1128)

The error that this is trying to explain concerns the body, not the condition.

Correction

Explanation I don't know what to do with something like this:

if (condition);

But it would make much more sense if you actually did something based on the condition

if (condition) {
 // this is the body.
 console.log("condition is true!")
}