require a newline after each call in a method chain (newline-per-chained-call)

Chained method calls on a single line without line breaks are harder to read, so some developers place a newline character after each method call in the chain to make it more readable and easy to maintain.

Let’s look at the following perfectly valid (but single line) code.

d3.select("body").selectAll("p").data([4,8,15,16,23,42]).enter().append("p").text(function(d){return"I'm number "+d+"!";});

However, with appropriate new lines, it becomes easy to read and understand. Look at the same code written below with line breaks after each call.

d3.select("body").selectAll("p").data([4,8,15,16,23,42]).enter().append("p").text(function(d){return"I'm number "+d+"!";});

Another argument in favor of this style is that it improves the clarity of diffs when something in the method chain is changed: