Skip to content
New issue

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

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

Already on GitHub? # to your account

sass-lint complains about mixins calls #1305

Open
pisandelli opened this issue Apr 27, 2020 · 5 comments
Open

sass-lint complains about mixins calls #1305

pisandelli opened this issue Apr 27, 2020 · 5 comments

Comments

@pisandelli
Copy link

What version of Sass Lint are you using?
1.13.1

Please include any relevant parts of your configuration

"devDependencies": {
    "gulp-sass": "^4.0.2",
    "sass": "^1.26.3",
    "sass-lint": "^1.13.1"
}

What did you do? Please include the actual source code causing the issue.

@use '../layout/grid' as grid
.main-container
  +grid.row($direction: row)
  //@include grid.row($direction: row) //same error

What did you expect to happen?
No errors

What actually happened? Please include any error messages given to you by Sass Lint.
Please check validity of the block starting from line #3sass-lint(Fatal)

The code compiles, but the error is very annoying. Am I doing something wrong?

@pisandelli pisandelli changed the title sass-lint complains about mixins sass-lint complains about mixins calls Apr 27, 2020
@TheJaredWilcurt
Copy link

For the time being, you can try this:

@use '../layout/grid' as grid

// sass-lint:disable indentation

.main-container
  +grid.row($direction: row)

// sass-lint:enable indentation

@pisandelli
Copy link
Author

Sorry by the late response @TheJaredWilcurt.
Thank you for your time, but your solution didn't work.. :(

@TheJaredWilcurt
Copy link

it may be a different rule for you then that is triggering the block validity error. If you know what it is you can change indentation in the example to the other rule. You could also try removing the indentation but that will disable all rules, which probably is not desired.

@rahil-p
Copy link

rahil-p commented Jun 20, 2020

This issue occurs, in my case at least, whenever I reference a namespace for any module loaded with @use. It seems like the current version of Sass Lint (1.13.1) cannot handle references that use namespaces.

The only fix that has worked for me is reverting to @import, although it's not really an appropriate fix. Hoping to find a patch, because reverting to the deprecated @import to concur with Sass Lint would be counterproductive. After all, support for @import is planned to be completely dropped in the next couple of years.

Edit: It's worth noting that the @use syntax was introduced in October 2019, several months after the most recent update of Sass Lint; it probs makes sense that Sass Lint doesn't know what to do it runs across the period following a namespace. 😕

@rahil-p
Copy link

rahil-p commented Jun 20, 2020

Another patch I just realized is loading with @use 'path/to/module' as *, which will allow you to import the module's contents without the namespace. This might have more longevity, but it's still a dirty fix in my opinion since it drops namespace usage.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants