-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Javascript mode cannot parse JSX #3180
Comments
The |
This error is from jshint? I would strongly recommend replacing that with eslint and babel-eslint. Are there any customisation hooks for the linter/parser? |
@nightwing How much work is it to update/ rebuild jshint? |
@SystemParadox did you check the settings? Are you sure that you have JSX mode enabled? |
I have Javascript mode enabled. According to #2606, the "JSX" mode is for an obsolete and totally unrelated language. Looking at the patch, it appears that support for React JSX was added to the Javascript mode. However, that support is only for syntax highlighting, which does appear to be working. The error is coming from jshint. Thanks to mofux for pointing this out. For now I have disabled the jshint worker with |
@SystemParadox If so, you should probably create an issue here and make sure to reference this issue. |
@SystemParadox Try looking in 'Javascript Support' for JSX in C9. |
This is indeed caused by an old version of jshint used in ace. |
Thanks for the clarification. Feel free to close if this is covered by other issues. |
Many of the popular code editors for Sublime Text are actually written in Node.js; this might be something to look into. |
@nightwing Can I bring my own linter yet? 🤓 And if so, is there some documentation I can refer to? |
Any updates? |
Any update ? I am looking to use ace editor to write react code. |
I'd recommend vscode instead |
For now our long-term thinking is to eventually replace such type of linting with LSP support on Ace side and LSP compatible workers / servers #3124 |
JSHint has been recently updated #4911 and now Ace supports JSX syntax as well |
According to #2606, JSX support was added to the Javascript mode back in 2015. However, it does not appear to work, even in the specific version specified when the support was added:
https://rawgit.com/ajaxorg/ace/ec5a1227c43fccfb34a6a9c842d9c4b288d1bf12/kitchen-sink.html
Try entering:
This results in:
I tried various other uses of JSX but it fails on all of them.
Thanks.
The text was updated successfully, but these errors were encountered: