Open bobbygryzynger opened 7 years ago
I have the same problem but inside of the sass-lint.yaml file
I'm experiencing the same issue in both yaml-file and javascript-code. I already browsed the original code and played with thewarningCount
-variable. It seems that it is possible to create a failOnError
-like function which exits when reaching a certain amount of warnings. I don't want to customize the plugin, though... I'd really appreciate a solution for this problem!
I am using version 1.3.2
aswell
This may be due to the fact that sass-lint implementation may utilize the --verbose
flag which will not fail on max-warnings
but it's just a guess
I unwillingly went for another workaround. I put a custom function in the gulp-pipe, in which I can access the original lint-file, which is generated via sass-lint, and exit the task if a certain warningCount
is reached. My function also accessses the config-file, so it might be the best way until the plugin gets fixed.
...I'm at home right now and have no access to the code, but I'll post my (hacky?) solution on monday.
@Kyriou Did you dig out your solution? I've been trying a few things like grep'ing the sassLint.format() but it feels incredibly hacky
Totally forgot about that, sorry. This is my (hacky) solution. I referenced this function via .pipe(xyz)
in the respective gulp task.
Actually I can't recall how exactly this works. As far as I remember I copied this from the failOnError-function of the original sass-lint-plugin. Not sure, though.
It's not the cleanest solution, but it works. I'm open for better and cleaner solutions.
I opted to just use exec in the end. Until something like #72 is merged it does the job
gulp.task('sass-lint', function(cb) {
exec('sass-lint -v', function(err, stdout) {
if (stdout) {
gutil.log(stdout);
}
cb(shouldItExit ? err : 0);
});
});
Running the following code does not result in an error as expected:
In the console, the task finishes without errors, despite the following output:
I am using version:
1.3.2
.