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

Broken private fields in classes (JS) #1734

Closed
MikeDombo opened this issue Dec 1, 2019 · 2 comments · Fixed by #1735
Closed

Broken private fields in classes (JS) #1734

MikeDombo opened this issue Dec 1, 2019 · 2 comments · Fixed by #1735

Comments

@MikeDombo
Copy link
Contributor

MikeDombo commented Dec 1, 2019

Description

Private fields in JS classes use # as part of the identifier name. When beautifying the initial declaration, this library puts it on the wrong line.

Input

The code looked like this before beautification:

class X {
    #__private = null;
}

Expected Output

The code should have looked like this after beautification:

class X {
    #__private = null;
}

Actual Output

The code actually looked like this after beautification:

class X {
    #
    __private = null;
}

Steps to Reproduce

Environment

OS: Windows
Language: Python

Settings

Example:

{
    "indent_size": 4,
    "indent_char": " ",
    "indent_level": 0,
    "indent_with_tabs": false,
    "preserve_newlines": true,
    "max_preserve_newlines": 2,
    "jslint_happy": false,
    "space_after_anon_function": false,
    "brace_style": "collapse,preserve-inline",
    "keep_array_indentation": false,
    "keep_function_indentation": false,
    "space_before_conditional": true,
    "break_chained_methods": false,
    "eval_code": false,
    "unescape_strings": false,
    "wrap_line_length": 0
}
@appleinautumn
Copy link

So what's the solution for this?

@MikeDombo
Copy link
Contributor Author

PR #1735 fixed it and it is released.

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