Skip to content
This repository has been archived by the owner on Feb 21, 2022. It is now read-only.

Latest commit

 

History

History
56 lines (45 loc) · 1.98 KB

objectCurlySpacingRule.md

File metadata and controls

56 lines (45 loc) · 1.98 KB

object-curly-spacing (ESLint: object-curly-spacing)

rule_source test_source

require or disallow padding inside curly braces

Config

This rule takes one optional argument, an object which may include any of the following properties:

  • "arraysInObjects" (default true if rule is set to "always", otherwise default false) When set to true, this option requires a space inside of braces ending with an array literal. When set to false, this option requires no space inside of braces ending with an array literal.
  • "objectsInObjects" (default true if rule is set to "always", otherwise default false) When set to true, this option requires a space inside of braces ending with an object literal, or object destructuring. When set to false, this option requires no space inside of braces ending with an object literal, or object destructuring.

Examples

"object-curly-spacing": [true, "always"]
"object-curly-spacing": [true, "never"]
"object-curly-spacing": [true, "always", {"arraysInObjects": false, "objectsInObjects": false}]

Schema

{
  "type": "array",
  "items": [
    {
      "type": "object",
      "properties": {
        "arraysInObjects": {
          "type": "boolean"
        },
        "objectsInObjects": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    }
  ],
  "maxLength": 1
}