-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Salsa - incorrect error message when using ES7 decorators in a .js file #6872
Comments
@billti This project is actually an interesting test case for Salsa, it uses webpack, bable, react, ES7 decorators, ES7 spread operator, and many other technologies (it is the one from the crash bug microsoft/vscode#2054) To use it as a test case:
|
Looks like we explicitly check for and error on decorators in a JavaScript file (at https://github.com/Microsoft/TypeScript/blob/master/src/compiler/program.ts#L1171 ). Not sure why. I'll get this removed and experiment with the project provided a little also. Thanks! |
@billti thank you! |
@JakeGinnivan It's a much requested feature and on the radar, but not support yet. It's covered by #2103 (and please don't add more +1s to it... we have enough, we know you guys want it 😉 ). |
-- Update 🎱 says my issue is this -- #7076, so you can ignore below -- 👍 Sorry to piggyback on the Issue, but on testing latest version of VSCode/Typescript/Salsa: Does a project require a jsconfig.json for it to recognize If not, still getting Parsing error: The keyword 'import' is reserved (null) message. I can open separate issue. |
I think you have eslint enabled and this error message comes from eslint. To enable imports in eslint you need to enable |
@egamma Thanks!. This project didn't have an .eslintrc.* file. Keep forgetting that plugin extension sets Going to do workaround mentioned in microsoft/vscode-eslint#26, and just enable at Workspace Settings when I do want it. Perhaps we need labeled helper tags that show the message origin, Ext: ESLint, Typescript, VSCode, etc. |
Support for this is in place, see microsoft/vscode-eslint#22. |
@waderyan Looks like you are using the Sublime plugin - is that right? We've not yet released the update to that containing 1.8, but it is pending (see microsoft/TypeScript-Sublime-Plugin#446 (comment) ). Unless you are pointing to a custom TypeScript build in the plugin, you are not yet on 1.8. |
I'm actually using VS Code Alpha build which uses the latest version of Salsa if I understand correctly. |
Did you follow the steps at https://code.visualstudio.com/Updates to enable Salsa (i.e. do you see the Salsa indicator in the status bar as shown)? |
I'm on the latest Alpha build of VS Code which enables Salsa by default. I have confirmed that Salsa is enabled. |
I just installed the latest Alpha build on my desktop (didn't have VSCode installed previously), and got the expected warning as shown below. When I set the compiler option as indicated, the warning went away. {
"compilerOptions": {
"experimentalDecorators": true
}
} Not sure what is up with your install of VSCode, but it seems to be working as expected. |
Excellent. Do you have a link to the list of compiler options? I was not aware of that option. |
See https://github.com/Microsoft/TypeScript/wiki/tsconfig.json for the general file contents (jsconfig.json is the same). There is a link on that page to the full list of compilerOptions also. |
I've got the same issue. Even with a jsconfig.json with the above settings, decorators are detected as errors. VSCode autoupdated last week. |
See the error message in the screen shot below. It is from a .js project that is using ES7 features using bable to downlevel compile it.
If I'm a bable user I consider the error message as wrong. I've tried to enable 'experimentalDecorators' in the jsconfig.json, but this didn't have any effect.
The text was updated successfully, but these errors were encountered: