Skip to content

Force break conditional when if test breaks #868

Closed

Description

@vjeux
if (this.hasPlugin("dynamicImports") && this.lookahead().type === tt.parenLeft) {
}

outputs

if (
  this.hasPlugin("dynamicImports") && this.lookahead().type === tt.parenLeft
) {
}

which is not very good looking. It would look better if it was displayed as

if (
  this.hasPlugin("dynamicImports") &&
  this.lookahead().type === tt.parenLeft
) {
}

https://prettier.github.io/prettier/#%7B%22content%22%3A%22if%20(this.hasPlugin(%5C%22dynamicImports%5C%22)%20%26%26%20this.lookahead().type%20%3D%3D%3D%20tt.parenLeft)%20%7B%5Cn%7D%5Cn%22%2C%22options%22%3A%7B%22printWidth%22%3A80%2C%22tabWidth%22%3A2%2C%22singleQuote%22%3Afalse%2C%22trailingComma%22%3A%22%22%2C%22bracketSpacing%22%3Atrue%2C%22jsxBracketSameLine%22%3Afalse%2C%22parser%22%3A%22%22%2C%22doc%22%3Afalse%7D%7D

Activity

  1. added
    status:needs discussion
    on Mar 3, 2017
  2. added a commit that references this issue on Apr 19, 2017
    025d92d
  3. added a commit that references this issue on Apr 19, 2017
    aafcf5f
  4. added
    locked-due-to-inactivity
    on Jul 7, 2018
  5. locked as resolved and limited conversation to collaborators on Jul 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    locked-due-to-inactivitystatus:needs discussion

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions