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

Negative numbers removes newlines in arrays #1288

Closed
hacker112 opened this issue Nov 13, 2017 · 2 comments
Closed

Negative numbers removes newlines in arrays #1288

hacker112 opened this issue Nov 13, 2017 · 2 comments

Comments

@hacker112
Copy link

Description

This is the default template for bug reports, if you have a more general
issue, question, or request, you may ignore this template and write freeform.

NOTE:

  • Do not include screenshots! This library is a text processor, we need text inputs and outputs for debugging and fixing issues.
  • Check the list of open issues before filing a new issue.

Input

The code looked like this before beautification:

var array = [
    -1,
    0,
    'a',
    -2,
    1,
    -3,
];

Expected Output

The code should have looked like this after beautification:

var array = [
    -1,
    0,
    'a',
    -2,
    1,
    -3,
];

Actual Output

The code actually looked like this after beautification:

var array = [-1,
    0,
    'a', -2,
    1, -3,
];

Steps to Reproduce

Run js-beautify version 1.7.4

Environment

OS: Mac OS X

Settings

Example:

{
    "css": {
        "end_with_newline": true,
        "eol": "\n",
        "indent_char": " ",
        "indent_size": 4,
        "newline_between_rules": true,
        "selector_separator_newline": true,
        "space_around_combinator": true
    },
    "html": {
        "end_with_newline": true,
        "eol": "\n",
        "indent_char": " ",
        "indent_level": 0,
        "indent_size": 4,
        "indent_with_tabs": false,
        "preserve_newlines": true,
        "wrap_attributes": "force-aligned"
    },
    "js": {
        "brace_style": "collapse",
        "break_chained_methods": false,
        "comma_first": false,
        "end_with_newline": true,
        "eol": "\n",
        "eval_code": false,
        "indent_char": " ",
        "indent_level": 0,
        "indent_size": 4,
        "indent_with_tabs": false,
        "jslint_happy": false,
        "keep_array_indentation": false,
        "keep_function_indentation": false,
        "max_preserve_newlines": 10,
        "operator_position": "before-newline",
        "preserve_newlines": true,
        "space_after_anon_function": true,
        "space_before_conditional": true,
        "space_in_empty_paren": false,
        "space_in_paren": false,
        "unescape_strings": false,
        "wrap_line_length": 0
    }
}
@bitwiseman
Copy link
Member

From #1288:

fn(
  1,
  !1,
  1,
  [1]
)

@bitwiseman
Copy link
Member

Also #1229

@bitwiseman bitwiseman modified the milestones: v1.8.x, 1.8.0-rc3 Jul 31, 2018
@bitwiseman bitwiseman modified the milestones: 1.8.0-rc4, 1.8.0 Aug 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants