Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Decorators are only available when targeting ECMAScript 5 and higher" error on file save #47

Closed
yyyar opened this issue Apr 24, 2015 · 7 comments

Comments

@yyyar
Copy link

yyyar commented Apr 24, 2015

I have an issue using typescript-vim with the typescript code containing decorators.
When I save file, I'm getting error:
error| TS1205: Decorators are only available when targeting ECMAScript 5 and higher.

I added let g:typescript_compiler_options = '-t ES5 --module commonjs' to my vimrc, but it does not help. When I run :make it works fine fine without errors, however.
Could you point me on what I'm missing?

P.S. I'm also using syntastic-async for pretty errors display.

decorator

Thanks!

@leafgarland
Copy link
Owner

I'm not sure but I think it is syntastic (or something else) that is giving you the error message when you save. This plugin does not do that, it only supports compiling via the :make command.

@leafgarland
Copy link
Owner

Looking at the docs for syntastic, I think you could do something like this to configure it:

let g:syntastic_typescript_tsc_args = "--my --args --here"

@leafgarland
Copy link
Owner

Perhaps all these typescript plugins (including this one) should look at supporting tsconfig.json

@yyyar
Copy link
Author

yyyar commented Apr 25, 2015

@leafgarland, Thank you, it works!

@myitcv
Copy link

myitcv commented Aug 2, 2015

@leafgarland 👍 to the comment about tsconfig.json

@metal3d
Copy link

metal3d commented Mar 2, 2016

👍 for syntastic option, that fixes my problem :)

@metal3d
Copy link

metal3d commented Mar 2, 2016

A better solution:
http://stackoverflow.com/questions/34102184/use-tsconfig-json-for-tsc-with-syntastic-in-vim

You only have to set this in .vimrc:

let g:syntastic_typescript_tsc_fname = ''

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants