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

Inconsistent formatting for arrays of objects #860

Closed
lzilioli opened this issue Jan 29, 2016 · 1 comment
Closed

Inconsistent formatting for arrays of objects #860

lzilioli opened this issue Jan 29, 2016 · 1 comment
Milestone

Comments

@lzilioli
Copy link

This is our .jsbeautifyrc, if that helps. We are using grunt-jsbeautifier

{
    "js": {
        "jslint_happy": true,
        "indent_with_tabs": true,
        "space_in_paren": true
    }
}

Our package.json:

$ cat package.json | grep beaut
45:    "grunt-jsbeautifier": "^0.2.8",
58:    "js-beautify": "^1.5.7",

npm install output:

Example.js

{
    files: [ {
        expand: true,
        cwd: 'www/gui/',
        src: [ 'im/design_standards/*.*' ],
        dest: 'www/gui/build'
    } ]
}

1.6.0 tries to change it to: (note it removes the space at the start of the array, but keeps the space at the end of the array.

{
    files: [{
        expand: true,
        cwd: 'www/gui/',
        src: [ 'im/design_standards/*.*' ],
        dest: 'www/gui/build'
    } ]
}
@lzilioli lzilioli changed the title Inconsistent formatting for array of objects Inconsistent formatting for array of objects in 1.6.0 Jan 29, 2016
@bitwiseman bitwiseman changed the title Inconsistent formatting for array of objects in 1.6.0 Inconsistent formatting for arrays of objects with space_in_paren=true Jan 29, 2016
@bitwiseman bitwiseman changed the title Inconsistent formatting for arrays of objects with space_in_paren=true Inconsistent formatting for arrays of objects Jan 29, 2016
@bitwiseman
Copy link
Member

The space_in_paren is the key setting. Thanks for the detailed bug report.

@bitwiseman bitwiseman added this to the 1.6.1 milestone Jan 29, 2016
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