mirror of
https://github.com/MasterAcnolo/Freedom-Loader.git
synced 2026-09-27 20:11:15 +02:00
feat: implement linter with config file
This commit is contained in:
@@ -97,7 +97,7 @@ function startRPC() {
|
||||
details: `Open Source Download Tools - ${config.version}`,
|
||||
state: "masteracnolo.github.io/FreedomLoader",
|
||||
};
|
||||
rpc.clearActivity()
|
||||
rpc.clearActivity();
|
||||
rpc.setActivity(presence);
|
||||
|
||||
});
|
||||
|
||||
@@ -118,11 +118,11 @@ function registerIpcHandlers(getMainWindow) {
|
||||
ipcMain.on("window-minimize", () => {
|
||||
// Minimize to tray
|
||||
if (configFeatures.systemTray) {
|
||||
getMainWindow()?.hide()
|
||||
getMainWindow()?.hide();
|
||||
logger.info("Window Minimized in SystemTray (Using Minimize Button)");
|
||||
} else {
|
||||
// Native minimize
|
||||
getMainWindow()?.minimize()
|
||||
getMainWindow()?.minimize();
|
||||
logger.info("Window minimized normally");
|
||||
}
|
||||
}
|
||||
@@ -210,7 +210,7 @@ function registerIpcHandlers(getMainWindow) {
|
||||
*/
|
||||
ipcMain.handle("send-report", async (_, params) => {
|
||||
return await sendReport(params);
|
||||
})
|
||||
});
|
||||
|
||||
/**
|
||||
* Updates a runtime feature flag and persists it to disk.
|
||||
|
||||
@@ -95,7 +95,7 @@ function createSystemTray(devMode) {
|
||||
} else {
|
||||
window.show();
|
||||
window.focus();
|
||||
logger.info("Window Restored from SystemTray (Double Click on Tray Icon)")
|
||||
logger.info("Window Restored from SystemTray (Double Click on Tray Icon)");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
40
eslint.config.js
Normal file
40
eslint.config.js
Normal file
@@ -0,0 +1,40 @@
|
||||
const js = require("@eslint/js");
|
||||
const globals = require("globals");
|
||||
|
||||
module.exports = [
|
||||
js.configs.recommended,
|
||||
|
||||
{ignores: ["node_modules/**", "srpm-out/**", "dist/**", "test/**"]},
|
||||
|
||||
{
|
||||
languageOptions: {
|
||||
ecmaVersion: "latest",
|
||||
sourceType: "commonjs",
|
||||
},
|
||||
rules: {
|
||||
"no-unused-vars": ["error", {argsIgnorePattern: "^_"}],
|
||||
"no-console": "off",
|
||||
"semi": ["error", "always"]
|
||||
},
|
||||
|
||||
|
||||
},
|
||||
{
|
||||
files: ["app/**", "server/**", "main.js"],
|
||||
languageOptions: {
|
||||
globals: {...globals.node}
|
||||
}
|
||||
},
|
||||
{
|
||||
files: ["public/**"],
|
||||
languageOptions: {
|
||||
globals: {...globals.browser}
|
||||
}
|
||||
},
|
||||
{
|
||||
files: ["preload.js"],
|
||||
languageOptions: {
|
||||
globals: {...globals.node, ...globals.browser}
|
||||
}
|
||||
}
|
||||
];
|
||||
6
main.js
6
main.js
@@ -48,9 +48,9 @@ const { configFeatures, devMode} = require("./config");
|
||||
*/
|
||||
if (!configFeatures.enableHardwareAcceleration){
|
||||
app.disableHardwareAcceleration();
|
||||
logger.info("Disabled Hardware Acceleration")
|
||||
logger.info("Disabled Hardware Acceleration");
|
||||
} else {
|
||||
logger.info("Enable Hardware Acceleration")
|
||||
logger.info("Enable Hardware Acceleration");
|
||||
}
|
||||
|
||||
if(devMode){
|
||||
@@ -59,7 +59,7 @@ if(devMode){
|
||||
*/
|
||||
const { devtron } = require('@electron/devtron');
|
||||
devtron.install();
|
||||
logger.info("Loaded DevTron Extension")
|
||||
logger.info("Loaded DevTron Extension");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
1077
package-lock.json
generated
1077
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -32,6 +32,8 @@
|
||||
"release:dry-run": "bash scripts/release.sh --dry-run",
|
||||
"test": "jest",
|
||||
"test:unit": "jest test/unit",
|
||||
"lint": "eslint . --format pretty",
|
||||
"lint:fix": "eslint . --fix --format pretty",
|
||||
"update": "npm update"
|
||||
},
|
||||
"dependencies": {
|
||||
@@ -49,10 +51,14 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@electron/devtron": "^2.1.1",
|
||||
"@eslint/js": "^10.0.1",
|
||||
"@jest/globals": "^30.4.1",
|
||||
"@playwright/test": "^1.62.1",
|
||||
"electron": "^44.3.0",
|
||||
"electron-builder": "^26.15.3",
|
||||
"eslint": "^10.10.0",
|
||||
"eslint-formatter-pretty": "^7.1.0",
|
||||
"globals": "^17.12.0",
|
||||
"jest": "^30.4.2",
|
||||
"nodemon": "^3.1.14",
|
||||
"playwright": "^1.62.1"
|
||||
|
||||
@@ -269,7 +269,7 @@ async function init() {
|
||||
infoDiv.classList.add("visible");
|
||||
});
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user