-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.js
executable file
·26 lines (21 loc) · 706 Bytes
/
install.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env node
const { execSync } = require("child_process");
const packagesToInstall = [
"@babel/eslint-parser",
"@babel/core",
"eslint",
"eslint-config-prettier",
"eslint-plugin-prettier",
"prettier",
"eslint-formatter-pretty",
];
if (process.argv.includes("typescript")) {
packagesToInstall.push("@typescript-eslint/eslint-plugin", "@typescript-eslint/parser");
}
if (process.argv.includes("react")) {
packagesToInstall.push("eslint-plugin-react");
}
console.log(`eslint-config-a1motion: Installing packages: ${packagesToInstall.map((a) => `'${a}'`).join(", ")}`);
execSync(`yarn add --dev -W ${packagesToInstall.map((pkg) => `${pkg}`).join(" ")}`, {
stdio: "inherit",
});