Skip to content

Commit 72eeaf1

Browse files
authored
Merge pull request webpack#3341 from Kovensky/eslint-more-rules
More eslint rules
2 parents 0170568 + 24c2866 commit 72eeaf1

7 files changed

Lines changed: 16 additions & 7 deletions

.eslintrc

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{
22
"root": true,
3+
"extends": [
4+
"eslint:recommended"
5+
],
36
"env": {
47
"node": true
58
},
@@ -21,6 +24,12 @@
2124
"consistent-return": 0,
2225
"no-inner-declarations": 1,
2326
"no-loop-func": 1,
24-
"space-before-function-paren": [2, "never"]
27+
"space-before-function-paren": [2, "never"],
28+
"space-before-blocks": [2, "always"],
29+
"space-before-keywords": [2, "always"],
30+
"no-console": 0,
31+
"comma-dangle": 0,
32+
"no-unexpected-multiline": 2,
33+
"valid-jsdoc": 2
2534
}
2635
}

bin/webpack.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ function processOptions(options) {
280280
console.error("\u001b[1m\u001b[31m" + e.message + "\u001b[39m\u001b[22m");
281281
else
282282
console.error(e.message);
283-
process.exit(1);
283+
process.exit(1); // eslint-disable-line no-process-exit
284284
}
285285
throw e;
286286
}

lib/AsyncDependenciesBlock.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ AsyncDependenciesBlock.prototype.sortItems = function() {
4949
if(this.chunks) {
5050
this.chunks.sort(function(a, b) {
5151
var i = 0;
52-
while(true) {
52+
while(true) { // eslint-disable-line no-constant-condition
5353
if(!a.modules[i] && !b.modules[i]) return 0;
5454
if(!a.modules[i]) return -1;
5555
if(!b.modules[i]) return 1;

lib/ContextReplacementPlugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,4 @@ function createResolveDependenciesFromContextMap(createContextMap) {
100100
callback(null, dependencies);
101101
});
102102
}
103-
};
103+
}

lib/FlagDependencyExportsPlugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ FlagDependencyExportsPlugin.prototype.apply = function(compiler) {
7171
module.providedExports = exports.slice();
7272
changed = true;
7373
}
74-
};
74+
}
7575
}
7676
if(changed) {
7777
notifyDependencies();

lib/WebpackOptionsValidationError.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ WebpackOptionsValidationError.formatValidationError = function formatValidationE
8686
return dataPath + " should not be empty.";
8787
else
8888
return dataPath + " " + err.message;
89-
default:
89+
default: // eslint-disable-line no-fallthrough
9090
return dataPath + " " + err.message + " (" + JSON.stringify(err, 0, 2) + ").\n" +
9191
getSchemaPartText(err.parentSchema);
9292
}

lib/dependencies/HarmonyExportImportedSpecifierDependency.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ HarmonyExportImportedSpecifierDependency.prototype.getExports = function() {
8282
return {
8383
exports: [this.name]
8484
}
85-
};
85+
}
8686
if(this.importDependency.module && Array.isArray(this.importDependency.module.providedExports)) {
8787
return {
8888
exports: this.importDependency.module.providedExports.filter(function(id) {

0 commit comments

Comments
 (0)