Skip to content

Commit 312d5fc

Browse files
committed
chore: fixed lint problems
1 parent 9494b9e commit 312d5fc

File tree

9 files changed

+45
-45
lines changed

9 files changed

+45
-45
lines changed

src/WorkerPool.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class PoolWorker {
3232
{
3333
detached: true,
3434
stdio: ['ignore', 'pipe', 'pipe', 'pipe', 'pipe'],
35-
},
35+
}
3636
);
3737

3838
this.worker.unref();
@@ -43,8 +43,8 @@ class PoolWorker {
4343
if (!this.worker.stdio) {
4444
throw new Error(
4545
`Failed to create the worker pool with workerId: ${workerId} and ${''}configuration: ${JSON.stringify(
46-
options,
47-
)}. Please verify if you hit the OS open files limit.`,
46+
options
47+
)}. Please verify if you hit the OS open files limit.`
4848
);
4949
}
5050

@@ -125,7 +125,7 @@ class PoolWorker {
125125
this.readBuffer(4, (lengthReadError, lengthBuffer) => {
126126
if (lengthReadError) {
127127
console.error(
128-
`Failed to communicate with worker (read length) ${lengthReadError}`,
128+
`Failed to communicate with worker (read length) ${lengthReadError}`
129129
);
130130
return;
131131
}
@@ -136,7 +136,7 @@ class PoolWorker {
136136
this.readBuffer(length, (messageError, messageBuffer) => {
137137
if (messageError) {
138138
console.error(
139-
`Failed to communicate with worker (read message) ${messageError}`,
139+
`Failed to communicate with worker (read message) ${messageError}`
140140
);
141141
return;
142142
}
@@ -147,7 +147,7 @@ class PoolWorker {
147147
this.onWorkerMessage(message, (err) => {
148148
if (err) {
149149
console.error(
150-
`Failed to communicate with worker (process message) ${err}`,
150+
`Failed to communicate with worker (process message) ${err}`
151151
);
152152
return;
153153
}
@@ -204,7 +204,7 @@ class PoolWorker {
204204
return;
205205
}
206206
callback(null, result);
207-
},
207+
}
208208
);
209209
break;
210210
}
@@ -379,7 +379,7 @@ export default class WorkerPool {
379379
this.timeout = null;
380380
this.poolQueue = asyncQueue(
381381
this.distributeJob.bind(this),
382-
options.poolParallelJobs,
382+
options.poolParallelJobs
383383
);
384384
this.terminated = false;
385385

@@ -441,7 +441,7 @@ export default class WorkerPool {
441441
nodeArgs: this.workerNodeArgs,
442442
parallelJobs: this.workerParallelJobs,
443443
},
444-
() => this.onJobDone(),
444+
() => this.onJobDone()
445445
);
446446
this.workers.add(newWorker);
447447
return newWorker;

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ function pitch() {
7272
// Compatibility with webpack v4
7373
this.addBuildDependency
7474
? this.addBuildDependency(d)
75-
: this.addDependency(d),
75+
: this.addDependency(d)
7676
);
7777
}
7878

@@ -82,7 +82,7 @@ function pitch() {
8282
}
8383

8484
callback(null, ...r.result);
85-
},
85+
}
8686
);
8787
}
8888

src/template.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ const replacer = (value, allowEmpty) => {
9292
if (value === null || value === undefined) {
9393
if (!allowEmpty) {
9494
throw new Error(
95-
`Path variable ${match} not implemented in this context: ${input}`,
95+
`Path variable ${match} not implemented in this context: ${input}`
9696
);
9797
}
9898

@@ -174,8 +174,8 @@ const replacePathVariables = (path, data, assetInfo) => {
174174
deprecated(
175175
replacer(base),
176176
'[filebase] is now [base]',
177-
'DEP_WEBPACK_TEMPLATE_PATH_PLUGIN_REPLACE_PATH_VARIABLES_FILENAME',
178-
),
177+
'DEP_WEBPACK_TEMPLATE_PATH_PLUGIN_REPLACE_PATH_VARIABLES_FILENAME'
178+
)
179179
);
180180
}
181181

@@ -193,7 +193,7 @@ const replacePathVariables = (path, data, assetInfo) => {
193193
replacer(data.hash),
194194
data.hashWithLength,
195195
assetInfo,
196-
'fullhash',
196+
'fullhash'
197197
);
198198

199199
replacements.set('fullhash', hashReplacer);
@@ -204,8 +204,8 @@ const replacePathVariables = (path, data, assetInfo) => {
204204
deprecated(
205205
hashReplacer,
206206
'[hash] is now [fullhash] (also consider using [chunkhash] or [contenthash], see documentation for details)',
207-
'DEP_WEBPACK_TEMPLATE_PATH_PLUGIN_REPLACE_PATH_VARIABLES_HASH',
208-
),
207+
'DEP_WEBPACK_TEMPLATE_PATH_PLUGIN_REPLACE_PATH_VARIABLES_HASH'
208+
)
209209
);
210210
}
211211

@@ -229,22 +229,22 @@ const replacePathVariables = (path, data, assetInfo) => {
229229
// eslint-disable-next-line no-undefined
230230
'hashWithLength' in chunk ? chunk.hashWithLength : undefined,
231231
assetInfo,
232-
'chunkhash',
232+
'chunkhash'
233233
);
234234
const contenthashReplacer = hashLength(
235235
replacer(
236236
data.contentHash ||
237237
(contentHashType &&
238238
chunk.contentHash &&
239-
chunk.contentHash[contentHashType]),
239+
chunk.contentHash[contentHashType])
240240
),
241241
data.contentHashWithLength ||
242242
('contentHashWithLength' in chunk && chunk.contentHashWithLength
243243
? chunk.contentHashWithLength[/** @type {string} */ (contentHashType)]
244244
: // eslint-disable-next-line no-undefined
245245
undefined),
246246
assetInfo,
247-
'contenthash',
247+
'contenthash'
248248
);
249249

250250
replacements.set('id', idReplacer);
@@ -272,44 +272,44 @@ const replacePathVariables = (path, data, assetInfo) => {
272272
module instanceof Module
273273
? /** @type {ModuleId} */
274274
(/** @type {ChunkGraph} */ (chunkGraph).getModuleId(module))
275-
: module.id,
276-
),
275+
: module.id
276+
)
277277
);
278278
const moduleHashReplacer = hashLength(
279279
replacer(() =>
280280
module instanceof Module
281281
? /** @type {ChunkGraph} */
282282
(chunkGraph).getRenderedModuleHash(module, data.runtime)
283-
: module.hash,
283+
: module.hash
284284
),
285285
// eslint-disable-next-line no-undefined
286286
'hashWithLength' in module ? module.hashWithLength : undefined,
287287
assetInfo,
288-
'modulehash',
288+
'modulehash'
289289
);
290290
const contentHashReplacer = hashLength(
291291
replacer(/** @type {string} */ (data.contentHash)),
292292
// eslint-disable-next-line no-undefined
293293
undefined,
294294
assetInfo,
295-
'contenthash',
295+
'contenthash'
296296
);
297297

298298
replacements.set('id', idReplacer);
299299
replacements.set('modulehash', moduleHashReplacer);
300300
replacements.set('contenthash', contentHashReplacer);
301301
replacements.set(
302302
'hash',
303-
data.contentHash ? contentHashReplacer : moduleHashReplacer,
303+
data.contentHash ? contentHashReplacer : moduleHashReplacer
304304
);
305305
// Legacy
306306
replacements.set(
307307
'moduleid',
308308
deprecated(
309309
idReplacer,
310310
'[moduleid] is now [id]',
311-
'DEP_WEBPACK_TEMPLATE_PATH_PLUGIN_REPLACE_PATH_VARIABLES_MODULE_ID',
312-
),
311+
'DEP_WEBPACK_TEMPLATE_PATH_PLUGIN_REPLACE_PATH_VARIABLES_MODULE_ID'
312+
)
313313
);
314314
}
315315

@@ -320,7 +320,7 @@ const replacePathVariables = (path, data, assetInfo) => {
320320
if (typeof data.runtime === 'string') {
321321
replacements.set(
322322
'runtime',
323-
replacer(() => prepareId(/** @type {string} */ (data.runtime))),
323+
replacer(() => prepareId(/** @type {string} */ (data.runtime)))
324324
);
325325
} else {
326326
replacements.set('runtime', replacer('_'));

src/worker.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ const queue = asyncQueue(({ id, data }, taskCallback) => {
204204
resolve(result);
205205
}
206206
},
207-
options,
207+
options
208208
);
209209
});
210210
}
@@ -383,7 +383,7 @@ const queue = asyncQueue(({ id, data }, taskCallback) => {
383383

384384
return createHash(
385385
// eslint-disable-next-line no-underscore-dangle
386-
type || data._compilation.outputOptions.hashFunction,
386+
type || data._compilation.outputOptions.hashFunction
387387
);
388388
},
389389
},
@@ -454,7 +454,7 @@ const queue = asyncQueue(({ id, data }, taskCallback) => {
454454
writePipeWrite(buffer);
455455
});
456456
setImmediate(taskCallback);
457-
},
457+
}
458458
);
459459
} catch (e) {
460460
writeJson({
@@ -513,7 +513,7 @@ function readNextMessage() {
513513
readBuffer(readPipe, 4, (lengthReadError, lengthBuffer) => {
514514
if (lengthReadError) {
515515
console.error(
516-
`Failed to communicate with main process (read length) ${lengthReadError}`,
516+
`Failed to communicate with main process (read length) ${lengthReadError}`
517517
);
518518
return;
519519
}
@@ -532,7 +532,7 @@ function readNextMessage() {
532532

533533
if (messageError) {
534534
console.error(
535-
`Failed to communicate with main process (read message) ${messageError}`,
535+
`Failed to communicate with main process (read message) ${messageError}`
536536
);
537537
return;
538538
}

test/basic-loader-test/test-loader.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ module.exports = async function testLoader() {
8989
}
9090
9191
resolve({ source, map, mod });
92-
}),
92+
})
9393
),
9494
importModule: typeof this.importModule,
9595
importModuleResult1: await this.importModule('./mod.js', {
@@ -108,8 +108,8 @@ module.exports = async function testLoader() {
108108
}
109109
110110
resolve(result);
111-
},
112-
),
111+
}
112+
)
113113
),
114114
callback: typeof this.callback,
115115
addDependency: typeof this.addDependency,
@@ -124,6 +124,6 @@ module.exports = async function testLoader() {
124124
getMissingDependencies: typeof this.getMissingDependencies,
125125
getMissingDependenciesResult: this.getMissingDependencies(),
126126
clearDependencies: typeof this.clearDependencies,
127-
})};`,
127+
})};`
128128
);
129129
};

test/pitch.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ const runPitch = (options) =>
104104
throw error;
105105
}
106106
},
107-
},
108-
),
107+
}
108+
)
109109
);
110110

111111
// it('runs pitch successfully when workPool not throw an error', () => {

test/serializer.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ test('round-trips plain objects', () => {
77
b: 'foo',
88
c: [null, false],
99
},
10-
replacer,
10+
replacer
1111
);
1212
expect(JSON.parse(json, reviver)).toEqual({
1313
a: 1,
@@ -22,7 +22,7 @@ test('round-trips regular expressions', () => {
2222
r: /hoge/g,
2323
s: /^(\w\s)+$/m,
2424
},
25-
replacer,
25+
replacer
2626
);
2727
expect(JSON.parse(json, reviver)).toEqual({
2828
r: /hoge/g,

test/webpack.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ test('Works with test-loader', (done) => {
8585
expect(logs).toMatchSnapshot('logs');
8686

8787
const [testMod] = [...stats.compilation.modules].filter(
88-
(i) => i.rawRequest === './file.js?q=1#hash',
88+
(i) => i.rawRequest === './file.js?q=1#hash'
8989
);
9090

9191
expect(testMod.buildInfo.cacheable).toBe(false);

test/workerPool.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ describe('workerPool', () => {
1818
const workerPool = new WorkerPool({});
1919
expect(() => workerPool.createWorker()).toThrowErrorMatchingSnapshot();
2020
expect(() => workerPool.createWorker()).toThrowError(
21-
'Please verify if you hit the OS open files limit',
21+
'Please verify if you hit the OS open files limit'
2222
);
2323
});
2424

@@ -62,7 +62,7 @@ describe('workerPool', () => {
6262
expect(() => workerPool.createWorker()).not.toThrow();
6363

6464
const nonSanitizedNodeArgs = childProcess.spawn.mock.calls[0][1].filter(
65-
(opt) => !opt,
65+
(opt) => !opt
6666
);
6767
expect(nonSanitizedNodeArgs.length).toEqual(0);
6868
});

0 commit comments

Comments
 (0)