1. Download the following plugins:
Https://github.com/ionutvmi/sublime-jsfmt#installation
This plugin is jsfmt and can be searched directly in the package;
The 2.user setting is placed in the following configuration:
{ "AutoFormat":true, "Extensions": [ "JS", "Jsx", "Sublime-settings" ], "Options": { "Jsx": { "Alignwithfirstattribute":true, "Attrsonsamelineastag":false, "Firstattributeonsameline":false, "FORMATJSX":true, "Maxattrsontag": 1 }, "Plugins": [ "Esformatter-jsx" ] }}
3. Open the package file:
As above, install the NPM plugin in jsfmt:
NPM I [email protected] [email protected]
This plug-in can implement JSX code formatting, if not installed, not normal format jsx, can only format JS
4. Finally set the shortcut key:
, this is a tutorial in GitHub, as long as the plugin does not set the shortcut keys, such as to set their own shortcut keys
Sublime format react plug-in configuration tutorial jsfmt configuration