安装Babel插件语法转义

ctrl+shift+p->install package->Babel可以支持ES6和JSX语法

安装JsFormat (可以不安,无影响)

Preferences->Package Settings->JsFormat->Settings-User中加入以下代码,可以支持JSX格式化

{
  "e4x": true,//支持jsx格式化
  "format_on_save": true//保存立即格式化,看个人喜好
}

设置Emmet 可自动补全代码

Preferences->Key Bindings - User加入以下代码

[{
    "keys": ["tab"],
    "command": "expand_abbreviation_by_tab",
    // put comma-separated syntax selectors for which
    // you want to expandEmmet abbreviations into "operand" key
    // instead of SCOPE_SELECTOR.
    // Examples: source.js, text.html - source
    "context": [{
            "operand": "source.js",
            "operator": "equal",
            "match_all": true,
            "key": "selector"
        },
        // run only if there's no selected text
        {
            "match_all": true,
            "key": "selection_empty"
        },
        // don't work if there are active tabstops
        {
            "operator": "equal",
            "operand": false,
            "match_all": true,
            "key": "has_next_field"
        },
        // don't work if completion popup is visible and you
        // want to insert completion with Tab. If you want to
        // expand Emmet with Tab even if popup is visible --
        // remove this section
        {
            "operand": false,
            "operator": "equal",
            "match_all": true,
            "key": "auto_complete_visible"
        }, {
            "match_all": true,
            "key": "is_abbreviation"
        }
    ]
}]




当下载一切完成后,重新启动如果没有 需要手动设置

ctrl+shift+P        输入babel javascript 按回车




本文摘录自https://www.jianshu.com/p/ca880a1986c6

Created with the Personal Edition of HelpNDoc: Free EPub producer