Skip to content

toml/spaced-comment

enforce consistent spacing after the # in a comment

  • ⚙️ This rule is included in "plugin:toml/standard".
  • 🔧 The --fix option on the command line can automatically fix some of the problems reported by this rule.

📖 Rule Details

This rule will enforce consistency of spacing after the start of a comment #. It also provides several exceptions for various documentation styles.

Now loading...

🔧 Options

yaml
toml/spaced-comment:
  - error
  - always # or "never"
  - exceptions: []
    markers: []
  • First option
    • "always" ... the # must be followed by at least one whitespace.
    • "never" ... should be no whitespace following.
  • Second option
    • "exceptions" ... It is an array of string patterns which are considered exceptions to the rule. The rule will not warn when the pattern starts from the beginning of the comment and repeats until the end of the line. Please note that exceptions are ignored if the first argument is "never".
    • "markers" ... It is an array of string patterns which are considered markers for docblock-style comments. The "markers" array will apply regardless of the value of the first argument, e.g. "always" or "never".

See also here.

🚀 Version

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

🔍 Implementation

Taken with ❤️ from ESLint core