Skip to content

jsonc/space-unary-ops

disallow spaces after unary operators

  • ⚙️ This rule is included in all of "plugin:jsonc/recommended-with-json", "plugin:jsonc/recommended-with-json5" and "plugin:jsonc/recommended-with-jsonc".
  • 🔧 The --fix option on the command line can automatically fix some of the problems reported by this rule.

📖 Rule Details

This rule reports the space after the sign operator.

JSON, JSONC and JSON5 do not allow spaces after the sign.

/* eslint jsonc/space-unary-ops: 'error' */ { /* ✓ GOOD */ "GOOD": -42, /* ✗ BAD */ "BAD": - 42 }
Now loading...

🔧 Options

Nothing.

🚀 Version

This rule was introduced in eslint-plugin-jsonc v0.2.0

🔍 Implementation

Taken with ❤️ from ESLint core