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

Don't indent binary operators #329

Merged
merged 1 commit into from
Dec 15, 2019
Merged

Don't indent binary operators #329

merged 1 commit into from
Dec 15, 2019

Conversation

jhaber
Copy link
Contributor

@jhaber jhaber commented Dec 11, 2019

Fixes #306

I was wondering whether this indentation is desirable for other binary operators, for example >, however I think it's better not to start creating heuristics for different binary operators. This also appears to match prettier-js behavior (example below)

Input:

function example() {
  const greater = someReallyLongExceptionallyUnbelievablyLongIntegerName > anotherReallyLongExceptionallyUnbelievablyLongIntegerName;
  const blah = "asldjoewimqwioemwqoiewoiqjeoiamdoimwqioejwqoimdasoidmoqwie" + "qweinaoidnoiqwneoiwqjeoiwqjoiasndoisamdoiqwmeiowqjoieoi" + "qwewhqenwoniosadjoienrmnmziojqoirjqwoeiqowewq";
}

Output:

function example() {
  const greater =
    someReallyLongExceptionallyUnbelievablyLongIntegerName >
    anotherReallyLongExceptionallyUnbelievablyLongIntegerName;
  const blah =
    "asldjoewimqwioemwqoiewoiqjeoiamdoimwqioejwqoimdasoidmoqwie" +
    "qweinaoidnoiqwneoiwqjeoiwqjoiasndoisamdoiqwmeiowqjoieoi" +
    "qwewhqenwoniosadjoienrmnmziojqoirjqwoeiqowewq";
}

Copy link
Contributor

@clementdessoude clementdessoude left a comment

Choose a reason for hiding this comment

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

Yes, you are right, the issue I fixed with the code you removed should have been fixed otherwise, and it is ok now I think!

@clementdessoude clementdessoude merged commit 0b01b9e into jhipster:master Dec 15, 2019
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.

Multiline string indentation
2 participants