Permalink
Browse files

Adopt js-beautify v1.6.8

  • Loading branch information...
1 parent da08649 commit 8907e9218fa9a2023046a8a9594e7982bfed7cbb @HookyQR committed Jan 3, 2017
Showing with 135 additions and 106 deletions.
  1. +6 −5 CHANGELOG.md
  2. +1 −1 README.md
  3. +3 −2 Settings.md
  4. +1 −11 package.json
  5. +124 −87 schema/beautifyrc.json
View
@@ -1,10 +1,11 @@
-### 0.6.2: 28 Nov 2016
-* Force eol to document setting in editor.
+### 0.7.0: 04 Jan 2016
+* Bump js-beautify version to 1.6.8
+ * _*Note:* This changes the default settings for `"unformatted"` and adds the `"content_unformatted"` option._
+* Refactor schema to improve maintainability.
-### 0.6.1: 28 Nov 2016
+### 0.60 - 0.6.2: 28 Nov 2016
+* Force eol to document setting in editor.
* Put back redundant call on save until the textEdit fix is in VS Code (hopefully 1.8.0)
-
-### 0.6.0: 26 Nov 2016
* Remove ***onSaveIgnore*** setting as it won't work with the VS Code formatOnSave setting
* Remove redundant format call on save
* Add [Settings.md](https://github.com/HookyQR/VSCodeBeautify/blob/master/Settings.md) help file
View
@@ -82,7 +82,7 @@ _Note:_ This used to be controlled by the `beautify.*Files` settings. If you sti
Beautify on save will be enabled when `"editor.formatOnSave"` is true.
-Embedded version of js-beautify is v1.6.4.
+Embedded version of js-beautify is v1.6.8.
### Keyboard Shortcut
Use the following to embed a beautify shortcut in keybindings.json. Replace with your preferred key bindings.
View
@@ -17,9 +17,10 @@ indent_handlebars | HTML | [Boolean] **format and indent `{{
indent_head_inner_html | HTML | [Boolean] **Indent elements within html &lt;head> element.** <br> true
indent_inner_html | HTML | [Boolean] **Indent `<head>` and `<body>` sections.** <br> false
indent_scripts | HTML | [Boolean] **"keep", "separate", or "normal"** <br> "normal"
-wrap_attributes | HTML | [String] **Wrap attributes to new lines. "auto" or "force"** <br> "auto"
+wrap_attributes | HTML | [String] **Wrap attributes to new lines. "auto", "force", "force-align" or "force-expand-multiline"** <br> "auto"
wrap_attributes_indent_size | HTML | [Boolean] **Indent wrapped attributes to after N characters. Defaults to 'indent_size'.** <br> false
-unformatted | HTML | [Array&lt;String>] **List of tags that should not be reformatted.** <br> ["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", "small", "strike", "tt", "pre", "h1", "h2", "h3", "h4", "h5", "h6"]
+unformatted | HTML | [Array&lt;String>] **List of tags that should not be reformatted.** <br> ["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"]
+content_unformatted | HTML | [Array&lt;String>] List of tags who's content should not be reformatted<br>["pre"]
newline_between_rules | CSS | [Boolean] **Add a newline between CSS rules.** <br> false
selector_separator_newline | CSS | [Boolean] **Add a newline between multiple selectors.** <br> true
space_around_combinator | CSS | [Boolean] **Ensure space around selector separators (>+~).** <br> false
View
@@ -2,7 +2,7 @@
"name": "beautify",
"displayName": "beautify",
"description": "Beautify code in place for VS Code",
- "version": "0.6.2",
+ "version": "0.7.0",
"publisher": "HookyQR",
"engines": { "vscode": "^1.6.0" },
"categories": ["Other", "Languages", "Formatters"],
@@ -35,16 +35,6 @@
"type": "object",
"title": "Beautify config",
"properties": {
- "beautify.onSave": {
- "type": ["array"],
- "default": false,
- "description": "Use array to set indiviaul types to beautify: [\"js\", \"html\", \"css\"]. Requires \"editor.formatOnSave\" to be true.",
- "items": {
- "type": "string",
- "enum": ["js", "html", "css"],
- "description": "Set to beautify only provided types on save."
- }
- },
"beautify.language": {
"type": "object",
"description": "Link file types to the beautifier type",
View
@@ -3,7 +3,7 @@
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"definitions": {
- "coreProperties": {
+ "CHJProperties": {
"type": "object",
"properties": {
"indent_size": {
@@ -22,16 +22,21 @@
"type": "string",
"default": "\n"
},
- "indent_level": {
- "description": "Initial indentation level. [JS]",
- "type": "integer",
- "default": 0
- },
"indent_with_tabs": {
"description": "Indent with tabs, overrides 'indent_size' and 'indent_char' [JS,CSS,HTML]",
"type": "boolean",
"default": false
},
+ "end_with_newline": {
+ "description": "Ensure newline at end of file. [JS,CSS,HTML]",
+ "type": "boolean",
+ "default": false
+ }
+ }
+ },
+ "HJProperties": {
+ "type": "object",
+ "properties": {
"preserve_newlines": {
"description": "Preserve line-breaks. [JS,HTML]",
"type": "boolean",
@@ -42,79 +47,57 @@
"type": "integer",
"default": 10
},
- "space_in_paren": {
- "description": "Add padding spaces within parentheses, ie. f( a, b ). [JS]",
- "type": "boolean",
- "default": false
- },
- "space_in_empty_paren": {
- "description": "Leave space in empty parentheses, ie. f( ). [JS]",
- "type": "boolean",
- "default": false
- },
- "jslint_happy": {
- "description": "Enable jslint-stricter mode. (Forces 'space_after_anon_function') [JS]",
- "type": "boolean",
- "default": false
- },
- "space_after_anon_function": {
- "description": "Add a space before an anonymous function's parens, ie. function (). [JS]",
- "type": "boolean",
- "default": false
- },
"brace_style": {
"description": "[collapse-preserve-inline|collapse|expand|end-expand|none] [JS,HTML]",
"type": "string",
"default": "collapse",
"enum": ["collapse-preserve-inline", "collapse", "expand", "end-expand", "none"]
},
- "break_chained_methods": {
- "description": "Break chained method calls across subsequent lines. [JS]",
+ "wrap_line_length": {
+ "description": "Wrap lines at next opportunity after N characters. [JS,HTML]",
+ "type": "integer",
+ "default": 0
+ }
+ }
+ },
+ "CProperties": {
+ "type": "object",
+ "properties": {
+ "selector_separator_newline": {
+ "description": "Add a newline between multiple selectors. [CSS]",
"type": "boolean",
- "default": false
+ "default": true
},
- "keep_array_indentation": {
- "description": "Preserve array indentation. [JS]",
+ "newline_between_rules": {
+ "description": "Add a newline between CSS rules. [CSS]",
"type": "boolean",
"default": false
},
- "keep_function_indentation": {
- "description": "Preserve function indentation. [JS]",
+ "space_around_selector_separator": {
+ "description": "(Deprecated: use space_around_combinator) [CSS]",
"type": "boolean",
"default": false
},
- "space_before_conditional": {
- "description": "Ensure a space before conditional statement. [JS]",
- "type": "boolean",
- "default": true
- },
- "unescape_strings": {
- "description": "Decode printable characters encoded in xNN notation. [JS]",
+ "space_around_combinator": {
+ "description": "Ensure space around selector separators (>+~). [CSS]",
"type": "boolean",
"default": false
- },
- "wrap_line_length": {
- "description": "Wrap lines at next opportunity after N characters. [JS,HTML]",
- "type": "integer",
- "default": 0
- },
+ }
+ }
+ },
+ "HProperties": {
+ "type": "object",
+ "properties": {
"wrap_attributes": {
"description": "Wrap attributes to new lines. [HTML]",
"type": "string",
"default": "auto",
- "enum": [
- "auto", "force"
- ]
+ "enum": ["auto", "force", "force-align", "force-expand-multiline"]
},
"wrap_attributes_indent_size": {
"description": "Indent wrapped attributes to after N characters. Defaults to 'indent_size'. [HTML]",
"type": "number"
},
- "end_with_newline": {
- "description": "Ensure newline at end of file. [JS,CSS,HTML]",
- "type": "boolean",
- "default": false
- },
"indent_inner_html": {
"description": "Indent <head> and <body> sections. [HTML]",
"type": "boolean",
@@ -136,7 +119,15 @@
"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", "small", "strike", "tt", "pre", "h1", "h2", "h3", "h4", "h5", "h6"]
+ "acronym", "address", "big", "dt", "ins", "strike", "tt"]
+ },
+ "content_unformatted": {
+ "description": "List of tags who's content should not be reformatted. [HTML]",
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "default": ["pre"]
},
"extra_liners": {
"description": "List of tags that should have an extra newline before them. [HTML]",
@@ -146,78 +137,124 @@
},
"default": ["head", "body", "/html"]
},
- "comma_first": {
- "description": "Put commas at the beginning of new line instead of end. [JS]",
+ "indent_body_inner_html": {
+ "description": "Indent elements within html <body> element. [HTML]",
+ "type": "boolean",
+ "default": true
+ },
+ "indent_head_inner_html": {
+ "description": "Indent elements within html <head> element. [HTML]",
+ "type": "boolean",
+ "default": true
+ },
+ "indent_handlebars": {
+ "description": "format and indent {{#foo}} and {{/foo}}. [HTML]",
"type": "boolean",
"default": false
+ }
+ }
+ },
+ "JProperties": {
+ "type": "object",
+ "properties": {
+ "indent_level": {
+ "description": "Initial indentation level. [JS]",
+ "type": "integer",
+ "default": 0
},
- "operator_position": {
- "description": "Move operators to before or after a new line, or keep as is. [JS]",
- "type": "string",
- "enum": ["before-newline", "after-newline", "preserve-newline"],
- "default": "before-newline"
+ "space_in_paren": {
+ "description": "Add padding spaces within parentheses, ie. f( a, b ). [JS]",
+ "type": "boolean",
+ "default": false
},
- "e4x": {
- "description": "Pass E4X xml literals through untouched. [JS]",
+ "space_in_empty_paren": {
+ "description": "Leave space in empty parentheses, ie. f( ). [JS]",
"type": "boolean",
"default": false
},
- "selector_separator_newline": {
- "description": "Add a newline between multiple selectors. [CSS]",
+ "jslint_happy": {
+ "description": "Enable jslint-stricter mode. (Forces 'space_after_anon_function') [JS]",
"type": "boolean",
- "default": true
+ "default": false
},
- "newline_between_rules": {
- "description": "Add a newline between CSS rules. [CSS]",
+ "space_after_anon_function": {
+ "description": "Add a space before an anonymous function's parens, ie. function (). [JS]",
"type": "boolean",
"default": false
},
- "space_around_selector_separator": {
- "description": "Ensure space around selector separators (>+~). (Deprecated: use space_around_combinator) [CSS]",
+ "break_chained_methods": {
+ "description": "Break chained method calls across subsequent lines. [JS]",
"type": "boolean",
"default": false
},
- "space_around_combinator": {
- "description": "Ensure space around selector separators (>+~). [CSS]",
+ "keep_array_indentation": {
+ "description": "Preserve array indentation. [JS]",
"type": "boolean",
"default": false
},
- "indent_body_inner_html": {
- "description": "Indent elements within html <body> element. [HTML]",
+ "keep_function_indentation": {
+ "description": "Preserve function indentation. [JS]",
"type": "boolean",
- "default": true
+ "default": false
},
- "indent_head_inner_html": {
- "description": "Indent elements within html <head> element. [HTML]",
+ "space_before_conditional": {
+ "description": "Ensure a space before conditional statement. [JS]",
"type": "boolean",
"default": true
},
- "indent_handlebars": {
- "description": "format and indent {{#foo}} and {{/foo}}. [HTML]",
+ "unescape_strings": {
+ "description": "Decode printable characters encoded in xNN notation. [JS]",
+ "type": "boolean",
+ "default": false
+ },
+ "comma_first": {
+ "description": "Put commas at the beginning of new line instead of end. [JS]",
+ "type": "boolean",
+ "default": false
+ },
+ "operator_position": {
+ "description": "Move operators to before or after a new line, or keep as is. [JS]",
+ "type": "string",
+ "enum": ["before-newline", "after-newline", "preserve-newline"],
+ "default": "before-newline"
+ },
+ "e4x": {
+ "description": "Pass E4X xml literals through untouched. [JS]",
"type": "boolean",
"default": false
}
}
}
},
"allOf": [
+ { "$ref": "#/definitions/CHJProperties" },
+ { "$ref": "#/definitions/HJProperties" },
+ { "$ref": "#/definitions/CProperties" },
+ { "$ref": "#/definitions/HProperties" },
+ { "$ref": "#/definitions/JProperties" },
{
- "$ref": "#/definitions/coreProperties"
- }, {
"properties": {
"css": {
"type": "object",
- "$ref": "#/definitions/coreProperties"
+ "allOf": [
+ { "$ref": "#/definitions/CHJProperties" },
+ { "$ref": "#/definitions/CProperties" }]
},
"js": {
"type": "object",
- "$ref": "#/definitions/coreProperties"
+ "allOf": [
+ { "$ref": "#/definitions/CHJProperties" },
+ { "$ref": "#/definitions/HJProperties" },
+ { "$ref": "#/definitions/JProperties" }
+ ]
},
"html": {
"type": "object",
- "$ref": "#/definitions/coreProperties"
+ "allOf": [
+ { "$ref": "#/definitions/CHJProperties" },
+ { "$ref": "#/definitions/HJProperties" },
+ { "$ref": "#/definitions/HProperties" }]
}
}
- }
- ]
+ }]
}

0 comments on commit 8907e92

Please sign in to comment.