I want to use getters and setters in Typescript. At the moment when I try this I get the following:
error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
How do I configure my compiler in IntelliJ 14? Are there any disadvantages to this? DOes this produce a different type of Javascript that will only work on certain browsers?
Thanks
TypeScript allows converting most of the ES next features to ES3, ES5, ES6, ES2016, ES2017.
With IntelliJ IDEA, you can run and debug client-side TypeScript code and TypeScript code running in Node. js. Learn more from Running and debugging TypeScript.
To change the compiler options you need to go to the FileWatcher Dialogue.
Settings -> Tools -> File Watchers
Select TypeScript and hit the edit (pencil) button.
Add
--target es5
to the arguments field
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With