JavaScript 格式化工具,适用于 Sublime Text 2 和 3
JavaScript/json 格式化 (显而易见)
所有设置均可自定义 (空格、格式化样式等)
.jsbeautifyrc 设置文件支持更多的项目级控制
将 Cursor 重新放回格式化前的位置 (考虑到空格/换行的变化)
支持 Sublime Text 3
indent_with_tabs: false
max_preserve_newlines: 4
preserve_newlines: true
space_in_paren: false
jslint_happy: false
brace_style: "collapse"
keep_array_indentation: false
keep_function_indentation: false
eval_code: false,
unescape_strings: false,
break_chained_methods: false*
e4x: false
wrap_line_length: 0
space_after_anon_function: false
以下 JsFormat 特定设置也已公开:
format_on_save: false (在缓存保存时格式化文件) - format_on_save_extensions: [["js", "json"]] (将在保存时格式化的文件扩展名) - jsbeautifyrc_files: false (请参阅 .jsbeautifyrc 文件 部分) 我曾经在一段时间前做出过暂时的判断失误,并合并了一个修改 jsbeautifier 的 Pull Request。结果,从该 Pull Request 添加的功能已丢失; "ensure_space_before_linestarters" 现已不再受支持。 JsFormat 专用的 ensure_newline_at_eof_on_save暂无开放 Issues,或尚未同步最近议题。