Gathering detailed insights and metrics for gulp-sass-lint
Gathering detailed insights and metrics for gulp-sass-lint
npm install gulp-sass-lint
Typescript
Module System
Node Version
NPM Version
68
Supply Chain
85.9
Quality
73.7
Maintenance
25
Vulnerability
95.6
License
JavaScript (84.86%)
CSS (15.14%)
Total Downloads
12,559,299
Last Day
3,332
Last Week
14,238
Last Month
65,567
Last Year
1,048,255
115 Stars
70 Commits
43 Forks
11 Watching
2 Branches
16 Contributors
Minified
Minified + Gzipped
Latest Version
1.4.0
Package Id
gulp-sass-lint@1.4.0
Size
4.83 kB
NPM Version
5.10.0
Node Version
8.7.0
Publised On
22 May 2018
Cumulative downloads
Total Downloads
Last day
-7.8%
3,332
Compared to previous day
Last week
-18.2%
14,238
Compared to previous week
Last month
-1.1%
65,567
Compared to previous month
Last year
-38.1%
1,048,255
Compared to previous year
3
1
npm install gulp-sass-lint --save-dev
gulpfile.js
1'use strict'; 2 3var gulp = require('gulp'), 4 sassLint = require('gulp-sass-lint'); 5 6gulp.task('default', function () { 7 return gulp.src('sass/**/*.s+(a|c)ss') 8 .pipe(sassLint()) 9 .pipe(sassLint.format()) 10 .pipe(sassLint.failOnError()) 11});
You can pass an object of options to configure gulp-sass-lint to your specific projects needs the options are listed below.
You can find out more about the specific SassLint options from the SassLint Documentation
1{ 2 options: { 3 formatter: 'stylish', 4 'merge-default-rules': false 5 } 6}
By default SassLint includes it's own configuration file, if you provide one it attempts to merge everything except for the files section below. If you pass options directly into the plugin they take precedence. The order can be visualised below with the SassLint config being the base.
options > config file > SassLint default included config
You can disable this behaviour by setting merge-default-rules
to false within the options.options
object that you pass to gulp-sass-lint
or you can include it in your config file options that you can pass into gulp-sass-lint
with options.configFile
.
More info and examples can be found within the SassLint docs
Type: Object
Within the files object you can specify a glob pattern as a string or an array of glob pattern for both the include
and ignore
options. Please note that your include option will currently be ignored as you should be passing the glob patterns / file paths to be linted directly to gulp gulp.src('sass/**/*.s+(a|c)ss')
. The ignore option however will still be respected if you'd rather specify them in your config rather than in the gulp.src
method.
1{ 2 files: { 3 include: '**/*.scss', // This will be ignored by gulp-sass-lint 4 ignore: 'test/**/*.scss' // This will still be respected and read 5 } 6}
Type: Object
You can define which rules you would like to use here and set a severity too. For more information see how to configure and also the SassLint rules
1{ 2 rules: { 3 'no-ids': 0, // Severity 0 (disabled) 4 'no-mergeable-selectors': 1, // Severity 1 (warning) 5 'hex-length': [ 6 2, // Severity 2 (error) 7 { 8 'style': 'long' 9 } 10 ] 11 } 12}
You can pass the path to a custom config file via the configFile
option. The path will be relative to where you're running gulp from.
1{ 2 configFile: 'app/config/.my-config.yml' 3}
The following highlights all of the above options in use
1 2'use strict'; 3 4var gulp = require('gulp'), 5 sassLint = require('gulp-sass-lint'); 6 7gulp.task('default', function () { 8 return gulp.src('sass/**/*.s+(a|c)ss') 9 .pipe(sassLint({ 10 options: { 11 formatter: 'stylish', 12 'merge-default-rules': false 13 }, 14 files: {ignore: '**/*.scss'}, 15 rules: { 16 'no-ids': 1, 17 'no-mergeable-selectors': 0 18 }, 19 configFile: 'config/other/.sass-lint.yml' 20 })) 21 .pipe(sassLint.format()) 22 .pipe(sassLint.failOnError()) 23}); 24
Formats the results dependent on your config file or the options you provided to the sassLint task above. The default format is stylish
but you can choose any of the others that SassLint provides, see the docs.
You can also choose to output to a file from within the options you provide or your config file. See the output-file docs
1gulp.task('lint_sass_jenkins', function () { 2 var file = fs.createWriteStream('reports/lint_sass.xml'); 3 var stream = gulp.src('public/sass/**/*.scss') 4 .pipe(sassLint({ 5 options: { 6 configFile: '.sass-lint.yml', 7 formatter: 'checkstyle' 8 } 9 })) 10 .pipe(sassLint.format(file)); 11 stream.on('finish', function() { 12 file.end(); 13 }); 14 return stream; 15});
Fails the task and emits a gulp error when all files have been linted if an error has been detected (rules set to severity 2).
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 7/17 approved changesets -- score normalized to 4
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More