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

JS "space_in_empty_paren" failing for class methods #1151

Closed
hobbeshunter opened this issue Mar 5, 2017 · 1 comment
Closed

JS "space_in_empty_paren" failing for class methods #1151

hobbeshunter opened this issue Mar 5, 2017 · 1 comment

Comments

@hobbeshunter
Copy link

Description

Js Beautify doesn't seem to mind "space_in_empty_paren" set to false when beautifying class methods.

Input and expected Output

import React, { Component } from 'react';

export default class Test extends Component {

    render() {
        return (
            <div>
                <h1>Test</h1>
            </div>
        );
    }

}

Actual Output

import React, { Component } from 'react';

export default class Test extends Component {

    render( ) {
        return (
            <div>
                <h1>Test</h1>
            </div>
        );
    }

}

There is a space inside the parens after render.

Steps to Reproduce

"space_in_paren": true,
"space_in_empty_paren": false,

Environment

OS: Ubuntu
I'm using Atom with atom-beautify 0.29.17 which uses version ^1.6.3 (according to it's package.json).

Settings

Example:

{
    "js": {
        "indent_level": 0,
        "end_with_newline": true,
        "indent_with_tabs": false,
        "preserve_newlines": true,
        "max_preserve_newlines": 2,
        "jslint_happy": true,
        "space_in_paren": true,
        "space_in_empty_paren": false,
        "space_after_anon_function": true,
        "brace_style": "collapse-preserve-inline",
        "break_chained_methods": false,
        "keep_array_indentation": false,
        "unescape_strings": false,
        "wrap_line_length": 0,
        "e4x": true,
        "comma_first": false,
        "operator_position": "before-newline",
        "eval_code": false,
        "space_before_conditional": true
    }
}
@HookyQR
Copy link
Contributor

HookyQR commented Mar 22, 2017

Can not replicate with v1.6.11. Log with atom-beautify, they need to update the included js-beautify version.

mhnaeem added a commit to mhnaeem/js-beautify that referenced this issue Apr 8, 2022
bitwiseman added a commit that referenced this issue Apr 8, 2022
…aren-class-methods

Adding some regression tests to confirm #1151
@bitwiseman bitwiseman added this to the v1.14.x milestone Apr 8, 2022
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

3 participants