Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scss/comment-no-empty false positive on paragraph breaks in multi-line double-slash comments #606

Open
dbjorge opened this issue May 16, 2022 · 0 comments

Comments

@dbjorge
Copy link

dbjorge commented May 16, 2022

Comments like this:

// First paragraph of a long comment
//
// Second paragraph
.some-rule { /* ... */ }

...trigger a false positive from scss/comment-no-empty on the blank line within the comment acting as a paragraph break. Here is an example accept test case that can be added to /src/rules/comment-no-empty/__tests__/index.js which demonstrates the issue:

    {
      code: "// comment\n//\n// comment",
      description: "Multiline double slash comment with paragraph break"
    },
  ● scss/comment-no-empty › accept › [ true ] › '// comment\n//\n// comment' › Multiline double slash comment with paragraph break

    expect(received).toEqual(expected) // deep equality

    - Expected  - 1
    + Received  + 9

    - Array []
    + Array [
    +   Object {
    +     "column": 1,
    +     "line": 2,
    +     "rule": "scss/comment-no-empty",
    +     "severity": "error",
    +     "text": "Unexpected empty comment (scss/comment-no-empty)",
    +   },
    + ]

      at Object.<anonymous> (node_modules/jest-preset-stylelint/getTestRule.js:61:41)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant