-
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
0.10.10 erroring on object spread properties in .js files #3804
Comments
+1 |
I'm happy for the inclusion of the Typescript-based Salsa syntax support, but as @garthk mentions it is an odd situation that we are now in. ESLint is also very much encouraged in the vscode docs (and I've been using it for quite some time already). What I don't understand is why we can't have Salsa-based syntax color support (and maybe some other things as well) without forcing the Salsa (Typescript) syntax validation. It seems to me that if ESLint is to become the standard (or at least recommended) way for validation then there should be a simple way to disable the Salsa/Typescript validation. Apparently at the moment there is not, and this is a very serious impediment to productivity. The issues with incomplete syntax color coding in past versions is highly preferable to an inability to disable code validation that isn't up to par with current coding conventions. The musings about specs and javascript stages on the Typescript repo in regards to the object spread operator don't justify a continued lack of support for a feature that is well-established in practice and is supported in Babel. That's fine if the Typescript devs want to hold back, but now Microsoft is forcing the Typescript opinions on everyone using vscode without an ability to disable it. I guess I just don't understand why the original There really doesn't seem to be a whole lot of noise about it yet, but that's probably because the February release only just came out. Salsa support in the January release was opt-in, and given the hoops you had to jump through to enable it I'm thinking that not a whole lot of people tried it out. If I'm missing something then please enlighten me, but I haven't found any workaround yet (not even in the vscode alpha release). Sorry if it seems like I'm cranky. I also just spent several hours figuring out that ESLint 2.3.0 breaks all linting in vscode at the moment. |
I feel the same way :/ I was looking forward to the Feb release to maybe switch from Atom but this is a blocker for me. |
@garthk I will change the doc to make this limitation more obvious. |
We will revive the This will remove the red squiggles, but this will not fix that Salsa doesn't understand these syntactic constructs. This means the code understanding experience is limited, e.g, when it comes to intellisense, go to definition. @dlong500 @garthk from this feedback I conclude that these limitations are tolerable as long as the red squiggles do not get in your way. Is this correct? |
Yes, you can say that. That's one major irritant because it's expected that linting run smoothly when transitioning from other editors. Linting and intellisense are separate things (from the user's perspective), and I think it's a more logical tradeoff that we'd lose intellisense support until Salsa comes up to speed. |
@kumarharsh this explanation makes sense, thanks. |
@egamma reviving that setting would be great. I think it allows me to fully switch to vscode :) |
How is the intellisense and syntactic recognition of Salsa different from the pre-Salsa engine? If there isn't much difference then I'm fine with simply disabling Salsa's validation. However, if there is a big difference would it be possible to have an option to continue to use the pre-Salsa engine for intellisense at least until Salsa matures a bit? |
@egamma removing the red squiggles and entries in FWIW, |
@dlong500 both Salsa and the previous JS infrastructure build on the TypeScript parser and AST. The previous JS infrastructure has the same limitations when it comes to using ES7 language features, but it supported to turn off validation. One issue is that the TypeScript version used for the previous JS infrastructure is now really out of date. This is why we need to deprecate it as soon as possible.
|
Ok, thanks for the clarification. I just wanted to know if the pre-Salsa intellisense was superior but it sounds like it was the same or worse, so there's no need to keep it around anymore.
Maturity maybe wasn't the best word. I was referring to the Typescript foundation of Salsa in regards to support for newer ECMAScript features that are already supported by other tools like Babel and ESLint. I get the desire to be careful with language constructs that may still be in flux, but I think sometimes there is too much hesitation in supporting features that are already used in the wild and are clearly going to be in a future spec one way or another. In any case, thanks for the quick responses and for the revival of the option to turn off built-in validation. Quick question: what is the difference between the insider channel and the alpha channel? Is the alpha channel always more up-to-date than the insider channel? |
got it, thans. This topic is discussed here microsoft/TypeScript#2103 (comment)
The alpha channel is updated multiple times a day and it is the version the development team is using. So it might be broken from time to time. The insiders channel is updated one week before a stable update, but we are looking into updating stable more frequently. |
I'm now on 0.10.11-insiders but no sign of |
the 0.10.11 insiders only includes the same critical fixes that went into stable. We look into pushing another insider update today. |
FYI the insiders build with the above change is out now https://code.visualstudio.com/blogs/2016/02/01/introducing_insiders_build |
The linter seems to be working, but all the errors are being shown as: |
@kumarharsh do you have the eslint parser options configured for JSX/React? See below: Also the error message should be prefixed with See the 'jsx' and {
"env": {
"browser": true,
"commonjs": true,
"es6": true
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
"jsx": true
},
"sourceType": "module"
},
"plugins": [
"react"
], |
@egamma updating the plugin fixed it. Actually, not I understood what that error is saying: The eslint plugin highlights the
with the error:
I thought this was a because maybe the eslint plugin was throwing an error due to some internal error, but it is trying to find an eslint rule matching the missing |
I already gave a thumbs on on the change being available in Insiders, but came back especially to call out the March 2016 release note content on this issue. Well writ, @egamma and @gregvanl. Thanks. I'm full time on Insiders. It's looking good. |
VSCode version 1.2.0 still has this problem?
[js] Property assignment expected. |
@frogcjn I'm sorry but I'm not getting this issue at all. Haven't gotten this issue after fixing up these issues:
|
@kumarharsh I've tested. If you do not turn
|
@frogcjn yes, you'll need to turn off |
@kumarharsh, so the VSCode Salsa currently still not support Object Spread/Rest? Right? |
Yes, I think that has been clarified by the vscode dev team time and again. Salsa does not have es7 features, but will get it later (most probably in this year). Anyways, disabling salsa does not take away too much from the experience - the intellisense still works okay (without some features), and even gives great cross-file suggestions like say I imported constants from a 'utils/constants' file, then intellisense shows those constants in suggestions, etc. |
This is to support the use of the spread operator where ever we include IDFields. microsoft/vscode#3804
* [Artist] Only include displayable shows. Fixes #473 * [vscode] Disable TypeScript based validation in favour of ESLint. This is to support the use of the spread operator where ever we include IDFields. microsoft/vscode#3804 * [Artist] Share common implementations of partner_shows and shows fields. * [Artist] Revert addition of only displayable shows filter. * [PartnerShow] Guard against partner data missing.
We just picked up a new release of TypeScript (2.1.4-insiders) that I believes fixes this. You can try this out in the current VSCode insiders build (2016-12-05T07:03:07.371Z) and it will also be going in to VSCode 1.8. Please give the latest insiders builds a try and let us know if you run into any trouble or notice any problems. Thanks |
Regarding the .vue files object/rest support the Vue Component extension may help. As I see the .vue files are recognized as HTML by vscode so the HTML syntax need to be extended with object rest/spread support. |
@zoltanzf Thanks for the tip, this issue have been bugging me for a while! |
My solution is vetur. |
@lizhiyao vetur works for you? How? (Any particular setup / are you sure you didn't just disable JS validation?) I just tried vetur 2.0.1 with a fresh profile on 1.8.1 and today's 1.9.0-insider, and I still get a |
I didn't disable JS validation. vs code version: 1.8.1 in my
|
… and I can't turn it off by setting
javascript.validate.enable
false.Perhaps this is a soft documentation bug: the release notes proudly mention
experimentalObjectRestSpread
but then say:… which is confusing and misleading.
It's confusing because the stand-out tone of core dev responses to that issue is "not until TC39 moves it to stage 3; bother them, not us", which is much less optimistic than the Feb 2016 release notes or the TypeScript Roadmap itself.
It's misleading because it fails to describe the impact of "support… not yet provided" as error messages you can't make go away. If there's some way to make them go away, please describe it in that part of the release notes. If not, I don't think it's too strong to outright advise users of object spread properties to delay upgrading.
Without a work-around, this kills
code
for me, as I now have to dig for the real errors amongst a few dozen erroneous:Property assignment expected.
Argument expression expected.
Declaration or statement expected.
I trust a workaround is possible, as
code
is not erroring in JSX.The text was updated successfully, but these errors were encountered: