I can't seem to figure out this strange issue I'm having with VS-Code (1.13.1, MacOS). Every time I try to use a class getter or setter, I get the following error:
[ts] Accessors are only available when targeting ECMAScript 5 and higher.
The issue seems to be related to my tsconfig.json
file which is set to target ES6. Here's what it looks like:
{
"compilerOptions": {
"declaration": true,
"module": "commonjs",
"target": "ES6",
"moduleResolution": "node",
"sourceMap": true,
"noImplicitAny": true,
"outDir": "./lib",
"removeComments": true,
"typeRoots": [
"./node_modules/@types"
]
},
"include": [
"src/**/*"
],
"exclude": [
"node_modules",
"**/*-spec.ts"
]
}
To add to the confusion, when I run the file using ts-node, everything works perfectly without any complaints: