Skip to content

Latest commit

 

History

History
62 lines (47 loc) · 771 Bytes

complex-expression-spacing.md

File metadata and controls

62 lines (47 loc) · 771 Bytes

complex-expression-spacing

Enforces a surrounding line break in complex expression.

How to use

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

Examples

These are examples of how the rule might apply.

❌ Incorrect

list.filter(item => (item.name === 'foo'
? true
: false));

```js
if (item.name === 'foo'
|| item.name === 'bar') {
  return true;
}

✅ Correct

list.filter(
    item => (
        item.name === 'foo'
            ? true
            : false
    )
);
if (
    item.name === 'foo'
    || item.name === 'bar'
) {
    return true;
}

Options

This rule has no configuration options.

Attributes

  • ✅ Recommended
  • 🔧 Fixable
  • 💭 Requires type information