-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Valid ES6 allowJs error TS8014: 'property declarations' can only be used in a .ts file.
#7216
Comments
error TS8014: 'property declarations' can only be used in a .ts file.
error TS8014: 'property declarations' can only be used in a .ts file.
Duplicate of #6997 |
Just to confirm, are you also transpiling with Babel's Stage 0 preset? |
I haven't got that far yet. I wanted to try out the allowJs option on an existing code base. I simply ran tsc to reproduce this. I might just switch to using full typescript |
If you don't have an external transpiler in the toolchain, then that error message is definitely correct -- this code doesn't run on any current JS runtime. |
so allowJs doesnt support ES6 in? Is this not fully approved code? |
This isn't ES6 syntax. ES6 does not have property initializers. |
TypeScript Version:
1.8.2
Code
tsc --allowJs --out out.js repro.js
Expected behavior:
Compiles without error
Actual behavior:
The text was updated successfully, but these errors were encountered: