This rule will enforce consistency of spacing after the start of a comment #. It also provides several exceptions for various documentation styles.
Now loading...
ESLint core spaced-comment rule don't work well in YAML. Turn off that rule in YAML files and use yml/spaced-comment rule. Use the overrides setting to apply these only to YAML files:
"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".
yml/spaced-comment
"plugin:yml/standard"
.--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.ESLint core
spaced-comment
rule don't work well in YAML. Turn off that rule in YAML files and useyml/spaced-comment
rule.Use the
overrides
setting to apply these only to YAML files:🔧 Options
"always"
... the#
must be followed by at least one whitespace."never"
... should be no whitespace following."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.
👫 Related rules
🚀 Version
This rule was introduced in eslint-plugin-yml v0.1.0
🔍 Implementation
Taken with ❤️ from ESLint core