-
-
Notifications
You must be signed in to change notification settings - Fork 930
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
Fix false positives for selector lists and shared-line comments in comment-empty-line-before #2835
Labels
Comments
Here's a couple of failing tests that should pass: diff --git lib/rules/comment-empty-line-before/__tests__/index.js lib/rules/comment-empty-line-before/__tests__/index.js
index be684390..3b867c25 100644
--- lib/rules/comment-empty-line-before/__tests__/index.js
+++ lib/rules/comment-empty-line-before/__tests__/index.js
@@ -76,6 +76,10 @@ testRule(
{
code: "a {\n\n /* comment */\n color: pink;\n}",
description: "first-nested with empty line before"
+ },
+ {
+ code: "a {\n /* comment */\n color: pink;\n}",
+ description: "shared-line comment should be ignored"
}
],
@@ -147,6 +151,10 @@ testRule(
code:
"a {\ncolor: pink;\n/* stylelint-disable something */\ntop: 0;\n}",
description: "no newline before a stylelint command comment"
+ },
+ {
+ code: "a {\n /* comment */\n color: pink;\n}",
+ description: "shared-line comment should be ignored"
}
]
}) |
jeddy3
added
status: needs discussion
triage needs further discussion
and removed
type: bug
a problem with a feature or rule
labels
Sep 2, 2017
jeddy3
changed the title
Multiple shared-line comments
False positives for multiple shared-line comments in comment-empty-line-before
Sep 2, 2017
comment-empty-line-before
issue
Will this be fixed by #2827? Neither of the additional tests above contain shared-line comments. So, I'm not sure those tests should pass. |
I can replicate this with The following: any selector,
.bar { /* comment */
color: pink;
} Will produce a violation:
Whereas the following two produce no violations: .bar { /* comment */
color: pink;
} any rule { }
.bar { /* comment */
color: pink;
} |
jeddy3
changed the title
False positives for multiple shared-line comments in comment-empty-line-before
Fix false positives for selector lists and shared-line comments in comment-empty-line-before
Sep 9, 2017
jeddy3
added
status: ready to implement
is ready to be worked on by someone
type: bug
a problem with a feature or rule
and removed
status: needs discussion
triage needs further discussion
labels
Sep 9, 2017
hudochenkov
added
status: wip
is being worked on by someone
and removed
status: ready to implement
is ready to be worked on by someone
labels
Oct 16, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A bug where multiple shared-line comments using the
comment-empty-line-before
rule returns false results.via https://github.com/stylelint/stylelint/tree/master/lib/rules/comment-empty-line-before
comment-empty-line-before
8.0.0
n/a
No
No warnings to be flagged.
The following warnings were flagged:
> test.css 8:8 ✖ Expected empty line before comment comment-empty-line-before
The text was updated successfully, but these errors were encountered: