Enforces a surrounding line break in complex expression.
{
"@croct/complex-expression-spacing": ["error"]
}
These are examples of how the rule might apply.
list.filter(item => (item.name === 'foo'
? true
: false));
```js
if (item.name === 'foo'
|| item.name === 'bar') {
return true;
}
list.filter(
item => (
item.name === 'foo'
? true
: false
)
);
if (
item.name === 'foo'
|| item.name === 'bar'
) {
return true;
}
This rule has no configuration options.
- ✅ Recommended
- 🔧 Fixable
- 💭 Requires type information