Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix comment-no-loud only catching first line
This changes the approach to looking up comments for the comment-no-loud rule. This rule had an issue where it would only identify comments if they were the first node within an SCSS file. Previously this check matched a regex against `source.input.css` of the comment node. `source.input.css` is actually the full input of the source file and not the input of the node (as I imagine was expected when this was initially authored). This meant that only comments that were not preceded by any other nodes matched the rule. The tests all succeeded for this as they all checked against the first node. This new approach instead takes the source input and splits into an array based on a `\n` separator. It then looks up the first line of the comment with `source.start.line` variable. This provides the first line of the comment input as was given in the source file. I did also try using `comment.toString()` as a simpler means to get the original source value, however this approach didn't provide an exact copy of the original input and instead converted SCSS comments (`//`) into CSS ones (`/*`) meaning that all SCSS comments were identified as loud.
- Loading branch information