Skip to content

Force break conditional when if test breaks #868

@vjeux

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    locked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.status:needs discussionIssues needing discussion and a decision to be made before action can be taken

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions