Files
test-repo/changelog_unreleased/javascript/pr-7087.md
T
Georgii Dolzhykov 3c13329f4f fix indentation in ternaries nested in conditions of other ternaries (#7087)
* fix indentation in ternaries nested in conditions of other ternaries

* fix giant indent when tabWidth=4

* refactoring: remove breakNested as it was always true

* break between parens

* add changelog

* microfix

* fix TS conditional types

* Update pr-7087.md
2019-12-04 12:39:29 +03:00

914 B

Fix indentation in ternaries nested in conditions of other ternaries (#7087 by @thorn0)

// Input
const foo = (number % 10 >= 2 && (number % 100 < 10 || number % 100 >= 20) ?
kochabCooieGameOnOboleUnweave : annularCooeedSplicesWalksWayWay)
? anodyneCondosMalateOverateRetinol : averredBathersBoxroomBuggyNurl;

// Prettier stable
const foo = (number % 10 >= 2 && (number % 100 < 10 || number % 100 >= 20)
? kochabCooieGameOnOboleUnweave
: annularCooeedSplicesWalksWayWay)
  ? anodyneCondosMalateOverateRetinol
  : averredBathersBoxroomBuggyNurl;

// Prettier master
const foo = (
  number % 10 >= 2 && (number % 100 < 10 || number % 100 >= 20)
    ? kochabCooieGameOnOboleUnweave
    : annularCooeedSplicesWalksWayWay
)
  ? anodyneCondosMalateOverateRetinol
  : averredBathersBoxroomBuggyNurl;