juanfran / gulp-scss-lint Goto Github PK
View Code? Open in Web Editor NEWGulp plugin to lint scss files with `scss-lint`
Gulp plugin to lint scss files with `scss-lint`
If the directory your gulpfile resides in contains spaces in it's name then gulp-scss-lint fails to find index.js to run, outputting the following error:
stream.js:94
throw er; // Unhandled stream error in pipe.
^
Error in plugin '←[36mgulp-scss-lint←[39m'
Input file did not exist or was not readable
at D:\Projects\project with spaces\node_modules\gulp-scss-lint\src\index.js:63:32
at ChildProcess.exithandler (child_process.js:641:7)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:735:16)
at Socket. (child_process.js:948:11)
at Socket.EventEmitter.emit (events.js:95:17)
at Pipe.close (net.js:466:12)
If the directory is renamed to remove the spaces then gulp-scss-lint works. This is the only package that fails, all of the others resolve correctly.
I only had time to test this on Window 7, i'll run a test on OSX on Monday if needed.
I had misspelled the config filename, but the only error I received was
events.js:85
throw er; // Unhandled 'error' event
^
Error: Input file did not exist or was not readable
Would have saved me about an hour of digging had there been more details in the error message. Even the plugin name would be a good starting point for debugging.
I think you could update the README.md file to use the correct gem name : gem install scss_lint
Admins-MacBook-Pro:redesign-slot-fastcompany mbenin$ gulp scss-lint
[17:35:07] Requiring external module babel-core/register
[17:35:08] Using gulpfile ~/Projects/redesign-slot-fastcompany/gulpfile.babel.js
[17:35:08] Starting 'scss-lint'...
[17:35:08] Finished 'scss-lint' after 4.23 ms
events.js:72
throw er; // Unhandled 'error' event
^
Error: stdout maxBuffer exceeded.
at Socket.<anonymous> (child_process.js:678:13)
at Socket.EventEmitter.emit (events.js:95:17)
at Socket.<anonymous> (_stream_readable.js:746:14)
at Socket.EventEmitter.emit (events.js:92:17)
at emitReadable_ (_stream_readable.js:408:10)
at emitReadable (_stream_readable.js:404:5)
at readableAddChunk (_stream_readable.js:165:9)
at Socket.Readable.push (_stream_readable.js:127:10)
at Pipe.onread (net.js:526:21)
I'm trying to add gulp-scss-lint as before_prepare hook into cordova (build), but it does not work (quite) yet, since gulp-scss-lint returns with 0 on a lint error instead of 1 (or any other code).
var scss = require('gulp-scss-lint');
var gulp = require('gulp');
var paths = [
'./scss/**/*.scss'
];
gulp.task('lint', function() {
return gulp.src(paths)
.pipe(scss())
.pipe(scss.failReporter());
});
gulp.start('lint');
// The path for our ionicons font files, relative to the built CSS in www/css
$ionicons-font-path: '../lib/ionic/fonts' !default;
throwErrorHere
// Include all of Ionic
@import 'www/lib/ionic/scss/ionic';
$ node hooks/before_prepare/03_gulp-scss-lint.js && echo "Code: " $?
[13:01:22] 1 issues found in /home/hufschmt/Workspace/WebView/mILIAS/scss/ionic.app.scss
[13:01:22] ionic.app.scss:22 [E] Syntax Error: Invalid CSS after "throwErrorHere": expected "{", was ""
Unhandled rejection Error in plugin 'gulp-scss-lint'
Message:
ScssLint failed for: ionic.app.scss
Code: 0
Is this a bug, or am I doing something wrong? (Gulp-Scss-Lint version is 0.3.7)
We're hitting a "The command line is too long" error in windows while using this plugin.
As it appears, command line cannot be longer than 8192 characters on windows, and gulp-scss-lint calls "cmd.exe /s /c "scss-lint" with all files to lint as inline parameters with full path, quickly reaching this limit. There is only 85 scss files in the project so far, so I'm a bit surprised to see that kind of error.
Could you please check on why this is happening and how to fix it ?
Perhaps the plugin could just forward the glob it receives to scss-lint, as it seems scss-lint can handle those... Please let me know if I can help in any way.
In my config file .scss-lint.yml I have the following:
SelectorDepth:
enabled: true
max_depth: 5
and when I have some sass that is 4 levels deep I get the following error:
[W] Nesting should be no greater than 3, but was 4
even when I try to disable SelectorDepth it still is run. Any ideas?
When I try to run a task with gulp-scss-lint in it, I get this error: You need to have Ruby and scss-lint gem installed
.
I've double and triple-checked and I have Ruby 2.1.0 and scss-lint 0.27.0
I feel like I'm missing something stupid and basic, but every other gulp plugin is working fine.
Here's my gulpfile:
// get all the plugins
var gulp = require('gulp'),
sass = require('gulp-ruby-sass'),
autoprefixer = require('gulp-autoprefixer'),
minifycss = require('gulp-minify-css'),
jshint = require('gulp-jshint'),
uglify = require('gulp-uglify'),
imagemin = require('gulp-imagemin'),
rename = require('gulp-rename'),
concat = require('gulp-concat'),
notify = require('gulp-notify'),
cache = require('gulp-cache'),
livereload = require('gulp-livereload'),
del = require('del'),
scsslint = require('gulp-scss-lint');
// do CSS stuff
gulp.task('styles', function() {
return gulp.src('scss/**/*.scss')
// .pipe(scsslint({ 'config': 'lint.yml'}))
.pipe(sass({ style: 'expanded' }))
.pipe(autoprefixer('last 2 version', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1', 'ios 6', 'android 4'))
.pipe(gulp.dest('css'))
.pipe(rename({suffix: '.min'}))
.pipe(minifycss())
.pipe(gulp.dest('css'))
.pipe(notify({ message: 'Styles task complete' }));
});
// do JS stuff
// source scripts go in 'scripts' folder and are compiled into 'js'
gulp.task('scripts', function() {
return gulp.src('scripts/**/*.js')
.pipe(jshint('.jshintrc'))
.pipe(jshint.reporter('default'))
.pipe(concat('app.js'))
.pipe(gulp.dest('js'))
.pipe(rename({suffix: '.min'}))
.pipe(uglify())
.pipe(gulp.dest('js'))
.pipe(notify({ message: 'Scripts task complete' }));
});
// clean up
gulp.task('clean', function(cb) {
del(['css', 'js'], cb)
});
// default task
gulp.task('default', ['clean'], function() {
gulp.start('styles', 'scripts', 'images');
});
// watch task
gulp.task('watch', function() {
// Watch .scss files
gulp.watch('scss/**/*.scss', ['styles']);
// Watch .js files
gulp.watch('scripts/**/*.js', ['scripts']);
// Create LiveReload server
livereload.listen();
// Watch any files in dist/, reload on change
gulp.watch(['css/**','js/**']).on('change', livereload.changed);
});
I'd like to get this working so I can integrate with our Jenkins build server:
gulp.task('lint-scss-xml', function () {
gulp.src('assets/scss/**/*.scss')
.pipe(scsslint({'format': 'XML'}))
.pipe(rename('TEST-scss-lint.xml'))
.pipe(gulp.dest('reports'));
});
I will probably work on this next week unless someone wants to jump in now.
The title says it all.
I added this to a project not realizing that it required Ruby. The task ran without error, and did not have any complaints about my scss. Naturally suspicious of anything that works right the first time, I double checked my set up. This is when I spotted the Ruby requirement in the readme. This was surprising, because I do not have Ruby installed on my machine.
It would be better if the plugin failed with an error and clear message, rather than silently in this situation.
While my watch task is active and the scss-lint task is run, I sporadically get errors like the following:
events.js:85
throw er; // Unhandled 'error' event
^
Error: ENOENT, open '/path/to/some/filename_scsslint_tmp4101218392592792874.scss'
at Error (native)
I suspect it's because I'm also running the scss-lint plugin for PhpStorm (so I can catch issues even before saving), and that it creates these temp files.
I've excluded them from the src
in the Gulp task, using gulp-ignore
, like so:
gulp.task('scss-lint', function() {
return gulp.src('src/styles/**/*.scss')
.pipe($.ignore.exclude('**/*_scsslint_tmp*.scss'))
.pipe($.scssLint())
});
...and have confirmed with gulp-debug
that the temp files aren't piped to scss-lint – yet I still get these errors from time to time. I haven't found a way to consistently reproduce the error unfortunately. Any ideas?
My plugin version is 0.1.4. If I have the following task:
var watch = require('gulp-watch');
var scssLint = require('gulp-scss-lint');
var debug = require('gulp-debug');
gulp.task('lint', function() {
return watch('scss/**/*.scss')
.pipe(debug({title: '>>>>'}))
.pipe(scssLint())
.pipe(debug({title: '<<<<'}))
})
A change in scss folder would trigger the first debug pipe but seems it never passed to scssLint. If I don't have gulp-watch (use gulp.src for example) or gulp-scss-lint, everything works as expected. But it would not work if I try to use 2 together.
Is there something the prevents gulp-sass-lint to be used as a downstream of gulp-watch?
Great tool, but it looks like if the globs pass through a file name with a space in it your tool can't find the file, and errors out.
Like this:
/Volumes/Macintosh HD 2/Development/
I've been looking into how gulp-sass fixes this, and I'll update if I find a solution.
This is my Gulp task for linting.
return gulp.src([paths.sass.all, paths.sass.exclude])
.pipe($.scssLint({ config: 'lint.yml' }));
In 0.1.5, when gulp-scss-lint
starts, it displays the command line executed.
scss-lint /Users/antoinerey/Sites/Start/src/sass/main.scss --config lint.yml --format XML
I tried to hide it with verbose: false
, don' do anything.
When I run 'gulp scss' on my mac it reports while there's no such error on another mac with same version of gulp :
[16:40:32] Using gulpfile ~/Documents/codes/biz-tools/portal/gulpfile.js
[16:40:32] Starting 'scss'...
stream.js:94
throw er; // Unhandled stream error in pipe.
^
Error: Command line usage error
at createExecError (/Users/zhun.qu/Documents/codes/biz-tools/portal/node_modules/gulp- scsslint/src/index.js:155:33)
at ChildProcess.<anonymous> (/Users/zhun.qu/Documents/codes/biz-tools/portal/node_modules/gulp-scsslint/src/index.js:217:26)
at ChildProcess.emit (events.js:110:17)
at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
But it's ok on my mac if i comment two lines in gulpfile.js
gulp.task('scss', function() {
return gulp.src(paths.styles)
// .pipe(scsslint())
// .pipe(scsslint.reporter())
.pipe(sass())
.pipe(gulp.dest('src/styles'));
});
Does anyone know the reason?
This is fine for automated tasks, but problematic when a user wants to crawl it in order to apply the fixes.
A recent commit in scss-lint has removed the XML formatter, which in turn breaks gulp-scss-lint as --format=XML
is now an invalid output format.
[21:32:41] Error: Error in plugin 'gulp-scss-lint'
Message:
Command line usage error
Invalid output format specified: XML
I have an error when using failReporter alongside with the Checkstyle reporter :
TypeError: Cannot read property 'success' of undefined
at /mnt/hgfs/dev-meetic/webapp-desktop/node_modules/gulp-scss-lint/src/reporters.js:11:23
My gulp code is :
gulp
.src([config.appStyles])
.pipe(scssLint({
reporterOutputFormat: 'Checkstyle',
filePipeOutput: 'scss-report.xml'
}))
.pipe(scssLint.failReporter('E'))
.pipe(gulp.dest('reports/lint'));
I want my task to fail if I have a lint error in my SCSS but still generating XML reports files for Jenkis, is it possible ? Am I doing it right ?
Is there a way to make gulp returning an error when lint errors are present? For example qunit return an error when assertions fail.
I encountered the following unhandled error when no scss issues are found:
TypeError: Cannot read property 'forEach' of undefined
at [...]/node_modules/gulp-scss-lint/src/checkstyle.js:12:27
This error seems to occur when using the Checkstyle reporter like this:
return gulp
.src([
config.appStyles
])
// SCSS lint:
.pipe(scssLint({
reporterOutputFormat: 'Checkstyle',
filePipeOutput: 'scss-report.xml'
}))
.pipe(gulp.dest('reports/lint'));
The problem disappears when setting a default value to report.checkstyle.file
in src/checkstyle.js:12
:
xml2js(xmlReport, function(err, report) {
report.checkstyle.file = report.checkstyle.file || []; // Here
report.checkstyle.file.forEach(function(file) {
obj[file.$.name] = [];
file.error.forEach(function(error) {
error.$.linter = error.$.source;
error.$.reason = error.$.message;
obj[file.$.name].push(error.$);
})
});
cb(obj, xmlReport);
});
Hey, I'm having an issue with ^0.3.8
.
Here is the entirety of the gulp output:
[12:50:18] Starting 'scss-lint'...
[12:50:19] 'scss-lint' errored after 283 ms
[12:50:19] ReferenceError in plugin 'gulp-scss-lint'
Message:
newKey is not defined
I'm using ruby-v2.2.0 and scss_lint (0.43.2)
I've got a config, but my only option is declaring a config file, which is equivalent to the default .yml for the gem.
When I run gulp lint i get this error.
events.js:85
throw er; // Unhandled 'error' event
^
Error: Configuration error
My task looks like this.
gulp.task('lint', function() {
gulp.src('scss/*/.scss')
.pipe(scsslint({
'config': 'scss-lint.yml',
}));
});
node version 0.12.7
npm version 2.13.2
scss-lint
sass/test-breakpoint.scss:18 [W] IdSelector: Avoid using id selectors
gulp-scss-lint
[17:06:55] 1 issues found in /Users/username/projectname/sass/test-breakpoint.scss
[17:06:55] /Users/username/projectname/sass/test-breakpoint.scss:18 [W] Avoid using id selectors
So, I'd like the custom reporter to be able to:
Now the task finishes before the linting is complete:
gulp.task('scss-lint', () => {
return gulp
.src('./examples/src/**/*.scss')
.pipe(scsslint({
config: './lint.yml',
endless: true,
verbose: true
}));
});
scss-lint '/foo/index.scss' --config=./lint.yml --format=JSON
[09:00:28] 87 issues found in /foo/index.scss
[09:00:28] index.scss:1 [W] ImportPath: Imported partial `./normalise.scss` should be written as `./normalise`
[09:00:28] index.scss:4 [W] SpaceBeforeBrace: Opening curly brace `{` should be preceded by one space
[09:00:28] index.scss:5 [W] PropertyUnits: px units not allowed on `font`; must be one of (%, ms, s)
[09:00:28] index.scss:9 [W] SpaceBeforeBrace: Opening curly brace `{` should be preceded by one space
[09:00:28] index.scss:10 [W] UnnecessaryParentReference: Unnecessary parent selector (&)
[09:00:28] index.scss:14 [W] SpaceBeforeBrace: Opening curly brace `{` should be preceded by one space
[09:00:28] index.scss:15 [W] PropertyUnits: px units not allowed on `height`; must be one of (%, ms, s)
[09:00:28] index.scss:18 [W] UnnecessaryParentReference: Unnecessary parent selector (&)
[09:00:28] index.scss:19 [W] SpaceBeforeBrace: Opening curly brace `{` should be preceded by one space
[09:00:28] index.scss:20 [W] PropertySortOrder: Properties should be ordered background, cursor
[09:00:28] index.scss:22 [W] ColorVariable: Color literals like `#ccc` should only be used in variable declarations; they should be referred to via variable everywhere else.
[09:00:28] index.scss:25 [W] SpaceBeforeBrace: Opening curly brace `{` should be preceded by one space
[09:00:28] index.scss:26 [W] PropertyUnits: px units not allowed on `line-height`; must be one of (%, ms, s)
[09:00:28] index.scss:30 [W] SpaceBeforeBrace: Opening curly brace `{` should be preceded by one space
[09:00:28] index.scss:31 [W] PropertySortOrder: Properties should be ordered background, color
[09:00:28] index.scss:31 [W] ColorVariable: Color literals like `#fff` should only be used in variable declarations; they should be referred to via variable everywhere else.
[09:00:28] index.scss:32 [W] ColorVariable: Color literals like `#333` should only be used in variable declarations; they should be referred to via variable everywhere else.
[09:00:28] index.scss:36 [W] UnnecessaryParentReference: Unnecessary parent selector (&)
[09:00:28] index.scss:37 [W] SpaceBeforeBrace: Opening curly brace `{` should be preceded by one space
[09:00:28] index.scss:38 [W] PropertySortOrder: Properties should be ordered background, color
[09:00:28] index.scss:38 [W] ColorVariable: Color literals like `#e65100` should only be used in variable declarations; they should be referred to via variable everywhere else.
[09:00:28] index.scss:39 [W] ColorVariable: Color literals like `#ffeb3b` should only be used in variable declarations; they should be referred to via variable everywhere else.
[09:00:28] index.scss:41 [W] UnnecessaryParentReference: Unnecessary parent selector (&)
[09:00:28] index.scss:42 [W] SpaceBeforeBrace: Opening curly brace `{` should be preceded by one space
[09:00:28] index.scss:43 [W] PropertySortOrder: Properties should be ordered background, border, box-sizing, color, font, font-size, height, padding, width
[09:00:28] index.scss:43 [W] PropertyUnits: px units not allowed on `font-size`; must be one of (%, ms, s)
[09:00:28] index.scss:45 [W] PropertyUnits: px units not allowed on `padding`; must be one of (%, ms, s)
[09:00:28] index.scss:45 [W] ColorVariable: Color literals like `#e4511a` should only be used in variable declarations; they should be referred to via variable everywhere else.
[09:00:28] index.scss:45 [W] BorderZero: `border: 0 is preferred over `border: none`
[09:00:28] index.scss:49 [W] UnnecessaryParentReference: Unnecessary parent selector (&)
[09:00:28] index.scss:50 [W] SpaceBeforeBrace: Opening curly brace `{` should be preceded by one space
[09:00:28] index.scss:51 [W] ColorVariable: Color literals like `#f5f5f5` should only be used in variable declarations; they should be referred to via variable everywhere else.
[09:00:28] index.scss:54 [W] SpaceBeforeBrace: Opening curly brace `{` should be preceded by one space
[09:00:28] index.scss:55 [W] PropertyUnits: px units not allowed on `padding`; must be one of (%, ms, s)
[09:00:28] index.scss:59 [W] UnnecessaryParentReference: Unnecessary parent selector (&)
[09:00:28] index.scss:60 [W] SpaceBeforeBrace: Opening curly brace `{` should be preceded by one space
[09:00:28] index.scss:61 [W] PropertySortOrder: Properties should be ordered background, color
[09:00:28] index.scss:61 [W] ColorVariable: Color literals like `#fff` should only be used in variable declarations; they should be referred to via variable everywhere else.
[09:00:28] index.scss:62 [W] ColorVariable: Color literals like `#f44336` should only be used in variable declarations; they should be referred to via variable everywhere else.
[09:00:28] index.scss:65 [W] SpaceBeforeBrace: Opening curly brace `{` should be preceded by one space
[09:00:28] index.scss:66 [W] PropertyUnits: px units not allowed on `padding`; must be one of (%, ms, s)
[09:00:28] index.scss:71 [W] SpaceBeforeBrace: Opening curly brace `{` should be preceded by one space
[09:00:28] index.scss:72 [W] UnnecessaryParentReference: Unnecessary parent selector (&)
[09:00:28] index.scss:73 [W] SpaceBeforeBrace: Opening curly brace `{` should be preceded by one space
[09:00:28] index.scss:79 [W] SpaceBeforeBrace: Opening curly brace `{` should be preceded by one space
[09:00:28] index.scss:80 [W] UnnecessaryParentReference: Unnecessary parent selector (&)
[09:00:28] index.scss:81 [W] SpaceBeforeBrace: Opening curly brace `{` should be preceded by one space
[09:00:28] index.scss:88 [W] SpaceBeforeBrace: Opening curly brace `{` should be preceded by one space
[09:00:28] index.scss:89 [W] PropertySortOrder: Properties should be ordered background, color, cursor, height, position, position, width
[09:00:28] index.scss:89 [W] DuplicateProperty: Property `position` already defined on line 89
[09:00:28] index.scss:89 [W] SingleLinePerProperty: Property 'position' should be placed on own line
[09:00:28] index.scss:89 [W] SingleLinePerProperty: Property 'width' should be placed on own line
[09:00:28] index.scss:90 [W] SingleLinePerProperty: Property 'cursor' should be placed on own line
[09:00:28] index.scss:90 [W] SingleLinePerProperty: Property 'color' should be placed on own line
[09:00:28] index.scss:90 [W] ColorVariable: Color literals like `#fff` should only be used in variable declarations; they should be referred to via variable everywhere else.
[09:00:28] index.scss:90 [W] SingleLinePerProperty: Property 'background' should be placed on own line
[09:00:28] index.scss:90 [W] ColorVariable: Color literals like `#4488f1` should only be used in variable declarations; they should be referred to via variable everywhere else.
[09:00:28] index.scss:95 [W] UnnecessaryParentReference: Unnecessary parent selector (&)
[09:00:28] index.scss:96 [W] SpaceBeforeBrace: Opening curly brace `{` should be preceded by one space
[09:00:28] index.scss:97 [W] PropertySortOrder: Properties should be ordered height, width
[09:00:28] index.scss:100 [W] UnnecessaryParentReference: Unnecessary parent selector (&)
[09:00:28] index.scss:102 [W] SpaceBeforeBrace: Opening curly brace `{` should be preceded by one space
[09:00:28] index.scss:106 [W] UnnecessaryParentReference: Unnecessary parent selector (&)
[09:00:28] index.scss:107 [W] SpaceBeforeBrace: Opening curly brace `{` should be preceded by one space
[09:00:28] index.scss:108 [W] PropertyUnits: px units not allowed on `padding`; must be one of (%, ms, s)
[09:00:28] index.scss:108 [W] PropertyUnits: px units not allowed on `padding`; must be one of (%, ms, s)
[09:00:28] index.scss:108 [W] PropertyUnits: px units not allowed on `padding`; must be one of (%, ms, s)
[09:00:28] index.scss:108 [W] Shorthand: Shorthand form for property `padding` should be written more concisely as `20px 20px 0` instead of `20px 20px 0 20px`
[09:00:28] index.scss:111 [W] UnnecessaryParentReference: Unnecessary parent selector (&)
[09:00:28] index.scss:112 [W] SpaceBeforeBrace: Opening curly brace `{` should be preceded by one space
[09:00:28] index.scss:113 [W] PropertyUnits: px units not allowed on `padding`; must be one of (%, ms, s)
[09:00:28] index.scss:113 [W] PropertyUnits: px units not allowed on `padding`; must be one of (%, ms, s)
[09:00:28] index.scss:113 [W] PropertyUnits: px units not allowed on `padding`; must be one of (%, ms, s)
[09:00:28] index.scss:113 [W] Shorthand: Shorthand form for property `padding` should be written more concisely as `0 20px 20px` instead of `0 20px 20px 20px`
[09:00:28] index.scss:117 [W] SpaceBeforeBrace: Opening curly brace `{` should be preceded by one space
[09:00:28] index.scss:118 [W] PropertySortOrder: Properties should be ordered background, content, height, position, right, top, width
[09:00:28] index.scss:118 [W] PropertyUnits: px units not allowed on `width`; must be one of (%, ms, s)
[09:00:28] index.scss:118 [W] PropertyUnits: px units not allowed on `height`; must be one of (%, ms, s)
[09:00:28] index.scss:120 [W] UrlFormat: URL `https://dx35vtwkllhj9.cloudfront.net/images/logos/dark/empirecinemas.co.uk.png` should not contain protocol or domain
[09:00:28] index.scss:124 [W] SpaceBeforeBrace: Opening curly brace `{` should be preceded by one space
[09:00:28] index.scss:125 [W] ColorVariable: Color literals like `#2979ff` should only be used in variable declarations; they should be referred to via variable everywhere else.
[09:00:28] index.scss:129 [W] UnnecessaryParentReference: Unnecessary parent selector (&)
[09:00:28] index.scss:130 [W] SpaceBeforeBrace: Opening curly brace `{` should be preceded by one space
[09:00:28] index.scss:131 [W] PropertyUnits: px units not allowed on `padding`; must be one of (%, ms, s)
[09:00:28] index.scss:135 [W] SpaceBeforeBrace: Opening curly brace `{` should be preceded by one space
[09:00:28] index.scss:136 [W] PropertySortOrder: Properties should be ordered background, height
[09:00:28] index.scss:136 [W] ColorVariable: Color literals like `#2979ff` should only be used in variable declarations; they should be referred to via variable everywhere else.
scss-lint '/Users/gajus/Documents/dev/applaudience/react-showtimes-location-form/examples/src/normalise.scss' --config=./lint.yml --format=JSON
[09:00:29] 6 issues found in /Users/gajus/Documents/dev/applaudience/react-showtimes-location-form/examples/src/normalise.scss
[09:00:29] normalise.scss:26 [W] PropertySortOrder: Properties should be ordered margin, outline, padding
[09:00:29] normalise.scss:33 [W] PropertySortOrder: Properties should be ordered appearance, border-radius
[09:00:29] normalise.scss:47 [W] PropertySortOrder: Properties should be ordered color, text-decoration
[09:00:29] normalise.scss:47 [W] SingleLinePerProperty: Property 'color' should be placed on own line
[09:00:29] normalise.scss:55 [W] PropertySpelling: Unknown property touch-callout
[09:00:29] normalise.scss:55 [W] PropertySortOrder: Properties should be ordered highlight, tap-highlight-color, text-rendering, text-size-adjust, touch-callout, user-select
Notice that the scss-lint completes before "normalise.scss".
Getting this error when i try to lint my files:
Unhandled rejection SyntaxError: Unexpected token N at Object.parse (native) at C:\Dev\Successful Solutions\node_modules\gulp-scss-lint\src\command.js:93:25 at tryCatcher (C:\Dev\Successful Solutions\node_modules\bluebird\js\main\util.js:26:23) at Promise._settlePromiseFromHandler (C:\Dev\Successful Solutions\node_modules\bluebird\js\main\promise.js:507:31) at Promise._settlePromiseAt (C:\Dev\Successful Solutions\node_modules\bluebird\js\main\promise.js:581:18) at Promise._settlePromiseAtPostResolution (C:\Dev\Successful Solutions\node_modules\bluebird\js\main\promise.js:245:10) at Async._drainQueue (C:\Dev\Successful Solutions\node_modules\bluebird\js\main\async.js:128:12) at Async._drainQueues (C:\Dev\Successful Solutions\node_modules\bluebird\js\main\async.js:133:10) at Async.drainQueues (C:\Dev\Successful Solutions\node_modules\bluebird\js\main\async.js:15:14) at process._tickCallback (node.js:419:13) Unhandled rejection SyntaxError: Unexpected token N at Object.parse (native) at C:\Dev\Successful Solutions\node_modules\gulp-scss-lint\src\command.js:93:25 at tryCatcher (C:\Dev\Successful Solutions\node_modules\bluebird\js\main\util.js:26:23) at Promise._settlePromiseFromHandler (C:\Dev\Successful Solutions\node_modules\bluebird\js\main\promise.js:507:31) at Promise._settlePromiseAt (C:\Dev\Successful Solutions\node_modules\bluebird\js\main\promise.js:581:18) at Promise._settlePromiseAtPostResolution (C:\Dev\Successful Solutions\node_modules\bluebird\js\main\promise.js:245:10) at Async._drainQueue (C:\Dev\Successful Solutions\node_modules\bluebird\js\main\async.js:128:12) at Async._drainQueues (C:\Dev\Successful Solutions\node_modules\bluebird\js\main\async.js:133:10) at Async.drainQueues (C:\Dev\Successful Solutions\node_modules\bluebird\js\main\async.js:15:14) at process._tickCallback (node.js:419:13) Process terminated with code 0.
With this task:
'use strict';
module.exports = function (gulp, config, plugins) {
return {
params: [config.isProduction],
fn: function (isProduction, callBack) {
gulp.src(config.paths.sources.scss)
.pipe(plugins.cached('scssLint'))
.pipe(plugins.scssLint(
{
'config': 'Lints/ScssLint.yml',
'reporterOutput': 'Lints/ScssReport.json',
'endless': true // True when we use gulp-watch
}
))
.pipe(plugins.scssLint.failReporter());
callBack();
}
};
};
I try to exclude a specific files from linting.
Using scss-lint this works:
scss-lint -e 'scss/foo*.scss' scss/*.scss
Using gulp-scss-lint this failes:
.pipe(scsslint({
'config': 'lint-scss.yml',
'exclude': './scss/_*.scss'
}))
/var/www/my-project/node_modules/gulp-scss-lint/index.js:51
throw new gutil.PluginError(PLUGIN_NAME, scssLintCodes[error.code]
^
[gulp] Error in plugin 'gulp-scss-lint': Input file did not exist or was not readable
at /var/www/my-project/node_modules/gulp-scss-lint/index.js:51:19
at ChildProcess.exithandler (child_process.js:641:7)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Socket.<anonymous> (child_process.js:956:11)
at Socket.EventEmitter.emit (events.js:95:17)
at Pipe.close (net.js:466:12)
Not sure if it's my mistake or the plugin itself.
Hi, I am a newbie to this tool and have got this setup and configured as I require.
However, I wondered if there was a way I could prevent any console output when the the task is being performed?
On my initial run, I encountered the maxBuffer error and so increased the size in task config options. I am now reporting the resulst to an xml file for use on a build server and so producing console output is no longer needed.
Is there a way to do this?
Thanks
I am happy to do a PR to fix this, but wanted to file the issue in case you know how to fix it off the top of your head.
When you do not have Ruby and scss-lint installed, one would expect the stream to emit an error and cause the task to fail. However, it appears that an unhandled promise rejection is causing this not to happen.
Unhandled rejection Error in plugin 'gulp-scss-lint'
Message:
You need to have Ruby and scss-lint gem installed
I was able to get the task to fail (and get a stack trace) by adding this to my gulpfile
Promise.onPossiblyUnhandledRejection(function(error) {
throw new gutil.PluginError('Unhandled Exception', error, {showStack: true});
});
which provided the error with a stack trace
/home/ubuntu/homebuddy-webapp/node_modules/gulp-scss-lint/src/index.js:28
.then(function() {
^
Error in plugin 'gulp-scss-lint'
Message:
You need to have Ruby and scss-lint gem installed
(No stack trace)
From previous event:
at lint (/home/ubuntu/homebuddy-webapp/node_modules/gulp-scss-lint/src/index.js:28:8)
at Stream.endStream (/home/ubuntu/homebuddy-webapp/node_modules/gulp-scss-lint/src/index.js:59:7)
at _end (/home/ubuntu/homebuddy-webapp/node_modules/through/index.js:65:9)
at Stream.stream.end (/home/ubuntu/homebuddy-webapp/node_modules/through/index.js:74:5)
at DestroyableTransform.onend (/home/ubuntu/homebuddy-webapp/node_modules/vinyl-fs/node_modules/readable-stream/lib/_stream_readable.js:523:10)
at DestroyableTransform.g (events.js:260:16)
at emitNone (events.js:72:20)
at DestroyableTransform.emit (events.js:166:7)
at /home/ubuntu/homebuddy-webapp/node_modules/vinyl-fs/node_modules/readable-stream/lib/_stream_readable.js:965:16
at doNTCallback0 (node.js:407:9)
at process._tickDomainCallback (node.js:377:13)
npm ERR! Test failed. See above for more details.
This was a pretty bad bug for me because it causes the task to pass, but no subsequent tasks to run. This meant that our CI was passing, even though our tests never ran 😮 (because we run tests after linting).
Linter is returning the following warning:
[13:20:29] /Users/greg/LookThink/Gravatate/build/src/scss/_main.scss:21 [W] Rule declaration should be followed by an empty line
[13:20:29] /Users/greg/LookThink/Gravatate/build/src/scss/_main.scss:22 [W] Rule declaration should be followed by an empty line
[13:20:29] /Users/greg/LookThink/Gravatate/build/src/scss/_main.scss:28 [W] Rule declaration should be followed by an empty line
From this block of code:
&:before {
margin-right: 10px;
color: $brand-color-2;
}
} // END page-title
} // END main
.main-content {
@include clearfix;
padding: 20px;
} // END main-content
I mentioned this in the official scss-lint page and he added a fix so can you think of any reason this is happening? Did he not actually implement it or is gulp-scss-lint not pulling the latest somehow?
Thanks!
Hey,
I'm trying to achieve the following:
Run gulp watch. When it notices a change in an scss file, then it runs scss-lint followed by gulp-sass. I want it so that if any errors or warnings are returned from gulp-scss-lint they are displayed in the CMD window and then gulp-scss won't run and watch will continue.
Gulp-scss should only run when there are no warnings or errors output from gulp-scss-lint.
Is this possible in its current form?
I'm getting this error when I run gulp:
"You need to have Ruby and scss-lint gem installed"
I saw elsewhere a recommendation that I try something like...
sudo scss-lint sass/front.scss --config .scss-lint.yml --format XML
When I run that, I see some XML output that appears to be OK. It looks to me from the XML that scss-lint is working properly.
I'm not sure what to try next so that gulp can run scss-lint.
Hi, tried to include this plugin in our gulp file. However, I'm getting this error:
sass | { [Error: Input file did not exist or was not readable]
sass | message: 'Input file did not exist or was not readable',
sass | showStack: false,
sass | showProperties: true,
sass | plugin: 'gulp-scss-lint',
sass | __safety: { toString: [Function: bound ] } }
Any idea what this could be? Running the linter with the gem works fine.
This may not affect the plugin code itself, but the confil file does not exist
test fails on Ruby 2.2.2
Unhandled rejection AssertionError: expected 'Input file did not exist or was not readable' to equal 'Config file did not exist or was not readable'
at Stream.<anonymous> (/home/spainhower/repos/gulp-scss-lint/test/main.js:369:37)
at emitOne (events.js:77:13)
at Stream.emit (events.js:169:7)
at /home/spainhower/repos/gulp-scss-lint/src/index.js:33:16
at tryCatcher (/home/spainhower/repos/gulp-scss-lint/node_modules/bluebird/js/main/util.js:26:23)
at Promise._settlePromiseFromHandler (/home/spainhower/repos/gulp-scss-lint/node_modules/bluebird/js/main/promise.js:507:31)
at Promise._settlePromiseAt (/home/spainhower/repos/gulp-scss-lint/node_modules/bluebird/js/main/promise.js:581:18)
at Promise._settlePromises (/home/spainhower/repos/gulp-scss-lint/node_modules/bluebird/js/main/promise.js:697:14)
at Async._drainQueue (/home/spainhower/repos/gulp-scss-lint/node_modules/bluebird/js/main/async.js:123:16)
at Async._drainQueues (/home/spainhower/repos/gulp-scss-lint/node_modules/bluebird/js/main/async.js:133:10)
at Immediate.Async.drainQueues [as _onImmediate] (/home/spainhower/repos/gulp-scss-lint/node_modules/bluebird/js/main/async.js:15:14)
at processImmediate [as _immediateCallback] (timers.js:374:17)
1) confil file does not exist
[08:14:51] Starting 'scss-lint'...
scss-lint /Users/gajus/Documents/dev/applaudience/2015\ 08\ 04\ showtimes\ (react)/src/static/main.scss /Users/gajus/Documents/dev/applaudience/2015\ 08\ 04\ showtimes\ (react)/src/static/normalise.scss --format=JSON
undefined:1
SyntaxError: Unexpected end of input
at Object.parse (native)
at /Users/gajus/Documents/dev/applaudience/2015 08 04 showtimes (react)/node_modules/gulp-scss-lint/src/index.js:130:19
at ChildProcess.exithandler (child_process.js:204:5)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at maybeClose (internal/child_process.js:764:16)
at Socket.<anonymous> (internal/child_process.js:319:11)
at emitOne (events.js:77:13)
at Socket.emit (events.js:169:7)
at Pipe._onclose (net.js:468:12)
In the above example, the following file paths are not escaped property:
/Users/gajus/Documents/dev/applaudience/2015\ 08\ 04\ showtimes\ (react)/src/static/main.scss
/Users/gajus/Documents/dev/applaudience/2015\ 08\ 04\ showtimes\ (react)/src/static/normalise.scss
They are missing backslashed before the "(" and ")" characters.
Therefore, these should be:
/Users/gajus/Documents/dev/applaudience/2015\ 08\ 04\ showtimes\ \(react\)/src/static/normalise.scss
/Users/gajus/Documents/dev/applaudience/2015\ 08\ 04\ showtimes\ \(react\)/src/static/normalise.scss
I'm hitting an issue with the number of files we're passing to gulp-scss-lint, I'm giving gulp.src()
a path like ./themes/**/*.scss
which contains about 100 or so directories, each of which contains at least 6 scss files, so a minimum of 600 files - when I do so, gulp gives me this error:
child_process.js:1155
throw errnoException(err, 'spawn');
^
Error: spawn ENAMETOOLONG
at exports._errnoException (util.js:746:11)
at ChildProcess.spawn (child_process.js:1155:11)
at exports.spawn (child_process.js:988:9)
at Object.exports.execFile (child_process.js:682:15)
at Object.exports.exec (child_process.js:642:18)
at execCommand (C:\Source-git\src\directory\sub_directory\node_modules\gulp-scss-lint\src\index.js:92:21)
at execLintCommand (C:\Source-git\src\directory\sub_directory\node_modules\gulp-scss-lint\src\index.js:110:5)
at Stream.endStream (C:\Source-git\src\directory\sub_directory\node_modules\gulp-scss-lint\src\index.js:240:5)
at _end (C:\Source-git\src\directory\sub_directory\node_modules\gulp-scss-lint\node_modules\event-stream\node_modules\through\index.js:65:9)
at Stream.stream.end (C:\Source-git\src\directory\sub_directory\node_modules\gulp-scss-lint\node_modules\event-stream\node_modules\through\index.js:74:5)
My guess is that this is due to the length of the command you're handing off to the scss-lint command line utility. Gulp is giving it a huge JSON blob of file paths for each of the individual files gulp.src matches instead of one short path with wildcards, I've tested the wildcard path approach with the scss-lint CLI tool and it works just fine so it'd be great if gulp-scss-lint supported it too, it's stopping us from using it currently.
When debugging the plugin for my latest pull request, I could not get the tests to run.
(I ran gem install bundler && bundle install
first, of course):
~/Sites/newdev/node_modules/gulp-scss-lint debug-option* 9s
❯ npm run test
> [email protected] test /Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint
> mocha
[18:45:19] 4 issues found in ./test/fixtures/invalid.scss
[18:45:19] ./test/fixtures/invalid.scss:1 [W] Avoid using id selectors
[18:45:19] ./test/fixtures/invalid.scss:2 [W] Line should be indented 2 spaces, but was indented 0 spaces
[18:45:19] ./test/fixtures/invalid.scss:2 [W] Empty rule
[18:45:19] ./test/fixtures/invalid.scss:3 [W] Files should end with a trailing newline
․․[18:45:20] 4 issues found in ./test/fixtures/invalid.scss
[18:45:20] ./test/fixtures/invalid.scss:1 [W] Avoid using id selectors
[18:45:20] ./test/fixtures/invalid.scss:2 [W] Line should be indented 2 spaces, but was indented 0 spaces
[18:45:20] ./test/fixtures/invalid.scss:2 [W] Empty rule
[18:45:20] ./test/fixtures/invalid.scss:3 [W] Files should end with a trailing newline
․[18:45:20] 1 issues found in ./test/fixtures/valid.scss
[18:45:20] ./test/fixtures/valid.scss:1 [W] Avoid using id selectors
․․․․[18:45:22] 4 issues found in ./test/fixtures/invalid.scss
[18:45:22] ./test/fixtures/invalid.scss:1 [W] Avoid using id selectors
[18:45:22] ./test/fixtures/invalid.scss:2 [W] Line should be indented 2 spaces, but was indented 0 spaces
[18:45:22] ./test/fixtures/invalid.scss:2 [W] Empty rule
[18:45:22] ./test/fixtures/invalid.scss:3 [W] Files should end with a trailing newline
․․[18:45:23] 1 issues found in ./test/fixtures/file with spaces.scss
[18:45:23] ./test/fixtures/file with spaces.scss:1 [W] Avoid using id selectors
․[18:45:23] 2 issues found in ./test/fixtures/valid.scss
[18:45:23] ./test/fixtures/valid.scss:1 [W] Avoid using id selectors
[18:45:23] ./test/fixtures/valid.scss:2 [W] Line should be indented 4 spaces, but was indented 2 spaces
․․[18:45:24] 4 issues found in ./test/fixtures/invalid.scss
[18:45:24] ./test/fixtures/invalid.scss:1 [W] Avoid using id selectors
[18:45:24] ./test/fixtures/invalid.scss:2 [W] Line should be indented 2 spaces, but was indented 0 spaces
[18:45:24] ./test/fixtures/invalid.scss:2 [W] Empty rule
[18:45:24] ./test/fixtures/invalid.scss:3 [W] Files should end with a trailing newline
․․․․․․
14 passing (6s)
4 failing
1) gulp-scss-lint invalid scss file:
Uncaught AssertionError: expected [ Array(4) ] to have a length of 3 but got 4
at Stream.<anonymous> (/Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint/test/main.js:28:46)
at Stream.emit (events.js:95:17)
at reportLint (/Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint/src/index.js:156:16)
at Parser.<anonymous> (/Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint/node_modules/xml2js/lib/xml2js.js:384:20)
at Parser.emit (events.js:95:17)
at Object.onclosetag (/Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint/node_modules/xml2js/lib/xml2js.js:348:26)
at emit (/Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint/node_modules/xml2js/node_modules/sax/lib/sax.js:615:33)
at emitNode (/Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint/node_modules/xml2js/node_modules/sax/lib/sax.js:620:3)
at closeTag (/Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint/node_modules/xml2js/node_modules/sax/lib/sax.js:861:5)
at Object.write (/Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint/node_modules/xml2js/node_modules/sax/lib/sax.js:1294:29)
at Parser.exports.Parser.Parser.parseString (/Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint/node_modules/xml2js/lib/xml2js.js:403:31)
at Parser.parseString (/Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint/node_modules/xml2js/lib/xml2js.js:6:61)
at exports.parseString (/Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint/node_modules/xml2js/lib/xml2js.js:433:19)
at formatCommandResult (/Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint/src/index.js:99:5)
at /Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint/src/index.js:89:9
at ChildProcess.exithandler (child_process.js:662:7)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:766:16)
at Socket.<anonymous> (child_process.js:979:11)
at Socket.emit (events.js:95:17)
at Pipe.close (net.js:466:12)
2) gulp-scss-lint validate multi scss files:
Uncaught AssertionError: expected [ Array(4) ] to have a length of 3 but got 4
at Stream.<anonymous> (/Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint/test/main.js:92:46)
at Stream.emit (events.js:95:17)
at reportLint (/Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint/src/index.js:156:16)
at Parser.<anonymous> (/Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint/node_modules/xml2js/lib/xml2js.js:384:20)
at Parser.emit (events.js:95:17)
at Object.onclosetag (/Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint/node_modules/xml2js/lib/xml2js.js:348:26)
at emit (/Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint/node_modules/xml2js/node_modules/sax/lib/sax.js:615:33)
at emitNode (/Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint/node_modules/xml2js/node_modules/sax/lib/sax.js:620:3)
at closeTag (/Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint/node_modules/xml2js/node_modules/sax/lib/sax.js:861:5)
at Object.write (/Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint/node_modules/xml2js/node_modules/sax/lib/sax.js:1294:29)
at Parser.exports.Parser.Parser.parseString (/Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint/node_modules/xml2js/lib/xml2js.js:403:31)
at Parser.parseString (/Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint/node_modules/xml2js/lib/xml2js.js:6:61)
at exports.parseString (/Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint/node_modules/xml2js/lib/xml2js.js:433:19)
at formatCommandResult (/Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint/src/index.js:99:5)
at /Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint/src/index.js:89:9
at ChildProcess.exithandler (child_process.js:662:7)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:766:16)
at Socket.<anonymous> (child_process.js:979:11)
at Socket.emit (events.js:95:17)
at Pipe.close (net.js:466:12)
3) gulp-scss-lint valid scss file:
Uncaught AssertionError: expected false to be true
4) gulp-scss-lint should not fail with files with spaces:
Uncaught AssertionError: expected false to be true
npm ERR! Darwin 13.4.0
npm ERR! argv "node" "/usr/local/bin/npm" "run" "test"
npm ERR! node v0.10.35
npm ERR! npm v2.2.0
npm ERR! code ELIFECYCLE
npm ERR! [email protected] test: `mocha`
npm ERR! Exit status 4
npm ERR!
npm ERR! Failed at the [email protected] test script 'mocha'.
npm ERR! This is most likely a problem with the gulp-scss-lint package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! mocha
npm ERR! You can get their info via:
npm ERR! npm owner ls gulp-scss-lint
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/webgefrickel/Sites/newdev/node_modules/gulp-scss-lint/npm-debug.log
I am just getting my head wrapped around mocha/chai — I am sorry that I cannot give you more input on this...
BTW: the dependencies seem to be pretty outdated
~/Sites/newdev/node_modules/gulp-scss-lint debug-option* 10s
❯ npm-check-updates
"dargs" can be updated from ~0.1.0 to ~3.0.0 (Installed: 0.1.0, Latest: 3.0.0)
"event-stream" can be updated from ~3.1.2 to ~3.2.1 (Installed: 3.1.7, Latest: 3.2.1)
"gulp-util" can be updated from ~2.2.14 to ~3.0.2 (Installed: 2.2.20, Latest: 3.0.2)
"chai" can be updated from ~1.9.1 to ~1.10.0 (Installed: 1.9.2, Latest: 1.10.0)
"mocha" can be updated from ~1.18.2 to ~2.1.0 (Installed: 1.18.2, Latest: 2.1.0)
"proxyquire" can be updated from ^1.0.1 to ^1.3.1 (Installed: 1.3.1, Latest: 1.3.1)
"sinon" can be updated from ^1.10.2 to ^1.12.2 (Installed: 1.12.2, Latest: 1.12.2)
Run with '-u' to upgrade your package.json
I made sure the glob matches every file I need with glob-test
and here's my scss-lint
task:
gulp.task('scss-lint', function() {
return gulp.src([
'./src/**/*.scss',
'!./src/styles/images/sprite.scss' // file generated by another task
])
.pipe(scsslint({
config: '.scss-lint.yml'
}));
});
There's a few files that only get linted sometimes. This is me running that scss-lint
task without any changes to the scss:
~/repo$ gulp scss-lint
[15:06:16] Using gulpfile ~/repo/Gulpfile.js
[15:06:16] Starting 'scss-lint'...
[15:06:21] Finished 'scss-lint' after 4.73 s
~/repo$ gulp scss-lint
[15:06:32] Using gulpfile ~/repo/Gulpfile.js
[15:06:32] Starting 'scss-lint'...
[15:06:38] 1 issues found in /Users/littlebigbot/repo/src/styles/components/table.scss
[15:06:38] styles/components/table.scss:20 [W] QualifyingElement: Avoid qualifying attribute selectors with an element.
[15:06:38] Finished 'scss-lint' after 5.62 s
~/repo$ gulp scss-lint
[15:08:41] Using gulpfile ~/repo/Gulpfile.js
[15:08:41] Starting 'scss-lint'...
[15:08:45] Finished 'scss-lint' after 4.25 s
~/repo$ gulp scss-lint
[15:08:49] Using gulpfile ~/repo/Gulpfile.js
[15:08:49] Starting 'scss-lint'...
[15:08:53] Finished 'scss-lint' after 4.46 s
I am trying to run gulp-scss-lint, but all I get is this:
[02:13:50] Starting 'scss-lint'...
[02:13:50] 'scss-lint' errored after 33 ms
[02:13:50] Error in plugin 'gulp-scss-lint'
Message:
Error code ENOENT
Error: spawn ENOENT
When I run 'ruby -v' I get:
ruby 2.0.0p247 (2013-06-27) [i386-mingw32]
I have scss-lint installed. I am using Windows 8. Can anyone help?
It seems the failReporter will exit 1 on errors, but also on warnings. Is it intentionnal ? I would expect a softer exit for warnings.
I might be wrong, but it seems to me that it would just be a matter of changing
if (!file.scsslint.success) {
to
if (file.scsslint.errors > 0) {
in reporter.js
If I use scss-lint TechSmithSass/*.scss
everything is just fine. I'm on scss-lint .26 and gulp-scss-lint .11
gulp.task('scss-lint', function(){
gulp.src('TechSmithSass/*.scss')
.pipe(scsslint());
});
[10:59:28] Using gulpfile ~/GitHub/PublicWebProperties/gulpfile.js
[10:59:28] Starting 'scss-lint'...
[10:59:28] Finished 'scss-lint' after 4.3 ms
events.js:72
throw er; // Unhandled 'error' event
^
Error in plugin 'gulp-scss-lint'
Error code undefined
at /Users/j.rytlewski/GitHub/PublicWebProperties/node_modules/gulp-scss-lint/src/index.js:58:32
at ChildProcess.exithandler (child_process.js:643:7)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:755:16)
at Process.ChildProcess._handle.onexit (child_process.js:822:5)
Hey,
Can you please document your list of error codes?
We're struggling figuring out what's going on, as both errors and warnings seem to throw code 1, whereas scss-lint itself uses different codes for different types of events: https://github.com/brigade/scss-lint#exit-status-codes
Thanks!
If I run this code, it works without any problems:
gulp.task('scss-lint', function() {
gulp.src(paths.cssSrc + '/**/*.scss')
.pipe(cache('scsslint'))
.pipe(scsslint({'config': '.scss-lint.yml'})).on('error', handleError);
});
But if I add this task as a dependency to another task like so:
gulp.task('scss', ['scss-lint'], function() { ... });
I get an error because it can't find my config file.
I'm using scss-lint v0.29 and gulp-scss-lint v0.1.4. My config file is in the same location as my Gulpfile.
Upon running the scss-lint task when a partial contains an undefined variable, scss-lint does not report the error and passes, and then my build task runs that compiles it to build.scss file that has the error inline within the file.
test.scss
.class-name {
color: $main-color;
}
scss-lint task
var customCSS = [
/* Custom Sass & CSS */
'build/sass/variables.scss',
'build/baseline/*.scss',
'build/mixins/**/*.scss',
'build/pages/**/*.scss',
'build/css/**/**/*.css',
'build/sass/modules/**/*.scss'
];
module.exports = function() {
return APP.gulp.src(customCSS)
.pipe(APP.tasks.scsslint())
.pipe(APP.tasks.scsslint.failReporter());
};
Is there a way to fix this? I assume it's only linting files indivudally though, and not concatanating them. So regardless, the variable would always be undefined since it's not checking them by the stack/order in the array.
When scanning through more than one Sass file only the last file is in the output file.
The following is the gulp task that I'm using:
gulp.task('scss-lint', function() {
return gulp.src(['./web/scss/globals/*.scss', '!web/scss/globals/_reset.scss'])
.pipe(scsslint({
'config': 'scss-lint.yml',
'reporterOutput': './lint/scss-report.json',
'maxBuffer': 5 * 1024 * 1024,
'endless': true,
'sync': true
}));
});
Hey there, I noticed that on the README.md file there's an inconsistency:
This plugin requires Ruby and scss-lint
gem install scss_lint
Instead of gem install scss_lint
it should read gem install scss-lint
, following what the description said in the previous line.
Should I post a quick PR to fix this small typo?
Hi,
I've just updated my gem scss_lint to version 0.39.0 and after this update I can run gulp-scss-lint
anymore. It seems to be something related to the command-line arguments.
{ [Error: Command line usage error]
message: 'Command line usage error',
showStack: false,
showProperties: true,
plugin: 'gulp-scss-lint',
__safety: { toString: [Function] } }
If I revert my scss_lint to version 0.38.0 everything works as expected.
I'm an OSX user and my Node version is 0.12 and Npm version is 2.7.5.
Any help appreciated.
Alan
Is it possible to get the results output to HTML? I can't see any options to do so from the docs.
Thanks
Hi!
I'm seeing serious performance issues running SCSSlint on one of three stylesheets. The stylesheet in question does have quite a few @include's but not hundreds, and the whole point of SCSS is to be more modular, so I'm reluctant to start removing some of those and combining them.
Anyway, with scsslint, compile time is 6+ seconds, without it's ~900ms. There are also no errors, I've fixed what scsslint pulled up.
That said, two other stylesheets don't really seem affected but they're single files with no @includes.
Any ideas?
scss-lint CLI works fine, but the Gulp plugin keeps giving me the 'Error code 1' error. I looked it up, but I don't see any mention of a 'Error code 1' error on the SCSS Lint Github repo.
This is the error I'm getting when I run gulp:
Users/stef/Sites/_demo/ppgulp/node_modules/gulp-scss-lint/index.js:53
throw new gutil.PluginError(PLUGIN_NAME, 'Error code ' + error.cod
^
[gulp] Error in plugin 'gulp-scss-lint': Error code 1 in file /Users/stef/Sites/_demo/ppgulp/assets/scss/style.scss
at /Users/stef/Sites/_demo/ppgulp/node_modules/gulp-scss-lint/index.js:53:19
at ChildProcess.exithandler (child_process.js:606:7)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:700:16)
at Socket.<anonymous> (child_process.js:913:11)
at Socket.EventEmitter.emit (events.js:95:17)
at Pipe.close (net.js:436:12)
This is my gulpfile:
var gulp = require('gulp');
var scsslint = require('gulp-scss-lint');
gulp.task('scss', function() {
gulp.src('assets/scss/*.scss')
.pipe(scsslint({'config': 'scss-lint.yml'}))
});
gulp.task('default', ['scss']);
And this is my .scss-lint.yml:
linters:
Indentation:
enabled: false
Any ideas?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.