Skip to content

Latest commit

 

History

History
83 lines (63 loc) · 1.36 KB

func-arg-line-breaks.md

File metadata and controls

83 lines (63 loc) · 1.36 KB

enforce line breaks in destructured imports (func-arg-line-breaks)

🔧 The --fix option on the command line can automatically fix some of the problems reported by this rule.

Rule Details

We want to enforce line breaks between all call expression arguments if any arguments are split by a line break. If any arguments are divided by line breaks, we also enforce a break after the opening paren ( and the closing paren ).

Options

This rule has no options.

Examples

👎 Examples of incorrect code for this rule:

// eslint func-arg-line-breaks: ["error"]
func(
  a, b
);
// eslint func-arg-line-breaks: ["error"]
func(a,
  b
);
// eslint func-arg-line-breaks: ["error"]
func(
  a,
  b);
// eslint func-arg-line-breaks: ["error"]
func(
  a, b,
  c
);
// eslint func-arg-line-breaks: ["error"]
func(
  a, b,
  c, d
);
// eslint func-arg-line-breaks: ["error"]
func(
  a, b,
  c, d()
);

👍 Examples of correct code for this rule:

// eslint func-arg-line-breaks: ["error"]
func(a, b);
// eslint func-arg-line-breaks: ["error"]
func(
  a,
  b
);

When Not To Use It

If you don't want to enforce line breaks in call expression arguments

Resouces