jednano / eclint

Validate or fix code that doesn't adhere to EditorConfig settings or infer settings from existing code.
MIT License
305 stars 28 forks source link

Empty .gitignore crashes eclint #134

Open u-abramchuk opened 6 years ago

u-abramchuk commented 6 years ago

Hi,

when .gitignore file is empty eclint check (and fix) crashes with the following error:

$ eclint check *
/usr/local/lib/node_modules/eclint/node_modules/gulp-match/index.js:36
            throw new Error('gulp-match: empty glob array');
            ^

Error: gulp-match: empty glob array
    at module.exports (/usr/local/lib/node_modules/eclint/node_modules/gulp-match/index.js:36:10)
    at DestroyableTransform._transform (/usr/local/lib/node_modules/eclint/node_modules/gulp-ignore/index.js:17:8)
    at DestroyableTransform.Transform._read (/usr/local/lib/node_modules/eclint/node_modules/readable-stream/lib/_stream_transform.js:184:10)
    at DestroyableTransform.Transform._write (/usr/local/lib/node_modules/eclint/node_modules/readable-stream/lib/_stream_transform.js:172:83)
    at doWrite (/usr/local/lib/node_modules/eclint/node_modules/readable-stream/lib/_stream_writable.js:428:64)
    at writeOrBuffer (/usr/local/lib/node_modules/eclint/node_modules/readable-stream/lib/_stream_writable.js:417:5)
    at DestroyableTransform.Writable.write (/usr/local/lib/node_modules/eclint/node_modules/readable-stream/lib/_stream_writable.js:334:11)
    at StreamFilter.ondata (/usr/local/lib/node_modules/eclint/node_modules/readable-stream/lib/_stream_readable.js:619:20)
    at emitOne (events.js:116:13)
    at StreamFilter.emit (events.js:211:7)

It doesn't matter what argument I pass as a list of files, the error persists until I delete empty .gitignore file.