Skip to content

Latest commit

 

History

History
83 lines (63 loc) · 1.16 KB

argument-spacing.md

File metadata and controls

83 lines (63 loc) · 1.16 KB

argument-spacing

Enforces a surrounding line break before and after the argument list in multiline functional calls.

Rule details

This rule complements the eslint/function-call-argument-newline to enforce multiline arguments to have a new line before and after the first and last argument, respectively.

How to use

{
  "@croct/argument-spacing": ["error"]
}

Examples

These are examples of how the rule might apply.

❌ Incorrect

call(1,
    2);
list.filter(item => matches(
    item.name,
    item.constructor
));
useEffect(() => {
  console.log(`Hello, ${name}!`);
}, []);

✅ Correct

call(
    1,
    2,
);
list.filter(
    item => matches(
        item.name,
        item.constructor
    )
);
useEffect(
    () => {
        console.log(`Hello, ${name}!`);
    },
    [],
);
it('should work', () => {
    expect(everythingsFine()).toBe(true);
});

Options

This rule has no configuration options.

Attributes

  • ✅ Recommended
  • 🔧 Fixable
  • 💭 Requires type information