Skip to content

Commit

Permalink
refactor(convert-args): remove unused arguments (#253)
Browse files Browse the repository at this point in the history
* refactor(convert-args): remove unused arguments

* remove unused arguments
  • Loading branch information
sendilkumarn authored and evenstensberg committed Jan 30, 2018
1 parent 63cf7d5 commit 2c36641
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ module.exports = {
}],
"no-console": "off",
"valid-jsdoc": "error",
"node/no-unsupported-features": ["error", { "version": 4 }],
"node/no-unsupported-features": ["error", { "version": 6 }],
"node/no-deprecated-api": "error",
"node/no-missing-import": "error",
"node/no-missing-require": [
Expand Down
3 changes: 2 additions & 1 deletion bin/convert-argv.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ var fs = require("fs");
fs.existsSync = fs.existsSync || path.existsSync;
var interpret = require("interpret");
var prepareOptions = require("./prepareOptions");
module.exports = function(yargs, argv, convertOptions) {
module.exports = function(...args) {
var argv = args[1] || args[0];
var options = [];
// Shortcuts
if (argv.d) {
Expand Down
2 changes: 1 addition & 1 deletion bin/process-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = function processOptions(yargs, argv) {
fn(argv[name], -1);
}
}
var options = require("./convert-argv")(yargs, argv);
var options = require("./convert-argv")(argv);

if (typeof options.then === "function") {
options.then(processOptions).catch(function(err) {
Expand Down
13 changes: 8 additions & 5 deletions bin/webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,8 @@
type: "string",
default: "info",
group: DISPLAY_GROUP,
describe: "Controls the output of lifecycle messaging e.g. Started watching files... (verbose, info, none)"
describe:
"Controls the output of lifecycle messaging e.g. Started watching files... (verbose, info, none)"
}
});

Expand Down Expand Up @@ -220,7 +221,7 @@
}

try {
var options = require("./convert-argv")(yargs, argv);
var options = require("./convert-argv")(argv);
} catch (err) {
if (err.name !== "ValidationError") {
throw err;
Expand Down Expand Up @@ -407,7 +408,9 @@

ifArg("info-verbosity", function(value) {
if (!["none", "info", "verbose"].includes(value))
throw new Error("Invalid configuration object. \n configuration['info-verbosity'] should be one of these:\n \"none\" | \"info\" | \"verbose\"");
throw new Error(
"Invalid configuration object. \n configuration['info-verbosity'] should be one of these:\n \"none\" | \"info\" | \"verbose\""
);
outputOptions.infoVerbosity = value;
});

Expand Down Expand Up @@ -441,10 +444,10 @@
}

if (outputOptions.infoVerbosity === "verbose") {
compiler.hooks.beforeCompile.tap("WebpackInfo", (compilation) => {
compiler.hooks.beforeCompile.tap("WebpackInfo", compilation => {
console.log("\nCompilation starting…\n");
});
compiler.hooks.afterCompile.tap("WebpackInfo", (compilation) => {
compiler.hooks.afterCompile.tap("WebpackInfo", compilation => {
console.log("\nCompilation finished\n");
});
}
Expand Down

0 comments on commit 2c36641

Please sign in to comment.