Skip to content

Latest commit

 

History

History
43 lines (42 loc) · 5.69 KB

Settings.md

File metadata and controls

43 lines (42 loc) · 5.69 KB

Within VS Code, subordinate settings on js, html, and css are accepted. Note that this is non-standard operation for js-beautify.

Setting Formatter [Type] Description / Default
eol All [String] Character(s) to use as line terminators.
"\n"
end_with_newline All [Boolean] Ensure newline at end of file.
false
indent_char All [String] Indentation character.
" "
indent_size All [Integer] Indent size.
4
indent_with_tabs All [Boolean] Indent with tabs, overrides 'indent_size' and 'indent_char'
false
preserve_newlines All [Boolean] Preserve line-breaks.
true
max_preserve_newlines JS, HTML [Integer] Number of line-breaks to be preserved in one chunk.
10
wrap_line_length JS, HTML [Integer] Wrap lines at next opportunity after N characters. (Set zero to ignore wrapping)
0
extra_liners HTML [Array<String>] List of tags that should have an extra newline before them.
["head", "body", "/html"]
indent_body_inner_html HTML [Boolean] Indent elements within html <body> element.
true
indent_handlebars HTML [Boolean] format and indent {{#foo}} and {{/foo}}.
false
indent_head_inner_html HTML [Boolean] Indent elements within html <head> element.
true
indent_inner_html HTML [Boolean] Indent <head> and <body> sections.
false
indent_scripts HTML [String] "keep", "separate", or "normal"
"normal"
inline HTML [Array<String>]
[ "a", "abbr", "area", "audio", "b", "bdi", "bdo", "br", "button", "canvas", "cite", "code", "data", "datalist", "del", "dfn", "em", "embed", "i", "iframe", "img", "input", "ins", "kbd", "keygen", "label", "map", "mark", "math", "meter", "noscript", "object", "output", "progress", "q", "ruby", "s", "samp", "select", "small", "span", "strong", "sub", "sup", "svg", "template", "textarea", "time", "u", "var", "video", "wbr", "text", "acronym", "address", "big", "dt", "ins", "strike", "tt" ]
wrap_attributes HTML [String] Wrap attributes to new lines. "auto", "force", "force-aligned", "force-expand-multiline", "align-multiple", "preserve", or "preserve-aligned"
"auto"
wrap_attributes_indent_size HTML [Boolean] Indent wrapped attributes to after N characters. Defaults to 'indent_size'.
false
unformatted HTML [Array<String>] List of tags that should not be reformatted.
[]
content_unformatted HTML [Array<String>] List of tags who's content should not be reformatted
["pre", "textarea"]
void_elements HTML [Array<String>] HTML void elements - aka self-closing tags
["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "menuitem", "meta", "param", "source", "track", "wbr", "!doctype", "?xml", "?php", "?=", "basefont", "isindex"]
newline_between_rules CSS [Boolean] Add a newline between CSS rules.
false
selector_separator_newline CSS [Boolean] Add a newline between multiple selectors.
true
space_around_combinator CSS [Boolean] Ensure space around selector separators (>+~).
false
brace_style JS [String] "collapse", "expand", "end-expand", "none", "collapse,preserve-inline", "expand,preserve-inline", "end-expand,preserve-inline", or "none,preserve-inline"
"collapse"
break_chained_methods JS [Boolean] Break chained method calls across subsequent lines.
false
comma_first JS [Boolean] Put commas at the beginning of new line instead of end.
false
e4x JS [Boolean] Pass E4X xml literals through untouched.
false
indent_level JS [Integer] Initial indentation level.
0
jslint_happy JS [Boolean] Enable jslint-stricter mode. (Forces 'space_after_anon_function')
false
keep_array_indentation JS [Boolean] Preserve array indentation.
false
keep_function_indentation JS [Boolean] Preserve function indentation.
false
operator_position JS [String] Move operators to before or after a new line, or keep as is. "before-newline", "after-newline", or "preserve-newline"
"before-newline"
space_after_anon_function JS [Boolean] Add a space before an anonymous function's parens, ie. function ().
false
space_after_named_function JS [Boolean] Add a space before a named function's parens, ie. function example ().
false
space_before_conditional JS [Boolean] Ensure a space before conditional statement.
true
space_in_empty_paren JS [Boolean] Leave space in empty parentheses, ie. f( ).
false
space_in_paren JS [Boolean] Add padding spaces within parentheses, ie. f( a, b ).
false
unescape_strings JS [Boolean] Decode printable characters encoded in xNN notation.
false
unindent_chained_methods JS [Boolean] Unindent chained methods