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

Fix support for *-empty-line-before in HTML #2854

Merged
merged 7 commits into from Sep 12, 2017

Conversation

gucong3000
Copy link
Member

Which issue, if any, is this issue related to?

#2853

Is there anything in the PR that needs further explanation?

"No, it's self explanatory."

@@ -59,7 +59,7 @@ const rule = function(expectation, options, context) {
const isNested = atRule.parent !== root;

// Ignore the first node
if (atRule === root.first) {
if (atRule === root.first || atRule === atRule.root().first) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add comment around atRule === atRule.root().first and good work!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@gucong3000 gucong3000 changed the title Closes #2853 fix support for *-empty-line-before in HTML Sep 7, 2017
Copy link
Member

@jeddy3 jeddy3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gucong3000 Thanks - tests look great. I've made a request out creating a util.

@@ -51,8 +51,12 @@ const rule = function(expectation, options, context) {
return;
}

// Ignore the first node
if (rule === root.first) {
if (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we please move this into a util, e.g. isFirstNodeOfRoot(node) as I suspect other rules will need too.

@jeddy3 jeddy3 changed the title fix support for *-empty-line-before in HTML Fix support for *-empty-line-before in HTML Sep 10, 2017
Copy link
Member

@jeddy3 jeddy3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gucong3000 Thanks for making the util change. I've added one query.

@@ -52,7 +53,7 @@ const rule = function(expectation, options, context) {
}

// Ignore the first node
if (rule === root.first) {
if (isFirstNodeOfRoot(rule, root)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean to pass root in as a second parameter?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was a mistake.

Copy link
Member

@ntwb ntwb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Copy link
Member

@jeddy3 jeddy3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jeddy3 jeddy3 merged commit 79f3c33 into stylelint:master Sep 12, 2017
@jeddy3
Copy link
Member

jeddy3 commented Sep 12, 2017

  • Fixed: *-empty-line-before false positives for CSS in HTML (#2854).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants