Take a look at this code snippet:
var x = {};
x.test = 'abc';
An issue arises with the TypeScript compiler showing the error message:
TS2339: Property 'test' does not exist on type '{}'.
To tackle this warning for object literals, I assumed that adding suppressExcessPropertyErrors
to the tsconfig.json
file would resolve it.
Here's how I configured my tsconfig.json:
{
"compilerOptions": {
"suppressExcessPropertyErrors": true
},
...
}
However, despite trying this solution, the compiler continues to display the same error message.
If you have any suggestions or tips, please share them! Thanks in advance :)