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:

grunt-jsbeautifier@0.2.10 node_modules/grunt-jsbeautifier
├── semver@5.1.0
├── rc@1.1.6 (ini@1.3.4, strip-json-comments@1.0.4, deep-extend@0.4.1, minimist@1.2.0)
├── underscore.string@3.2.3
└── lodash@4.0.1

js-beautify@1.6.0 node_modules/js-beautify
├── config-chain@1.1.10 (ini@1.3.4, proto-list@1.2.4)
├── nopt@3.0.6 (abbrev@1.0.7)
└── mkdirp@0.5.1 (minimist@0.0.8)

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