You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently using this to lint some JSX/React files, as well as regular js files. I would pipe in the files into gulp-react and then pipe them into gulp-gjslint. These files are always transformed/compiled on the fly so there is no compiled destination files.
The current way this plugin works, it does not work on the pipped files directly, but uses the paths of those files to feed into closure-linter-wrapper. Because of this, files transformed are sourced again from the untransformed files and then fed to closure linter.
This is probably an edge case but it would be nice to add a note in the README stating that it does not work on streamed files, but on files located on disk. This also changes the file paths so if you have multiple files with same name you will not be able to tell which is which.
For those interested in a work around
gulp.task('lint',function(){returngulp.src('./**/*.js').pipe(react()).pipe(gulp.dest('./tmp'))// Write to disk.pipe(gjslint({flags: ['--nojsdoc']})).pipe(gjslint.reporter('console')).pipe(clean());//Deletes the generated files});
The text was updated successfully, but these errors were encountered:
When I get time, I'll look into seeing if there's a simple way of dealing with the file contents from the stream, rather than reading to contents from disk every time (which would also speed things up a fair bit).
Currently, I think the limitation lies with the closure-linter-wrapper dependency, as that just takes a list of source file locations and generates a command to run, using the file path(s).
e.g. when using closure-linter-wrapper, it expects to be passed an array of source file locations.
gjslint({src: ['./path/to/file.js']},callback);
Which runs:
python path/to/gjslint.py ./path/to/file.js
Your workaround would work... though I'd be interested to see if something similar could be built into this plugin.
For now though, happy to leave this issue open and will update the readme when I get a chance.
I am currently using this to lint some JSX/React files, as well as regular js files. I would pipe in the files into gulp-react and then pipe them into gulp-gjslint. These files are always transformed/compiled on the fly so there is no compiled destination files.
The current way this plugin works, it does not work on the pipped files directly, but uses the paths of those files to feed into closure-linter-wrapper. Because of this, files transformed are sourced again from the untransformed files and then fed to closure linter.
This is probably an edge case but it would be nice to add a note in the README stating that it does not work on streamed files, but on files located on disk. This also changes the file paths so if you have multiple files with same name you will not be able to tell which is which.
For those interested in a work around
The text was updated successfully, but these errors were encountered: