Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript ES6 ES2015(Babel)格式/Beautfier for.jsx.js的Sublime_Javascript_Reactjs_Sublimetext3_Babeljs - Fatal编程技术网

Javascript ES6 ES2015(Babel)格式/Beautfier for.jsx.js的Sublime

Javascript ES6 ES2015(Babel)格式/Beautfier for.jsx.js的Sublime,javascript,reactjs,sublimetext3,babeljs,Javascript,Reactjs,Sublimetext3,Babeljs,在使用ES2015执行Reactjs时,我希望能够将我的代码格式化为Sublime 花了相当长的时间寻找这个问题的答案,并找到了这个线索 . 但似乎永远也没有解决办法。除了格式化代码,Babel和ESlint为我做了一切 你试过了吗?添加插件可能有助于格式化代码。(免责声明:我做到了),对于一些需要修复的角落案例,它有一些bug,但是对于最常见的案例,您可能会得到很好的结果 我一直在想的一件事是从头开始编写格式化代码,使用babylon解析代码。目前它使用js美化 这里有一个例子,如果你想尝试它

在使用ES2015执行Reactjs时,我希望能够将我的代码格式化为Sublime

花了相当长的时间寻找这个问题的答案,并找到了这个线索 . 但似乎永远也没有解决办法。除了格式化代码,Babel和ESlint为我做了一切

你试过了吗?添加插件可能有助于格式化代码。(免责声明:我做到了),对于一些需要修复的角落案例,它有一些bug,但是对于最常见的案例,您可能会得到很好的结果

我一直在想的一件事是从头开始编写格式化代码,使用babylon解析代码。目前它使用js美化


这里有一个例子,如果你想尝试它,你可以尝试安装sublime text的主题,它支持所有es6和jsx。您可以在这里找到它:

您可以按照以下步骤安装babel语法

    1.go to this url  https://packagecontrol.io/installation copy the code of sublime text 3 or sublime text 2 from the url

    2.open sublime text editor and go to menu options of View and select the "show console" 

    3.then paste the code from the above url and press enter.It will install the package manager.

    4.press ctrl+shift+p and type install in the input box. A list of options will come,then select the Install package option.It will install.

    5.After installing the above press again ctrl+shift+p and type the "babel" and select babel in the list.It will install the babel syntax

    6.to change the syntax of the page select the view menu and choose syntax/babel

你说的格式是什么意思?(语法突出显示/自动完成/美化?)