-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
Add support for ES2016 Object Spread Initializer #1974
Comments
+1 I've been pretty much ignoring my errors and warnings in VSCode in hopes that this would be addressed soon but it's been a few months now. I've also noticed some discussion in the ESLint project about this and their suggestion was to make use of babel-eslint. I wonder if that is possible to use in VSCode... |
This issue was moved to microsoft/TypeScript#6525 |
No point in moving this feature request to the TypeScript project. They already have the feature on their roadmap. It is planned for the 2.0 release of TypeScript. https://github.com/Microsoft/TypeScript/wiki/Roadmap I don't understand why Syntax checking of EcmaScript in Visual Studio Code is dependent on TypeScript though? Do you use TypeScript to check the syntax of plain .js files? |
Yes |
@jrieken shouldn't eslint and babel-eslint be doing that? |
+1 I can't use VSCode at all b/c of this.. My code uses a ton of obj spread, so I am forced to use a different editor 👎 |
Sorry to hear that. Since recent we do have an option to turn off validation for JavaScript - |
@jrieken |
two questions:
|
@dbaeumer Do you have ideas why that is? |
@marc314 Try using the |
@jrieken the setting in not available in 0.10.11 (intellisense doesn't propose it either in that build) |
Ok. mystery solved - @marc314 You got two options: Try out the |
@jrieken @kumarharsh @dbaeumer Thanks guys! I installed the insider build and it solved my issue. Looking forward to the next stable build as well. Much obliged! |
Just updated to v1.0 but spread operator is still marked as an error 😞 |
@albertogasparin Object spread is not es6 but up for es7 discussion. There is a setting to disable validation such that VS Code doesn't complain about the future there. |
Regarding this, as a newcomer to VS Code I found the official docs very helpful. |
To add what @jrieken has, you can use the eslint plugin to have eslint run, it will catch most of the same errors, but may miss some. I'm just ignoring these for now, still annoying. |
The issue still exists - I'm using VS Code 1.7 and ESLint plugin for React.js |
i'm using vscode version 1.7.1 |
What you do is disabling JavaScript errror detecton in VS Code which is a bad idea. ESLint may not find all issues or errors in your code. |
ok i know it would be better vscode supports spread operator natively. |
@marc314 Use Object.assign for now if you want to get rid of that red squiggles. |
I've the same issue and I'use the latest version of VSCODE, the spread operator isn't recognized. |
The thing is that this depends on Salsa, which is itself written on top of Typescript. If I am interpreting discussions in older issues](#3804) correctly, until Typescript doesn't gets these features, Salsa won't, and by extension JS in vscode won't. We can only wait until TS gets better ES8 support, which seems to coming soonTM. |
really unfortunate, since this actually works but gets detected as an error: |
Why is this issue closed? It is important that this gets fixed! I feel this is a bug and should be fixed in vs code. |
This issue is a duplicate of microsoft/TypeScript#2103 which will come with TypeScript version 2.1.3. Please do not comment here but on the actual issue. |
Guess it's back to Atom... |
It's coming in 1.8!!! |
@kumarharsh that sounds great. Do you have a reference? |
Hey, does this problem be solved? I updated my VS code to 1.9, but still get the
Is is any hints about it? update: |
I'm on VS Code version 1.10 and I thought I had this problem too, but then I realized that the code line above didn't have a closing semicolon. Adding the semicolon fixed the problem. |
All my source is under my profile directory... in my profile, I've setup a package.json in my profile root, configured Now I just see eslint errors... doesn't help when editing outside my profile, but works well enough for my own use case. Also, I do setup a per-project eslint.. the baseline in the profile root is a fallback when editing other things that aren't a project, or don't have it setup yet. |
disabled javascript validation and jshint, use eslint only... |
Object Spread Initializers is a proposed feature of ES2016 and is very useful when writing Redux reducers. The syntax is supported in babel, but when using the feature in Visual Studio Code it will mark the spread operator as a syntax error.
See: https://github.com/sebmarkbage/ecmascript-rest-spread/blob/master/Spread.md
for more information of the feature.
It would be very nice if Visual Studio Code did not mark the use of this feature as an error with a red squiggly.
The current behavior in Visual Studio Code is also described in Issue #1640
The text was updated successfully, but these errors were encountered: