Is there a JSX formatter for sublime text?

后端 未结 7 1474
闹比i
闹比i 2020-12-23 03:04

I\'m using Sublime Text as a text editor.

There\'s a jsFormat for formatting javascript files but I can\'t find one for JSX.

How you guys deal with formattin

7条回答
  •  盖世英雄少女心
    2020-12-23 03:26

    There is a setting in the HTML-CSS-JS Prettify plugin that allows you to ignore xml syntax in the js/jsx file. That way it doesn't mess up the jsx code. The setting is: "e4x": true in the "js" section of the settings file

    Preferences > Package Settings > HTML\CSS\JS Prettify > Set Prettify Preferences

    This does not work well if you have self closing tags eg. tags ending in />

提交回复
热议问题