Skip to main content

space-infix-ops

Require spacing around infix operators.

This rule extends the base eslint/space-infix-ops rule. It adds support for enum members.

Attributes

  • Included in configs
    • ✅ Recommended
    • 🔒 Strict
  • Fixable
    • 🔧 Automated Fixer
    • 💡 Suggestion Fixer
  • 💭 Requires type information
enum MyEnum {
KEY = 'value',
}

How to Use

.eslintrc.cjs
module.exports = {
// Note: you must disable the base rule as it can report incorrect errors
"space-infix-ops": "off",
"@typescript-eslint/space-infix-ops": "warn"
};

Options

See eslint/space-infix-ops options.

Taken with ❤️ from ESLint core

Resources