Skip to content

Commit 20aab48

Browse files
committed
fix(init): lint code
1 parent 1cb0166 commit 20aab48

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

bin/prompt-command.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ const npmGlobalRoot = () => {
3131
const cp = require("child_process");
3232
return new Promise((resolve, reject) => {
3333
const command = cp.spawn("npm", ["root", "-g"]);
34-
command.on('error', (error) => reject(error));
35-
command.stdout.on('data', (data) => resolve(data.toString()));
36-
command.stderr.on('data', (data) => reject(data));
37-
})
38-
}
34+
command.on("error", (error) => reject(error));
35+
command.stdout.on("data", (data) => resolve(data.toString()));
36+
command.stderr.on("data", (data) => reject(data));
37+
});
38+
};
3939

4040
module.exports = function promptForInstallation(packages, ...args) {
4141
const nameOfPackage = "@webpack-cli/" + packages;
@@ -69,7 +69,7 @@ module.exports = function promptForInstallation(packages, ...args) {
6969
options[0] = "add";
7070
}
7171

72-
if (packages == 'init') {
72+
if (packages === "init") {
7373
if (isYarn) {
7474
options.splice(1, 1); // remove '-D'
7575
options.splice(0, 0, "global");
@@ -96,10 +96,10 @@ module.exports = function promptForInstallation(packages, ...args) {
9696

9797
runCommand(packageManager, options)
9898
.then(_=> {
99-
if (packages == "init") {
99+
if (packages === "init") {
100100
npmGlobalRoot()
101101
.then((root) => {
102-
pathtoInit = path.resolve(root.trim(), "@webpack-cli", "init");
102+
const pathtoInit = path.resolve(root.trim(), "@webpack-cli", "init");
103103
return pathtoInit;
104104
})
105105
.then((pathForInit) => {
@@ -108,7 +108,7 @@ module.exports = function promptForInstallation(packages, ...args) {
108108
.catch((error) => {
109109
console.error(error);
110110
process.exitCode = 1;
111-
})
111+
});
112112
return;
113113
}
114114

0 commit comments

Comments
 (0)