Skip to content

toml/inline-table-curly-spacing

enforce consistent spacing inside braces

  • ⚙️ This rule is included in "configs.standard".
  • 🔧 The --fix option 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 inline tables.

Now loading...

🔧 Options

yaml
toml/inline-table-curly-spacing:
  - error
  - always # or "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 inline tables beginning and/or ending with an array element.
      • true requires spacing inside of braces of inline tables beginning and/or ending with an array element (applies when the first option is set to never)
      • false disallows spacing inside of braces of inline tables beginning and/or ending with an array element (applies when the first option is set to always)
    • "objectsInObjects" control spacing inside of braces of inline tables beginning and/or ending with an inline table element.
      • true requires spacing inside of braces of inline tables beginning and/or ending with an inline table element (applies when the first option is set to never)
      • false disallows spacing inside of braces of inline tables beginning and/or ending with an inline table element (applies when the first option is set to always)
    • "emptyObjects" control spacing within empty inline tables.
      • "ignore"(default) do not check spacing in empty inline tables.
      • "always" require a space in empty inline tables.
      • "never" disallow spaces in empty inline tables.

These options are almost identical to those of the @stylistic/object-curly-spacing rule. See here for details.

🚀 Version

This rule was introduced in eslint-plugin-toml v0.1.0

🔍 Implementation

Taken with ❤️ from ESLint core