@@ -23,9 +23,9 @@ const copyrightHeaderLines = [
2323
2424/**
2525 * @param {string[] | NodeJS.ReadWriteStream } some
26- * @param {boolean } linting
26+ * @param {boolean } runEslint
2727 */
28- function hygiene ( some , linting = true ) {
28+ function hygiene ( some , runEslint = true ) {
2929 const eslint = require ( './gulp-eslint' ) ;
3030 const gulpstylelint = require ( './stylelint' ) ;
3131 const formatter = require ( './lib/formatter' ) ;
@@ -156,7 +156,7 @@ function hygiene(some, linting = true) {
156156 const unicodeFilterStream = filter ( unicodeFilter , { restore : true } ) ;
157157
158158 const result = input
159- . pipe ( filter ( ( f ) => ! f . stat . isDirectory ( ) ) )
159+ . pipe ( filter ( ( f ) => Boolean ( f . stat && ! f . stat . isDirectory ( ) ) ) )
160160 . pipe ( snapshotFilter )
161161 . pipe ( yarnLockFilter )
162162 . pipe ( productJsonFilter )
@@ -175,7 +175,7 @@ function hygiene(some, linting = true) {
175175 result . pipe ( filter ( tsFormattingFilter ) ) . pipe ( formatting )
176176 ] ;
177177
178- if ( linting ) {
178+ if ( runEslint ) {
179179 streams . push (
180180 result
181181 . pipe ( filter ( eslintFilter ) )
@@ -186,18 +186,19 @@ function hygiene(some, linting = true) {
186186 } )
187187 )
188188 ) ;
189- streams . push (
190- result . pipe ( filter ( stylelintFilter ) ) . pipe ( gulpstylelint ( ( ( message , isError ) => {
191- if ( isError ) {
192- console . error ( message ) ;
193- errorCount ++ ;
194- } else {
195- console . warn ( message ) ;
196- }
197- } ) ) )
198- ) ;
199189 }
200190
191+ streams . push (
192+ result . pipe ( filter ( stylelintFilter ) ) . pipe ( gulpstylelint ( ( ( message , isError ) => {
193+ if ( isError ) {
194+ console . error ( message ) ;
195+ errorCount ++ ;
196+ } else {
197+ console . warn ( message ) ;
198+ }
199+ } ) ) )
200+ ) ;
201+
201202 let count = 0 ;
202203 return es . merge ( ...streams ) . pipe (
203204 es . through (
0 commit comments