Vscode: react file with .js extension and JavaScript React language doesn't work very well

Created on 18 Nov 2015  路  16Comments  路  Source: microsoft/vscode

errors

2015-11-18 16_15_18-view js - cis-v2-frontend - visual studio code
2015-11-18 16_15_32-view js - cis-v2-frontend - visual studio code

.js file with errors

2015-11-18 16_17_12-

.jsx file without errors

image

Most helpful comment

// Place your settings in this file to overwrite default and user settings.
{
"files.associations": {
"*.js": "javascriptreact"
}
}

All 16 comments

I'm also experiencing this issue. Ignoring it for now, but occasionally I run into an actual syntax error that would have been caught if I hadn't trained myself to ignore them! :)

I believe this is because static properties, rather any class property declared this way, is an ES7 feature and code doesn't yet have support for it.

Question though, are you guys getting bracket completion when using .jsx extension? I'm not. I don't get auto indent either, so I've been using Sublime when working with React at all lately.

Well, it's an ES7 feature, but it doesn't highlight any errors when you use the .jsx extension..
Also, it's even highlighting the <div> tag so... Something is wrong :D

As far as I'm concerned this fix should be better support of JSX contained in .jsx files and an addition of the ability to select which file parsing I want to use for each filetype. And yes the ES7 features are a separate issue.

+1 jsx support in .js file extensions is a required feature

Is anyone else not getting bracket completion and auto indent with .jsx files?

JSX support in .js files is one of the only things keeping me from using VSCode as my primary editor. +1 for getting some sort of support for this.

+1.I like this feature.

+1 add es7 support

same issue here

@tgienger +1 also have this issue - nor auto indent neither bracket auto close - it is a real pity because when I switch language from javascript react to typescript react or just javascript it all works

Same here, it would be good to have jsx support on .js files

+1

Yeah, no proper support for JSX yet. Closing as dope of #140

// Place your settings in this file to overwrite default and user settings.
{
"files.associations": {
"*.js": "javascriptreact"
}
}

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DovydasNavickas picture DovydasNavickas  路  3Comments

lukehoban picture lukehoban  路  3Comments

sirius1024 picture sirius1024  路  3Comments

vsccarl picture vsccarl  路  3Comments

curtw picture curtw  路  3Comments