4

Anybody has this issue before? I do not know how to explain so please see the picture here:

Thank you so much for your time and your help!

Alec Mev
  • 4,663
  • 4
  • 30
  • 44
  • 1
    Please don't post screenshots of text. – BSMP Aug 03 '17 at 02:00
  • @BSMP I'm curious, why? :) – Alec Mev Oct 04 '17 at 08:51
  • 1
    @OlegsJeremejevs - Not all users will be able to see the image, it prevents anyone from being able to copy/paste the text, and it hides the text from search engines which makes it harder for someone with a similar issue to find the question. – BSMP Nov 05 '17 at 11:34
  • 1
    @BSMP Did you read the question? This is a syntax highlighting issue, which is much easier and reliable to communicate with an image than [by other means](https://stackoverflow.com/q/21037711/242684). – Alec Mev Nov 05 '17 at 12:43

5 Answers5

1

Install Babel for your sublime

http://www.storybench.org/install-babel-packages-sublime-text-3/

Ashh
  • 44,693
  • 14
  • 105
  • 132
1

Also had this problem for some time. Tried all kind of sublime plugins with custom syntax but non worked.

Finally found this on babel-sublime's git.

In a nutshell:

  • get the syntax definition from VSCode which has support for Typescript, JSX, Flow
  • convert it to YAML using PackageDev
  • copy the new file(eg. JavaScript (VSCode).tmLanguage) to Sublime Text's User folder

You should now see the new syntax in the Command Palette.

Mine looks like this: React/Typescript, Flow Type

Hope this helps.

Community
  • 1
  • 1
andreid
  • 63
  • 2
  • 5
0

add some packages for sublime like below link, as there is no direct support react syntax:

https://github.com/facebookarchive/sublime-react

or check this link

Jigar Shah
  • 6,143
  • 2
  • 28
  • 41
0

You can now simply install the Naomi package:

https://github.com/borela/naomi

All in one package, you get support for:

  • CSS 3+;
  • JavaScript;
    • Stage 0-3 proposals;
    • Node globals;
    • Jest globals;
    • Flow;
    • JSX with complete support for Emmet;
  • HTML 5+;
  • MQL4 (Updating);
  • Jest Snapshot;
  • PHP 7+ (Updating);
  • SCSS (Updating);
laurent
  • 88,262
  • 77
  • 290
  • 428
0

I had this issue and found that it works if you put a semicolon after your closing bracket of the type definition.

Jared Martin
  • 653
  • 7
  • 20