In my TypeScript classes in Visual Studio, I have been implementing getter functions. I find that using getter functions helps to clean up my code, although there is one issue that I would like to address.
class Foo {
doWork(){
console.log(this.bar);
this.bar = 2;
}
get bar(){
return 1;
}
}
While the first line in the `doWork` function does not raise any complaints from Visual Studio, I am looking to fix the second line. Even though the code throws an error when transpiled and run on the client side, Visual Studio fails to flag this as an issue. I wonder if there might be a setting in Visual Studio that could help identify such errors in the code.