Recently, I decided to switch my file name from index.js
to index.ts
. Here's an example of the issue I'm facing:
let response = "none"
let condition = true
if(condition){
response = {id: 123 , data: []}
}
console.log(response)
However, I'm encountering a syntax error that says {id: 123 , data: []}
is not assignable to type string. This situation is quite frustrating as I have a significant amount of code (over 5k lines) and I'm hesitant to modify all the variables.