add eslint config (#53)

* eslint

* workflow

* lint main
This commit is contained in:
Ven 2022-10-06 00:42:58 +02:00 committed by GitHub
parent e563521416
commit 74c3930e0a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
41 changed files with 141 additions and 87 deletions

View file

@ -63,8 +63,8 @@ function question(question) {
terminal: false,
});
return new Promise((resolve) => {
rl.question(question, (answer) => {
return new Promise(resolve => {
rl.question(question, answer => {
rl.close();
resolve(answer);
});
@ -72,7 +72,7 @@ function question(question) {
}
async function getMenuItem(installations) {
let menuItems = installations.map((info) => ({
let menuItems = installations.map(info => ({
title: info.patched ? "[MODIFIED] " + info.location : info.location,
info,
}));
@ -122,9 +122,9 @@ function getWindowsDirs() {
const appDirs = fs
.readdirSync(location, { withFileTypes: true })
.filter((file) => file.isDirectory())
.filter((file) => file.name.startsWith("app-"))
.map((file) => path.join(location, file.name));
.filter(file => file.isDirectory())
.filter(file => file.name.startsWith("app-"))
.map(file => path.join(location, file.name));
let versions = [];
let patched = false;
@ -169,9 +169,9 @@ function getDarwinDirs() {
const appDirs = fs
.readdirSync(location, { withFileTypes: true })
.filter((file) => file.isDirectory())
.filter((file) => file.name.startsWith("Resources"))
.map((file) => path.join(location, file.name));
.filter(file => file.isDirectory())
.filter(file => file.name.startsWith("Resources"))
.map(file => path.join(location, file.name));
let versions = [];
let patched = false;
@ -239,13 +239,13 @@ function getLinuxDirs() {
} else {
appDirs = fs
.readdirSync(location, { withFileTypes: true })
.filter((file) => file.isDirectory())
.filter(file => file.isDirectory())
.filter(
(file) =>
file =>
file.name.startsWith("app-") ||
file.name === "resources"
)
.map((file) => path.join(location, file.name));
.map(file => path.join(location, file.name));
}
let versions = [];

View file

@ -96,7 +96,7 @@ async function install(installations) {
const requiredFiles = ["index.js", "package.json"];
if (requiredFiles.every((f) => fs.existsSync(path.join(dir, f)))) {
if (requiredFiles.every(f => fs.existsSync(path.join(dir, f)))) {
console.log(
"Successfully patched",
version.name