Hi everyone, my team is using mehtod chaining with the first method call on the same line:
$timelineClientBuilder->setUserId($userId)
->setPagination(static::PER_PAGE_QUERY, $page)
->setEventType($eventType)
->setDateRange($startDate, $endDate);
but prettier outputs this like the following:
$timelineClientBuilder
->setUserId($userId)
->setPagination(static::PER_PAGE_QUERY, $page)
->setEventType($eventType)
->setDateRange($startDate, $endDate);
is there already a way to tells prettier to adopt the first formatting? Or is there a workaround for this? Thanks in advance
Bug, Thanks!
Example from js: Expected
Feel free PR with fix it.
@evilebottnawi the JS example you listed prints the same as our plugin?
@mgrip oh yes, it is not bug, sorry, tired
@bertuz it is expected behaviour
@bertuz you can use phpcs or other codemodes utils for it for your team. Each -> on new line looks better and easy to read
I agree prettier is formatting it correctly. Not a bug and not significant enough for an option. Method chaining should drop every action to new line including first. This is how DOM attributes are handled as well.
/close
Most helpful comment
I agree prettier is formatting it correctly. Not a bug and not significant enough for an option. Method chaining should drop every action to new line including first. This is how DOM attributes are handled as well.
/close