Open martinkruusement opened 9 months ago
Thank you for posting this issue!
In order to make the YAML comment work as an ESLint comment directive, the parser builds the AST by treating the YAML comment as a block comment (/* ... */
). Therefore, the option seems to have no effect because the rule interprets # foo
as /* foo */
.
To avoid this we need to add a new yml/no-trailing-spaces
rule to this plugin.
Switching between
error
andwarn
always gives expected message types, butignoreComments
is always treated as false even if it's set to true in root rules or in the override.This only happens in YAML files - ignoring trailing whitespace works in other files processed with other parsers.
Removing the rule from overrides still respects the root rule configuration, but will not ignore comments.
Full configuration below: