sassgulp-sassstylelint

How to satisfy stylelint "context" check, without causing gullp errors?


My code:

@media (min-width: 965px) {
    #my-class {
        justify-content: flex-end;
    }
}

is causing stylelint to throw this error:

✖  Expected "context" media feature      media-feature-range-notation
             range notation

I tried their suggestion:

 @media (width >= 965px) {

but it just causes gulp to throw this error:

Error: unclosed parenthesis in media query expression

Solution

  • Queries like

    @media (min-width: 965px) {
    

    are an older method.

    @media (width >= 965px) {
    

    is the newer way to specify the same query. Our code base was still requiring node-sass, which is no longer supported. Updating our gulpfile.js to use "sass" instead of "node-sass" seemed to resolve the gulp error.