Skip to content

Commit 7327ee6

Browse files
authored
chore(eslint): added eslint-node-plugin (webpack#3652)
1 parent e128cdd commit 7327ee6

File tree

9 files changed

+14
-19
lines changed

9 files changed

+14
-19
lines changed

.eslintrc

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
{
22
"root": true,
3-
"extends": [
4-
"eslint:recommended"
5-
],
3+
"plugins": ["node"],
4+
"extends": ["eslint:recommended", "plugin:node/recommended"],
65
"env": {
7-
"node": true,
8-
"es6": true
6+
"node": true
97
},
108
"rules": {
119
"quotes": ["error", "double"],
@@ -45,3 +43,4 @@
4543
"valid-jsdoc": "error"
4644
}
4745
}
46+

bin/convert-argv.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -466,12 +466,6 @@ module.exports = function(yargs, argv, convertOptions) {
466466
options.plugins.push(new ProvidePlugin(name, value));
467467
});
468468

469-
ifBooleanArg("labeled-modules", function() {
470-
ensureArray(options, "plugins");
471-
var LabeledModulesPlugin = require("../lib/dependencies/LabeledModulesPlugin");
472-
options.plugins.push(new LabeledModulesPlugin());
473-
});
474-
475469
ifArg("plugin", function(value) {
476470
ensureArray(options, "plugins");
477471
options.plugins.push(loadPlugin(value));

bin/webpack.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,6 @@ function processOptions(options) {
326326
console.error(err.stack || err);
327327
if(err.details) console.error(err.details);
328328
process.exit(1); // eslint-disable-line
329-
return;
330329
}
331330
if(outputOptions.json) {
332331
process.stdout.write(JSON.stringify(stats.toJson(outputOptions), null, 2) + "\n");

hot/.eslintrc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
{
22
"env": {
3-
"node": true,
4-
"es6": false,
5-
"browser": true
3+
"node": true
4+
},
5+
"rules": {
6+
"node/exports-style": ["off"]
67
}
8+
79
}

lib/Compiler.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ Compiler.prototype.emitAssets = function(compilation, callback) {
321321
}
322322
var content = source.source();
323323
if(!Buffer.isBuffer(content))
324-
content = new Buffer(content, "utf-8");
324+
content = Buffer.from(content, "utf8");
325325
source.existsAt = targetPath;
326326
source.emitted = true;
327327
this.outputFileSystem.writeFile(targetPath, content, callback);

lib/EvalSourceMapDevToolModuleTemplatePlugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ EvalSourceMapDevToolModuleTemplatePlugin.prototype.apply = function(moduleTempla
5858
}
5959
sourceMap.sourceRoot = options.sourceRoot || "";
6060
sourceMap.file = module.id + ".js";
61-
var footer = self.sourceMapComment.replace(/\[url\]/g, "data:application/json;charset=utf-8;base64," + new Buffer(JSON.stringify(sourceMap)).toString("base64"));
61+
var footer = self.sourceMapComment.replace(/\[url\]/g, "data:application/json;charset=utf-8;base64," + Buffer.from(JSON.stringify(sourceMap)).toString("base64"));
6262
source.__EvalSourceMapDevToolData = new RawSource("eval(" + JSON.stringify(content + footer) + ");");
6363
return source.__EvalSourceMapDevToolData;
6464
});

lib/LibManifestPlugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ LibManifestPlugin.prototype.apply = function(compiler) {
4343
return obj;
4444
}.bind(this), {})
4545
};
46-
var content = new Buffer(JSON.stringify(manifest, null, 2), "utf-8");
46+
var content = Buffer.from(JSON.stringify(manifest, null, 2), "utf8");
4747
compiler.outputFileSystem.mkdirp(path.dirname(targetPath), function(err) {
4848
if(err) return callback(err);
4949
compiler.outputFileSystem.writeFile(targetPath, content, callback);

lib/SourceMapDevToolPlugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ SourceMapDevToolPlugin.prototype.apply = function(compiler) {
155155
})
156156
.replace(/\[url\]/g, function() {
157157
return "data:application/json;charset=utf-8;base64," +
158-
new Buffer(JSON.stringify(sourceMap)).toString("base64");
158+
Buffer.from(JSON.stringify(sourceMap)).toString("base64");
159159
})
160160
);
161161
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"css-loader": "~0.25.0",
3838
"es6-promise-polyfill": "^1.1.1",
3939
"eslint": "3.12.2",
40+
"eslint-plugin-node": "^3.0.5",
4041
"express": "~4.13.1",
4142
"extract-text-webpack-plugin": "^2.0.0-beta",
4243
"file-loader": "~0.9.0",

0 commit comments

Comments
 (0)