Skip to main content

object-curly-spacing

Enforce consistent spacing inside braces.

Attributes

  • Included in configs
    • ✅ Recommended
    • 🔒 Strict
  • Fixable
    • 🔧 Automated Fixer
    • 💡 Suggestion Fixer
  • 💭 Requires type information

Rule Details

This rule extends the base eslint/object-curly-spacing rule. It adds support for TypeScript's object types.

How to Use

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

Options

See eslint/object-curly-spacing options.

Taken with ❤️ from ESLint core

Resources