Skip to content

Commit ebc683f

Browse files
committed
Run linter on electron GUI code
1 parent 6e57155 commit ebc683f

4 files changed

Lines changed: 8 additions & 9 deletions

File tree

gui/electron/main/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,14 @@ handleIpc(IPC_CHANNELS.LOG, (e, type, ...args) => {
127127
});
128128

129129
handleIpc(IPC_CHANNELS.OPEN_URL, (e, url) => {
130-
const allowed_urls = [
130+
const allowedUrls = [
131131
/^steam:\/\//,
132132
/^ms-settings:network$/,
133133
/^https:\/\/(?:.+\.)?slimevr\.dev(?:\/.+)?$/,
134134
/^https:\/\/github\.com\/SlimeVR(?:\/.+)?$/,
135135
/^https:\/\/discord\.gg\/slimevr$/,
136136
];
137-
if (allowed_urls.find((a) => url.match(a))) open(url);
137+
if (allowedUrls.find((a) => url.match(a))) open(url);
138138
else logger.error({ url }, 'attempted to open non-whitelisted URL');
139139
});
140140

@@ -367,9 +367,9 @@ function createWindow() {
367367
}
368368

369369
const checkEnvironmentVariables = () => {
370-
const to_check = ['_JAVA_OPTIONS', 'JAVA_TOOL_OPTIONS'];
370+
const disallowedVars = ['_JAVA_OPTIONS', 'JAVA_TOOL_OPTIONS'];
371371

372-
const set = to_check.filter((env) => !!process.env[env]);
372+
const set = disallowedVars.filter((env) => !!process.env[env]);
373373
if (set.length > 0) {
374374
dialog.showErrorBox(
375375
'SlimeVR',
@@ -400,7 +400,7 @@ const spawnServer = async () => {
400400
if (!javaBin) {
401401
dialog.showErrorBox(
402402
'SlimeVR',
403-
`Couldn't find a compatible Java version, please download Java 17 or higher`
403+
'Unable to find a compatible Java version, please download Java 17 or higher'
404404
);
405405
app.quit();
406406
return;

gui/electron/main/utils.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ export function handleIpc<K extends keyof IpcInvokeMap>(
4444
) => ReturnType<IpcInvokeMap[K]>
4545
) {
4646
ipcMain.handle(channel, (event, ...args) => {
47-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
4847
return handler(event, ...(args as any));
4948
});
5049
}

gui/eslint.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export const gui = [
3939
...globals.jest,
4040
},
4141
},
42-
files: ['src/**/*.{js,jsx,ts,tsx,json}'],
42+
files: ['{electron,src}/**/*.{js,jsx,ts,tsx,json}'],
4343
plugins: {
4444
'@typescript-eslint': tseslint.plugin,
4545
'@stylistic': stylistic,

gui/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
"package:build": "pnpm build && pnpm package",
2424
"preview": "electron-vite preview --config electron.vite.config.ts",
2525
"skipbundler": "vite build",
26-
"lint": "tsc --noEmit && eslint --max-warnings=0 \"src/**/*.{js,jsx,ts,tsx,json}\" && prettier --check \"src/**/*.{js,jsx,ts,tsx,css,scss,md,json}\"",
27-
"lint:fix": "tsc --noEmit && eslint --fix --max-warnings=0 \"src/**/*.{js,jsx,ts,tsx,json}\" && pnpm run format",
26+
"lint": "tsc --noEmit && eslint --max-warnings=0 \"{electron,src}/**/*.{js,jsx,ts,tsx,json}\" && prettier --check \"{electron,src}/**/*.{js,jsx,ts,tsx,css,scss,md,json}\"",
27+
"lint:fix": "tsc --noEmit && eslint --fix --max-warnings=0 \"{electron,src}/**/*.{js,jsx,ts,tsx,json}\" && pnpm run format",
2828
"format": "prettier --write \"{electron,src}/**/*.{js,jsx,ts,tsx,css,scss,md,json}\"",
2929
"javaversion-build": "cd electron/resources/java-version/ && javac JavaVersion.java && jar cvfe JavaVersion.jar JavaVersion JavaVersion.class",
3030
"gen:javaversion": "cd electron/resources/java-version/ && javac JavaVersion.java && jar cvfe JavaVersion.jar JavaVersion JavaVersion.class",

0 commit comments

Comments
 (0)