Skip to content
This repository was archived by the owner on May 16, 2025. It is now read-only.

Commit 985806e

Browse files
committed
fix: lint
1 parent 40af0b5 commit 985806e

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

src/plugin.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@ const depFromErr = (err) => {
2323
* - bootswatch/lumen/bootstrap.css
2424
* - lodash.random
2525
*/
26-
const matches = /(?:(?:Cannot resolve module)|(?:Can't resolve)) '([@\w\/\.-]+)' in/.exec(
27-
err
28-
);
26+
const matches =
27+
/(?:(?:Cannot resolve module)|(?:Can't resolve)) '([@\w\/\.-]+)' in/.exec(
28+
err
29+
);
2930

3031
if (!matches) {
3132
return;
@@ -141,13 +142,13 @@ class NpmInstallPlugin {
141142
'normal',
142143
result,
143144
// eslint-disable-next-line func-names
144-
function(err) {
145+
(err) => {
145146
if (err) {
146147
this.install(Object.assign({}, result, { request: depFromErr(err) }));
147148
}
148149

149150
callback();
150-
}.bind(this)
151+
}
151152
);
152153
}
153154

@@ -173,7 +174,7 @@ class NpmInstallPlugin {
173174
'loader',
174175
result,
175176
// eslint-disable-next-line func-names
176-
function(err) {
177+
(err) => {
177178
this.resolving[result.request] = false;
178179

179180
if (err) {
@@ -182,7 +183,7 @@ class NpmInstallPlugin {
182183
}
183184

184185
return next && next();
185-
}.bind(this)
186+
}
186187
);
187188
}
188189

@@ -202,15 +203,15 @@ class NpmInstallPlugin {
202203
'normal',
203204
result,
204205
// eslint-disable-next-line func-names
205-
function(err) {
206+
(err) => {
206207
this.resolving[result.request] = false;
207208

208209
if (err) {
209210
this.install(Object.assign({}, result, { request: depFromErr(err) }));
210211
}
211212

212213
return next();
213-
}.bind(this)
214+
}
214215
);
215216
}
216217
}

test/plugin.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ describe('plugin', () => {
7373
this.plugin.preCompile(
7474
compilation,
7575
// eslint-disable-next-line
76-
function() {
76+
function () {
7777
expect(this.run).toHaveBeenCalled();
7878
done();
7979
}.bind(this)
@@ -107,7 +107,7 @@ describe('plugin', () => {
107107
'node_modules',
108108
'express',
109109
// eslint-disable-next-line
110-
function() {
110+
function () {
111111
expect(this.resolve).not.toHaveBeenCalled();
112112
done();
113113
}.bind(this)
@@ -119,7 +119,7 @@ describe('plugin', () => {
119119
'src',
120120
'bundle?lazy!express',
121121
// eslint-disable-next-line
122-
function() {
122+
function () {
123123
expect(this.resolve).not.toHaveBeenCalled();
124124
done();
125125
}.bind(this)
@@ -131,7 +131,7 @@ describe('plugin', () => {
131131
'src',
132132
'express',
133133
// eslint-disable-next-line
134-
function() {
134+
function () {
135135
expect(this.resolve).toHaveBeenCalled();
136136
expect(this.check).toHaveBeenCalled();
137137
expect(this.install).toHaveBeenCalled();

0 commit comments

Comments
 (0)