style: fix linting issues

This commit is contained in:
Ben Heidemann 2021-04-10 12:18:56 +01:00 committed by David Humphrey
parent e82374ae2b
commit ea5e48b48b
3 changed files with 12 additions and 14 deletions

View File

@ -33,14 +33,14 @@ module.exports = class FilerWebpackPlugin {
// Apply fs, path and buffer shims if required // Apply fs, path and buffer shims if required
switch (resolveData.request) { switch (resolveData.request) {
case 'fs': case 'fs':
if (!this.options.shimFs) return; if (!this.options.shimFs) return;
return this.applyFsShim(resolveData); return this.applyFsShim(resolveData);
case 'path': case 'path':
if (!this.options.shimPath) return; if (!this.options.shimPath) return;
return this.applyPathShim(resolveData); return this.applyPathShim(resolveData);
default: default:
return; return;
} }
} }
); );

View File

@ -168,7 +168,7 @@ function createMockFn(implementation = undefined) {
if (typeof implementation === 'function') { if (typeof implementation === 'function') {
return implementation(...args); return implementation(...args);
} }
} };
Object.defineProperty(mockFn, 'calls', { Object.defineProperty(mockFn, 'calls', {
get() { get() {
return calls; return calls;

View File

@ -15,7 +15,7 @@ function createNMFResolveCompilerObject(resolveData) {
tap: normalModuleFactory_resolve_tap tap: normalModuleFactory_resolve_tap
} }
} }
} };
const normalModuleFactory_tap = utils.createMockFn(function (name, callback) { const normalModuleFactory_tap = utils.createMockFn(function (name, callback) {
callback(normalModuleFactory); callback(normalModuleFactory);
@ -27,13 +27,13 @@ function createNMFResolveCompilerObject(resolveData) {
tap: normalModuleFactory_tap, tap: normalModuleFactory_tap,
} }
} }
} };
return { return {
compiler, compiler,
normalModuleFactory_tap, normalModuleFactory_tap,
normalModuleFactory_resolve_tap, normalModuleFactory_resolve_tap,
} };
} }
describe.only('path shim', () => { describe.only('path shim', () => {
@ -324,8 +324,6 @@ describe.only('path shim', () => {
// Mocks // Mocks
const { const {
compiler, compiler,
normalModuleFactory_tap,
normalModuleFactory_resolve_tap,
} = createNMFResolveCompilerObject(resolveDataIn); } = createNMFResolveCompilerObject(resolveDataIn);
// Act // Act