clausreinke / typescript-tools

(repo no longer active) Tools related to the TypeScript language
Apache License 2.0
266 stars 29 forks source link

How I can configure it to target ES5 when checking for errors? #41

Closed hippich closed 9 years ago

hippich commented 9 years ago

I am getting a lot of:

"TS1056: Accessors are only available when targeting ECMAScript 5 and higher."

And was wondering if there is a way to configure it to use ES5 standard?

clausreinke commented 9 years ago

If I recall correctly, I used ES5 as the default target, with no configuration, but it has been a while.

I'm going to spend some time on this project next week anyway, because of #39. Given that TS1.4 has some ES6 capabilities, being able to configure the target sounds like a good idea.

clausreinke commented 9 years ago

@hippich can you provide a small test case that shows the error?

hippich commented 9 years ago

I got this error with simple test.ts file with the following content:

var Something = {
  get name() {
    return 'test';
  }
};
clausreinke commented 9 years ago

Thanks, that helps: I still see no error, with:

$ ../bin/tss --version
v0.3.1-2-g12c88d4

$ ../bin/tss empty.ts <issue-41.script
"loaded c:/javascript/typescript/codeplex/typescript-tools/tests/empty.ts, TSS listening.."
update 5 empty.ts
var Something = {
  get name() {
    return 'test';
  }
};
"updated c:/javascript/typescript/codeplex/typescript-tools/tests/empty.ts, (0/0) errors"
showErrors
[]

same if I load directly from file (instead of updating an empty file)

hippich commented 9 years ago

Uh, I am so sorry to waste your time on this - it turned out default configuration of Syntastic plugin was throwing it off. Yes, tss seems alright! Thank you!