jsonc/object-curly-spacing
enforce consistent spacing inside braces
- 🔧 The
--fixoption on the command line can automatically fix some of the problems reported by this rule.
📖 Rule Details
This rule enforces consistent spacing inside braces of object literals.
🔧 Options
json
{
"jsonc/object-curly-spacing": ["error",
"never",
{
"arraysInObjects": false,
"objectsInObjects": false,
"emptyObjects": "ignore"
}
]
}This rule has two options, a string option and an object option.
First option:
"never"(default) disallows spacing inside of braces"always"requires spacing inside of braces (except{})
Second option:
"arraysInObjects"control spacing inside of braces of objects beginning and/or ending with an array element.truerequires spacing inside of braces of objects beginning and/or ending with an array element (applies when the first option is set tonever)falsedisallows spacing inside of braces of objects beginning and/or ending with an array element (applies when the first option is set toalways)
"objectsInObjects"control spacing inside of braces of objects beginning and/or ending with an object element.truerequires spacing inside of braces of objects beginning and/or ending with an object element (applies when the first option is set tonever)falsedisallows spacing inside of braces of objects beginning and/or ending with an object element (applies when the first option is set toalways)
"emptyObjects"control spacing within empty objects."ignore"(default) do not check spacing in empty objects."always"require a space in empty objects."never"disallow spaces in empty objects.
These options are almost identical to those of the @stylistic/object-curly-spacing rule. See here for details.
👫 Related rules
🚀 Version
This rule was introduced in eslint-plugin-jsonc v0.1.0
🔍 Implementation
Taken with ❤️ from ESLint core