These are chat archives for redfin/react-server

19th
Jul 2016
Perry Shuman
@Noirbot
Jul 19 2016 18:36
Is there not linting set up on react-server, the sub-package?
Never mind, found it in Gulp
Perry Shuman
@Noirbot
Jul 19 2016 19:21
Hmm, not totally sure how to get things working with Gulp
I'm trying to set up a Lint task
I'm used to just requiring eslint directly and using NPM scripts
Douglas Wade
@doug-wade
Jul 19 2016 19:25
that’s what I do for most packages too, but we mostly use gulp to set up our tasks.
what problems are you having?
Perry Shuman
@Noirbot
Jul 19 2016 19:25
No real problems, just having to learn Gulp
BV's on Grunt, and moving to just doing raw NPM Scripts
Douglas Wade
@doug-wade
Jul 19 2016 19:49
hey @aickin you around? we’re hacking on react-server today and I’m having some troubles with react-server-cli and less compilation
Perry Shuman
@Noirbot
Jul 19 2016 20:06
Are we particularly attached to running ESLint via Gulp?
Douglas Wade
@doug-wade
Jul 19 2016 20:06
personally? no. @aickin and @gigabo might have different opinions, however
Perry Shuman
@Noirbot
Jul 19 2016 20:07
It seems like it obfuscates the results some
Judging by the fact that no one noticed that last set of failures
Douglas Wade
@doug-wade
Jul 19 2016 20:11
The best way I know to make errors easier with gulp is to add gulp-plumber to every stream
gulp 4 has much better error handling, iiuc gulpjs/gulp#359
we could probably switch to the beta now — we’re using the lerna beta
Perry Shuman
@Noirbot
Jul 19 2016 20:14
I mean, if it's not effecting other Gulp tasks, it may just be easier to pull linting out
but I'm biased
Douglas Wade
@doug-wade
Jul 19 2016 20:14
I think we want to chain linting with other tasks
i.e. to run linting when you run gulp
as much as I prefer npm scripts, I definitely don’t want a half gulp/half npm script solution
Perry Shuman
@Noirbot
Jul 19 2016 20:17
Though, in order to have a lerna lint, we need to have an npm run lint on each package, right?
Douglas Wade
@doug-wade
Jul 19 2016 20:17
yes
definitely yes
Perry Shuman
@Noirbot
Jul 19 2016 20:17
So, we're either wrapping Gulp in NPM or NPM in Gulp :P
Douglas Wade
@doug-wade
Jul 19 2016 20:18
yeah — a solution that’s 100% npm scripts and 100% gulp
the difference is slight, I recognize
but if you’re expecting to use gulp, it just does the right thing
and if you’re expecting to use npm scripts, it just does the right thing
Perry Shuman
@Noirbot
Jul 19 2016 20:18
I mean, I'm fine setting up both
I just didn't want to step on any toes
Douglas Wade
@doug-wade
Jul 19 2016 20:19
Its well appreciated :smile:
Perry Shuman
@Noirbot
Jul 19 2016 20:20
The only worry I see there is that we'll now have some of the eslint setup in 2 places
Bo Borgerson
@gigabo
Jul 19 2016 20:22
Huh what?
eslint without gulp?
Great!
gigabo @gigabo wanders away.
Douglas Wade
@doug-wade
Jul 19 2016 20:22
@doug-wade The .eslintrc doesn't specify which files to lint though
That's hardcoded in the Gulp config
gulp.task("eslint", [], function() {
    var srcMinusTest = src.concat([
        "!core/**/__tests__/**/*",
        "!**/*.json",
    ]);
    return gulp.src(srcMinusTest)
        // eslint() attaches the lint output to the eslint property
        // of the file object so it can be used by other modules.
        .pipe(eslint())
        // eslint.format() outputs the lint results to the console.
        // Alternatively use eslint.formatEach() (see Docs).
        .pipe(eslint.format())
        // To have the process exit with an error code (1) on
        // lint error, return the stream and pipe to failOnError last.
        .pipe(eslint.failAfterError());
});
So if we want to maintain eslint as a Gulp task, we may have to factor that out?