Skip to content

formatting does not work if it ends with a function call #7961

@nilsbuehrer

Description

@nilsbuehrer

Prettier 2.0.3
Playground link

# Options (if any):
  "printWidth": 80,
  "tabWidth": 2,
  "useTabs": false,
  "bracketSpacing": false,
  "singleQuote": true,
  "trailingComma": "es5"

Input:

// works as expected
something.veeeeeery.looooooooooooooooooooooooooong = some.other.rather.long.chain;

// does not work if it ends with a function call
something.veeeeeery.looooooooooooooooooooooooooong = some.other.rather.long.chain.functionCall();

Output:

// works as expected
something.veeeeeery.looooooooooooooooooooooooooong =
  some.other.rather.long.chain;

// does not work if it ends with a function call
something.veeeeeery.looooooooooooooooooooooooooong = some.other.rather.long.chain.functionCall();

Expected behavior:

// should break after '=' and before function call.
something.veeeeeery.looooooooooooooooooooooooooong =
  some.other.rather.long.chain.functionCall();

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions