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

Invalid warning on Mixins should come before declarations when having multiple includes #80

Closed
jjanssen opened this issue Sep 2, 2015 · 3 comments
Milestone

Comments

@jjanssen
Copy link

jjanssen commented Sep 2, 2015

I am currently working with sass-lint 1.1.0

When using multiple mixins within a selector the rule for 'Mixins should come before declarations' starts throwing invalid warnings when using 3 or more. In another scenario the prepending selector can also cause this issue to throw a warning.

I have setup this little scss file to reproduce this issue:

@mixin foo($content) {
    content: $content;
}

@mixin bar {
    background-color: red;
}

@mixin hello {
    border-radius: 3px;
}


.beverages {

    .coffee {
        width: 100px;
        height: 100px;
    }    

    .tea {
        @include foo('yo');
        @include bar;
        @include hello;
        display: block;
        width: 100px;
        height: 100px;
    }
}

This snippet throws the following warning through the CLI

scss/mixin.scss
  24:9  warning  Mixins should come before declarations  mixins-before-declarations

This doesn't occur in the following cases:

  1. When disabling the selector .coffee the warning is gone.
  2. When disabling @include hello;. The other includes do not make a difference.
@bgriffith bgriffith added the bug label Sep 2, 2015
DanPurdy added a commit to DanPurdy/sass-lint that referenced this issue Sep 3, 2015
DanPurdy added a commit to DanPurdy/sass-lint that referenced this issue Sep 3, 2015
* Added new tests to test the bug highlighted in sasstools#80
* Added new tests with specific excludes passed in
* Added BEM style notation to test for non standard rulesets
@DanPurdy
Copy link
Member

DanPurdy commented Sep 3, 2015

Thanks for this report/test case @jjanssen it made tracking the issue a lot easier. Hopefully fixed now, will just await review from the others.

@jjanssen
Copy link
Author

jjanssen commented Sep 3, 2015

No problem! Seemed you guys put a lot of effort in this package the past few weeks. So if I can help by narrowing down the use case then it makes it easier for everybody :)

bgriffith added a commit that referenced this issue Sep 4, 2015
Update mixin-before-declaration rule fix #80
@DanPurdy DanPurdy added this to the 1.2.0 milestone Sep 4, 2015
donabrams pushed a commit to donabrams/sass-lint that referenced this issue Nov 19, 2015
donabrams pushed a commit to donabrams/sass-lint that referenced this issue Nov 19, 2015
* Added new tests to test the bug highlighted in sasstools#80
* Added new tests with specific excludes passed in
* Added BEM style notation to test for non standard rulesets
donabrams pushed a commit to donabrams/sass-lint that referenced this issue Nov 19, 2015
@srowhani
Copy link
Member

🎉 This issue has been resolved in version 1.13.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

No branches or pull requests

4 participants