Enforces a surrounding line break before and after the argument list in multiline functional calls.
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.
{
"@croct/argument-spacing": ["error"]
}
These are examples of how the rule might apply.
call(1,
2);
list.filter(item => matches(
item.name,
item.constructor
));
useEffect(() => {
console.log(`Hello, ${name}!`);
}, []);
call(
1,
2,
);
list.filter(
item => matches(
item.name,
item.constructor
)
);
useEffect(
() => {
console.log(`Hello, ${name}!`);
},
[],
);
it('should work', () => {
expect(everythingsFine()).toBe(true);
});
This rule has no configuration options.
- ✅ Recommended
- 🔧 Fixable
- 💭 Requires type information