Skip to content

Commit 75f68a2

Browse files
committed
fixes linting, remove not needed context arguments
1 parent 1ff28f8 commit 75f68a2

9 files changed

Lines changed: 17 additions & 16 deletions

‎lib/BasicEvaluatedExpression.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ class BasicEvaluatedExpression {
189189
if(!this.options) this.options = [];
190190
options.forEach(item => {
191191
this.options.push(item);
192-
}, this);
192+
});
193193
return this;
194194
}
195195

‎lib/Compilation.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ class Compilation extends Tapable {
119119
cacheModule.disconnect();
120120
this._modules.set(identifier, cacheModule);
121121
this.modules.push(cacheModule);
122-
cacheModule.errors.forEach(err => this.errors.push(err), this);
123-
cacheModule.warnings.forEach(err => this.warnings.push(err), this);
122+
cacheModule.errors.forEach(err => this.errors.push(err));
123+
cacheModule.warnings.forEach(err => this.warnings.push(err));
124124
return cacheModule;
125125
}
126126
module.unbuild();

‎lib/ContextReplacementPlugin.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class ContextReplacementPlugin {
9797
}
9898

9999
const createResolveDependenciesFromContextMap = (createContextMap) => {
100-
return (fs, options, callback) => {
100+
const resolveDependenciesFromContextMap = (fs, options, callback) => {
101101
createContextMap(fs, (err, map) => {
102102
if(err) return callback(err);
103103
const dependencies = Object.keys(map).map((key) => {
@@ -106,6 +106,7 @@ const createResolveDependenciesFromContextMap = (createContextMap) => {
106106
callback(null, dependencies);
107107
});
108108
};
109+
return resolveDependenciesFromContextMap;
109110
};
110111

111112
module.exports = ContextReplacementPlugin;

‎lib/MultiCompiler.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ module.exports = class MultiCompiler extends Tapable {
4040
}
4141
this.applyPlugins("invalid");
4242
});
43-
}, this);
43+
});
4444
}
4545

4646
get outputPath() {

‎lib/MultiModule.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class MultiModule extends Module {
6464
str.push("); }())");
6565
}
6666
str.push(";\n");
67-
}, this);
67+
});
6868
return new RawSource(str.join(""));
6969
}
7070
}

‎lib/Parser.js‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -460,8 +460,8 @@ class Parser extends Tapable {
460460
});
461461
this.plugin("evaluate ArrayExpression", expr => {
462462
const items = expr.elements.map(element => {
463-
return element !== null && this.evaluateExpression(element);
464-
}, this);
463+
return element !== null && this.evaluateExpression(element);
464+
});
465465
if(!items.every(Boolean)) return;
466466
return new BasicEvaluatedExpression().setItems(items).setRange(expr.range);
467467
});
@@ -724,7 +724,7 @@ class Parser extends Tapable {
724724
this.applyPluginsBailResult4("import specifier", statement, source, null, name);
725725
break;
726726
}
727-
}, this);
727+
});
728728
}
729729

730730
prewalkExportNamedDeclaration(statement) {
@@ -1121,7 +1121,7 @@ class Parser extends Tapable {
11211121
};
11221122
const params = functionExpression.params;
11231123
const renameThis = currentThis ? renameArgOrThis.call(this, currentThis) : null;
1124-
const args = options.map(renameArgOrThis, this);
1124+
const args = options.map(renameArgOrThis);
11251125
this.inScope(params.filter((identifier, idx) => !args[idx]), () => {
11261126
if(renameThis) {
11271127
this.scope.renames.set("this", renameThis);
@@ -1355,7 +1355,7 @@ class Parser extends Tapable {
13551355
if(expression.elements)
13561356
expression.elements.forEach(expr => {
13571357
arr.push(this.parseString(expr));
1358-
}, this);
1358+
});
13591359
return arr;
13601360
}
13611361

@@ -1368,7 +1368,7 @@ class Parser extends Tapable {
13681368
if(expression.elements)
13691369
expression.elements.forEach(expr => {
13701370
arr.push(this.parseCalculatedString(expr));
1371-
}, this);
1371+
});
13721372
return arr;
13731373
}
13741374

‎lib/ProgressPlugin.js‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ const createDefaultHandler = profile => {
6767

6868
};
6969

70-
7170
class ProgressPlugin {
7271

7372
constructor(options) {

‎lib/RuleSet.js‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ module.exports = class RuleSet {
147147
resourceSource = newSource;
148148
};
149149

150-
151150
if(rule.test || rule.include || rule.exclude) {
152151
checkResourceSource("test + include + exclude");
153152
condition = {

‎lib/TemplatedPathPlugin.js‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,19 @@ const REGEXP_HASH_FOR_TEST = new RegExp(REGEXP_HASH.source, "i"),
1919
REGEXP_NAME_FOR_TEST = new RegExp(REGEXP_NAME.source, "i");
2020

2121
const withHashLength = (replacer, handlerFn) => {
22-
return (match, hashLength, ...args) => {
22+
const fn = (match, hashLength, ...args) => {
2323
const length = hashLength && parseInt(hashLength, 10);
2424
if(length && handlerFn) {
2525
return handlerFn(length);
2626
}
2727
const hash = replacer(match, hashLength, ...args);
2828
return length ? hash.slice(0, length) : hash;
2929
};
30+
return fn;
3031
};
3132

3233
const getReplacer = (value, allowEmpty) => {
33-
return (match, ...args) => {
34+
const fn = (match, ...args) => {
3435
// last argument in replacer is the entire input string
3536
const input = args[args.length - 1];
3637
if(value === null || value === undefined) {
@@ -40,6 +41,7 @@ const getReplacer = (value, allowEmpty) => {
4041
return `${value}`;
4142
}
4243
};
44+
return fn;
4345
};
4446

4547
const replacePathVariables = (path, data) => {

0 commit comments

Comments
 (0)