Skip to content

Commit 783f243

Browse files
committed
fix: ESLint is broken when using eslint-plugin-import
1 parent fe0106a commit 783f243

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/index.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const defaults = {
2626
compiledIn: true,
2727
done: null,
2828
minimal: env.minimalCLI,
29-
stream: process.stderr,
29+
stream: null,
3030
};
3131

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

65+
get stream() {
66+
return this.options.stream || process.stderr;
67+
}
68+
6569
apply(compiler) {
6670
super.apply(compiler);
6771

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

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

144-
const columns = this.options.stream.columns || 80;
148+
const columns = this.stream.columns || 80;
145149

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

0 commit comments

Comments
 (0)