Skip to content

toml/inline-table-curly-newline ​

enforce linebreaks after opening and before closing 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 line breaks after opening and before closing braces of TOML inline tables. It is analogous to ESLint's object-curly-newline but for TOML inline tables (multiline inline table syntax is available in TOML v1.1+).

Note: The rule is skipped when the parser's TOML version is v1.0 because multiline inline tables are not available in that version.

Now loading...

🔧 Options ​

yaml
toml/inline-table-curly-newline:
  - error
  - always # or "never"
  # or an object
  # - multiline: false
  #   minProperties: 2
  #   consistent: true
  • "always" ... require line breaks after { and before }.
  • "never" ... disallow line breaks after { and before }.
  • object option
    • multiline ... true requires line breaks if there are line breaks inside properties or between properties. Otherwise, it disallows line breaks.
    • minProperties ... requires line breaks if the number of properties is at least the given integer. By default, an error will also be reported if an object contains linebreaks and has fewer properties than the given integer. However, the second behavior is disabled if the consistent option is set to true.
    • consistent ... true (default) requires that either both curly braces, or neither, directly enclose newlines. Note that enabling this option will also change the behavior of the minProperties option. (See minProperties above for more information)

🚀 Version ​

This rule was introduced in eslint-plugin-toml v1.3.0

🔍 Implementation ​

Taken with ❤️ from ESLint core