Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(convert-args): remove unused arguments #253

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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];
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont want to change the var this needs to be handled across the cli 👍

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