syntax highlighting for react code in sublime

前端 未结 3 1165
误落风尘
误落风尘 2021-01-31 01:01

I\'m started writing some basic React code in sublime text. Here is what my syntax highlighting looks like. Its partly highlighted. Is there any suggested sublime plugin i can u

相关标签:
3条回答
  • 2021-01-31 01:30

    You need to install babel-sublime plugin.

    You can install it from package control of sublime.

    Here is the link - https://github.com/babel/babel-sublime

    0 讨论(0)
  • 2021-01-31 01:39

    Installing babel fixes the syntax highlighting.

    Steps to install babel on sublime3:

    1. For windows: Press Ctrl+Shift+P For mac: Cmd+Shift+P
    2. Then type install and select Package control: Install Package
    3. Then type Babel and select 'Babel-Snippets'. It will install babel in few moments.
    4. Then set the Babel syntax in Sublime3 Editor from: View > Syntax > Babel > Javascript

    For some users, Babel was missing in step 4. They can additionally install Babel by following the same steps and selecting Babel this time instead of Babel-Snippets in step3.

    Check I tested it:

    0 讨论(0)
  • 2021-01-31 01:54

    I was able to solve this by setting the syntax to JSX. I didn't need to install this plugin.

    0 讨论(0)
提交回复
热议问题