Skip to content

Commit

Permalink
fix: ESLint is broken when using eslint-plugin-import
Browse files Browse the repository at this point in the history
  • Loading branch information
clarkdo committed May 21, 2018
1 parent fe0106a commit 783f243
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const defaults = {
compiledIn: true,
done: null,
minimal: env.minimalCLI,
stream: process.stderr,
stream: null,
};

const hasRunning = () => Object.values(sharedState).find((s) => s.isRunning);
Expand Down Expand Up @@ -62,6 +62,10 @@ export default class WebpackBarPlugin extends webpack.ProgressPlugin {
return sharedState[this.options.name];
}

get stream() {
return this.options.stream || process.stderr;
}

apply(compiler) {
super.apply(compiler);

Expand All @@ -84,7 +88,7 @@ export default class WebpackBarPlugin extends webpack.ProgressPlugin {
if (this.options.profile) {
const stats = this.state.profile.getStats();
const statsStr = formatStats(stats);
this.options.stream.write(`\n${statsStr}\n`);
this.stream.write(`\n${statsStr}\n`);
}

if (typeof this.options.done === 'function') {
Expand Down Expand Up @@ -141,7 +145,7 @@ export default class WebpackBarPlugin extends webpack.ProgressPlugin {
return;
}

const columns = this.options.stream.columns || 80;
const columns = this.stream.columns || 80;

const stateLines = _.sortBy(Object.keys(sharedState), (n) => n).map(
(name) => {
Expand Down

0 comments on commit 783f243

Please sign in to comment.