Search code examples
gulpbourbonneatstylelint

How to blacklist usage of specific mixins in stylelint?


I am using gulp-stylelint with the stylelint-scss plugin to lint the .scss-files in our project. As we are using autoprefixer, I want the linting to fail if bourbon neat mixins that only add vendor-prefixes are used, for example, something like this @include opacity(0.4);

Is there a possibility to blacklist specific mixins? Or is there any other possibility to make the build fail if those mixins are used in .scss-files? Thanks!


Solution

  • There is currently no way to do this with the existing stylelint/stylelint-scss rules and plugins.

    However, stylelint is extendable. As this is a very specific use case, it's the perfect candidate for such a custom stylelint plugin. There is a guide on the stylelint website to how to write one.