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

1283 - Javascript ++ Operator Gets Wrong Indentation #1384

Conversation

Elrendio
Copy link
Contributor

@Elrendio Elrendio commented May 5, 2018

Resolves #1283

What was done:

  • Adapted function print_newline to restore mode if last_test was operator ++ or --
  • Added corresponding test.

Example of behavior:

// == Input ==
{this.foo++
bar}

// == Expected Output ==
{
    this.foo++
    bar
}

@Elrendio Elrendio force-pushed the 1283-Javascript++OperatorGetsWrongIndentation branch from 1a31818 to a6f3ad9 Compare May 5, 2018 11:02
@Elrendio
Copy link
Contributor Author

Elrendio commented May 5, 2018

It's weird cause I didn't touch what codeclimate wants me to change...

Copy link
Member

@bitwiseman bitwiseman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Elrendio
This is great. Please include the minimal repro case from #1283 as an additional test.

@Elrendio Elrendio force-pushed the 1283-Javascript++OperatorGetsWrongIndentation branch from a031dc1 to 268064b Compare May 25, 2018 08:43
Resolves beautifier#1283

**What was done:**
 - Adapted function print_newline to restore mode if last_test was operator ++ or --
 - Added corresponding test.

**Example of behavior:**
== Input ==
{this.foo++
bar}

== Expexted Output ==
{
    this.foo++
    bar
}

== Unchanged ==
axios.interceptors.request.use(
    config => {
        // loading
        window.store.loading++
        let extraParams = {}
    }
)
@Elrendio Elrendio force-pushed the 1283-Javascript++OperatorGetsWrongIndentation branch from 268064b to d16b21a Compare May 25, 2018 08:45
@Elrendio
Copy link
Contributor Author

@bitwiseman done

@bitwiseman bitwiseman merged commit 5374db4 into beautifier:master Jun 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants