Closed reintroducing closed 6 years ago
Weird. Do you have a gist, plunker, stackblitz link that repro's this?
Unfortunately its pretty deeply embedded into my project setup so i do not. I was hoping you'd see something I'm doing out of the ordinary (although based on that code there really is nothing visible). I'm going to table it for now because I have to keep moving forward on some of the other implementation details I need to do, but I am going to come back to this and at that point do a deep dive into reproduction and set up a code sample that will do this. If possible, keep this issue open for me and I'll double back when i get to the point that I'm troubleshooting this (probably one of the last things i do on this project).
Another option since it looks like this conditional may be a global, pre-evaluated thing:
let eslintStream;
if (isDev) {
eslintStream = eslint.format(friendlyFormatter);
} else {
let stream = fs.createWriteStream(`${projectPath(PATH_CONFIG.root.path)}/checkstyle-eslint.xml`);
eslintStream = eslint.format('checkstyle', stream);
}
// ...
.pipe(eslintStream)
The added benefit with this approach is it's a touch more legible, and you don't spin up the other stream that it'll never use. (e.g. because gulp-if takes in two already initialized streams and just chooses one of them, it'll read checkstyle-eslint.xml
even in dev mode.)
That did the trick, thanks!
I'm using node v10.3.0 and just noticed that my gulpif condition is always running the opposity of what i'm expecting.
The
checkstyle-eslint.xml
file is always being created when i runnpm start
but when i runnpm run build
it does not get created. I can't figure out why this is backwards.Logging
isDev
andtypeof isDev
produces the correct output:true 'boolean'
Any ideas?