Skip to content

Latest commit

 

History

History
27 lines (20 loc) · 537 Bytes

File metadata and controls

27 lines (20 loc) · 537 Bytes

consistent-chaining

Enforce consistent line breaks for chaining member access.

Rule Details

// 👎 bad
const foo1 = [].map(x => x + 'bar')
  .filter(Boolean)

const foo2 = []
  .map(x => x + 'bar').filter(Boolean)
// 👍 good
const foo1 = [].map(x => x + 'bar').filter(Boolean)

const foo2 = []
  .map(x => x + 'bar')
  .filter(Boolean)

It will check the newline style of the first property access and apply the same style to the rest of the chaining access.