-
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
static class properties invalid #6997
Comments
From @nwehrle on February 10, 2016 9:55 The lint error message is: Nette Grüsse nach Wollishofen :) |
The warning comes from Salsa - moving. |
@same thing here, looking at the default settings in VSCode it appears:
is no longer a setting? I realize this issue has been moved to TypeScript, but it doesn't seem like you can disable validation for JS in VSCode anymore? Also, note that the same error occurs when using Type aliases (such as with Flow):
type Action = {
type: string,
payload: Object,
error?: Object,
}; |
correct, |
Thanks for the clarification! |
This code isn't valid JavaScript, nor does Babel understand this syntax. It seems like this is a correct error to issue. How is this being transpiled? |
This code is usable with the stage-0 preset of babel. |
@jwulf Not knowing enough about experimental specs I'm assuming the decorators are safe to use even though you get a different error about using experimental decorators? |
Seems like we should allow any syntax that the TypeScript parser is capable of recognizing and is part of a JavaScript standards proposal (regardless of stage), and leave it up to the user to figure out if their target engine is capable of supporting it (just as they have to for classes, arrow functions, etc..). |
In addition to @billti's suggestion, We could add a new flag sourceJSVersion (or some better name) and if specified to es5, then using later features is an errors. |
👍 on both. Adding a 'sourceJSVersion' would bring back a feature the old Code JS language service supported by overloading the |
Hi! |
Hello! |
Writing code which does not make sense is not a good workaround for bad syntax highlighting in text editor ;) |
Thanks.
It seems it had remove salsa validation, while eslint is still enabled. Just perfect for my use case. |
I cannot use the decorator trick as babel won't compile it (and installing extra babel plugins to workaround this seems excessive). Similarly the "sommons" trick doesn't work either. Does anyone have any other ideas? Right now it looks like a downgrade to an earlier release of VS Code is my only option. |
@robcaldecott pls see this comment microsoft/vscode#3804 (comment). This will be in the march update. |
@robcaldecott @davezuko |
Thanks @egamma, I've been on insiders for a week or so now and it's working well. |
I written
in the jsconfig.json file and now it OK. |
I have updated a plugin yesterday and today it shows again the error.... what can I say???? |
the issue has not been fixed, and is still open. hopefully we will get to it soon. sorry for the trouble. |
@Charmatzis until this issue has been addressed you can disable the syntax errors, pls see the following doc |
I like Facebook Flow approach on this. The compiler says that some syntax is experimental, but in order to suppress this message add some config to the |
Should this be working in V 1.5.1? It does not seem so. |
This got fixed in TS 2.0. VS Code 1.5.1 ships with TS 1.8.1. To use TS 2.0 pls see https://code.visualstudio.com/docs/languages/typescript#_using-newer-typescript-versions |
I'm having the same issue as #9121, which is supposedly a dupe of this one. This is happening with all the However I'm currently using TS 2.2.0 in which this should currently be fixed. Changing from Javascript to Typescript to Typescript React seems to force a recheck but with the same result. VSCode 1.7.1 |
Why not name the file into |
I don't own the package; this is the sample code generated by Ignite for Reactive Native. So I could change it on my local system, but that seems like a poor workaround for something which should work. |
I am not sure what is the expectation. this is not JS file. JS has no definition for type aliases declarations in the current version of the spec (ES 2016) or any future one. even if we do allow the TS declarations to be allowed, i do not think it would work for flow-specific syntax. Using file extensions like JS for non-standard features is to blame here. |
I think the problem here is that many React templates are using Flow syntax here and there. Many of the default bootstrap React templates have Flow as a babel preset. This is using Flow Class declarations, which is a proposal for ES, currently in stage 2. I don't believe the right answer for this is to allow class declarations in .js files, yet, though there is a proposal for it. There is a larger issue, I suppose, of allowing TypeScript/VS Code/Salsa/etc. to play nicely with Flow and all its reliance on babel plugins on regular .js files. The current fix for this is to install the Flow tooling for VS Code and set a workspace setting for |
From @nwehrle on February 9, 2016 21:17
I use eslint to lint my jsx files. Before I switched to salsa, the linting inside the editor worked fine. After switching to salsa the linting fails inside the editor.

Salsa is enabled:

Linting from the shell still works without any errors or warnings.
I expect vscode to not show any linting errors.
System:
OSX 10.11.2
vscode 0.10.8
db71ac615ddf9f33b133ff2536f5d33a77d4774e
jsconfig.json:
User settings:
Partial eslintrc:
Copied from original issue: microsoft/vscode#2866
The text was updated successfully, but these errors were encountered: