Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add defaultOptions method to main beautifier #1584

Open
bitwiseman opened this issue Nov 1, 2018 · 2 comments
Open

Add defaultOptions method to main beautifier #1584

bitwiseman opened this issue Nov 1, 2018 · 2 comments

Comments

@bitwiseman
Copy link
Member

bitwiseman commented Nov 1, 2018

Description

Related to #1364. #1568 added a basic implementation for this.

We need to add beautify.defaultOptions() that:

  1. calls core Options constructor
  2. calls each of the child defaultOptions()
  3. removes the inherited settings and also the raw_options field

It should return something like what is shown below.

Finally, we should consider calling this method during the build to generate the .jsbeautifyrc file.

There should be one source of truth the settings for the project.

{
  "disabled": false,
  "eol": "auto",
  "end_with_newline": false,
  "indent_size": 4,
  "indent_char": " ",
  "indent_level": 0,
  "preserve_newlines": true,
  "max_preserve_newlines": 32786,
  "indent_with_tabs": false,
  "wrap_line_length": 0,
  "js": {
    "brace_preserve_inline": false,
    "brace_style": "collapse",
    "unindent_chained_methods": false,
    "break_chained_methods": false,
    "space_in_paren": false,
    "space_in_empty_paren": false,
    "jslint_happy": false,
    "space_after_anon_function": false,
    "space_after_named_function": false,
    "keep_array_indentation": false,
    "space_before_conditional": true,
    "unescape_strings": false,
    "e4x": false,
    "comma_first": false,
    "operator_position": "before-newline",
    "test_output_raw": false
  },
  "css": {
    "selector_separator_newline": true,
    "newline_between_rules": true,
    "space_around_combinator": false
  },
  "html": {
    "js": {},
    "css": {},
    "indent_inner_html": false,
    "indent_body_inner_html": true,
    "indent_head_inner_html": true,
    "indent_handlebars": true,
    "wrap_attributes": "auto",
    "wrap_attributes_indent_size": 4,
    "extra_liners": [
        "head",
        "body",
        "/html"
    ],
    "inline": [
      "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"
    ],
    "void_elements": [
      "area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "menuitem", "meta", "param", "source", "track", "wbr", "!doctype", "?xml", "?php", "?=", "basefont", "isindex"
    ],
    "unformatted": [],
    "content_unformatted": [
        "pre",
        "textarea"
    ],
    "indent_scripts": "normal"
  }
}
@Lakshmidurgagodasi
Copy link

I like to work on this can i get started

@Gitmuru
Copy link

Gitmuru commented Oct 13, 2024

will work on this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants