I am trying to run this code but it is giving me following errors:
Animal.ts(10,13): error TS1056: Accessors are only available when targeting ECMAS
If you're dealing with single file you could do this
tsc your-file.ts --target ES2016 --watch
If you wants inside your tsconfig.json for entire project configuration
{
"compilerOptions": {
"target": "ES2016"
}
"files": []
}
You may want to use either ECMAScript numeric "es6", "es7", "es8" or year of release like "ES2015", "ES2016", "ES2017".
ESNext targets latest supported ES proposed features.