在Sublime中配置JsFormat

本文详细介绍了一个JsFormat配置文件的具体设置,包括代码缩进、换行处理、括号空格等选项,以及如何启用自动格式化等功能。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

JsFormat配置文件:
{
// exposed jsbeautifier options
"indent_with_tabs": false,
// 保留换行符
"preservenewlines": true, // 最大连续保留2二个换行符,也就是有一个空行 "max_preserve_newlines": 2, // 在条件语句前有空格 "space_before_conditional":false, //括弧添加空格 "space_in_paren": false, // 在函数的括弧后面添加空格 //"space-after-anon-function":true, "jslinthappy": false,
// [collapse-preserve-inline|collapse|expand|end-expand|none] ["collapse"]
// 代码的样式
"bracestyle": "collapse", "keep_array_indentation": false, "keep_function_indentation": false, "evalcode": false,
"unescapestrings": false, "break_chained_methods": false, "wrap_attributes_indentsize":0,
"wrap-line-length":0,
"end-with-newline":false,
// 支持JSX
"e4x": true,
//最初的缩进级别
"indentlevel": 0, // 缩进二个字符 "indentsize": 2,
// 缩进2个字符,字符是一个空格
"indentchar":" ", //"eol":"\n", // 保存时自动格式化 "format_on_save": true, //格式化选中的文本 "formatselection": true,
// 是否启动.jsbeautifyrc文件
"jsbeautifyrcfiles": false, "ignore_sublime_settings": true, "format_on_saveextensions": ["js", "json"]
}

转载于:https://my.oschina.net/u/3791624/blog/1922262

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值