panuhorsmalahti / gulp-tslint

TypeScript linter plugin for Gulp
MIT License
118 stars 44 forks source link

TypeError: Path must be a string. Received -1 #131

Open tinesoft opened 7 years ago

tinesoft commented 7 years ago

Hi, The above error is thown when linting. Here is my config

gulp-tslint version: 8.1.1 tslint version: 5.4.3 Operating system: Windows 8.1, 64Bits

Example gulp configuration (if applicable):

gulp.task('lint', (cb) => {
  pump([
    gulp.src(config.allTs),
    gulpTslint({ formatter: "verbose" }),
    gulpTslint.report()
  ], cb);
});

Error console output:

TypeError: Path must be a string. Received -1
    at assertPath (path.js:7:11)
    at Object.join (path.js:468:7)
    at findFile (H:\my-project\node_modules\tslint\lib\configuration.js:137:98)
    at findup (H:\my-project\node_modules\tslint\lib\configuration.js:118:19)
    at findConfigurationPath (H:\my-project\node_modules\tslint\lib\configuration.js:95:30)
    at Object.findConfiguration (H:\my-project\node_modules\tslint\lib\configuration.js:48:22)
    at H:\my-project\node_modules\gulp-tslint\index.js:101:64
    at wrappedMapper (H:\my-project\node_modules\map-stream\index.js:83:19)
    at Stream.stream.write (H:\my-project\node_modules\map-stream\index.js:95:21)
    at write (H:\my-project\node_modules\vinyl-fs\node_modules\readable-stream\lib\_stream_readable.js:623:24)

TypeScript example code (if applicable):

panuhorsmalahti commented 7 years ago

What is config.allTs?

tinesoft commented 7 years ago

Hi @panuhorsmalahti

config.allTs is a glob pattern to identify the *.ts files to lint, it contains 'src/**/!(*.spec).ts'. A sample project can be found here: https://github.com/pratikthecook/my-sample-lib If you upgrade the packages gulp-tslint version to 8.1.1 and tslint to 5.4.3, you should have the above mentioned error when linting (via gulp lint )...

Tested on node 7

panuhorsmalahti commented 7 years ago

I get no error from the following:

git clone https://github.com/pratikthecook/my-sample-lib.git
ncu -u
npm i
gulp lint

I'm using Mac OS X and 8.0.0. This problems appears to be Windows specific, maybe even Windows 8. I'll try Windows 10 later.

(Note: ncu is the npm-check-updates tool).