Switch from eslint to oxlint (#34166)

* Fix type imports

* Fix jsdoc

* Fixup types

* Fix stray awaits on non-thenables

* Fixup imports

* Fix splats

* Fix this-context on callbacks

* Memoise react contexts

* Prefer find/flatMap

* Make oxlint happier about our React keys

* Avoid unsafe default function params

* Fixup jsdoc

* Fixup contexts

* Switch from eslint to oxlint

* Some oxlint-related tweaks

* Iterate

* Partial revert to defer some changes and shrink diff

* Iterate

* Add eslint-plugin-element-call and enable the copyright rule

* Set strictStorePkgContentCheck

* Iterate

* Make sonar happy

* Fix new lints
This commit is contained in:
Michael Telatynski
2026-07-10 09:47:41 +00:00
committed by GitHub
parent 549dd1b7a8
commit 15c85ec50f
176 changed files with 1294 additions and 2876 deletions
+2
View File
@@ -385,11 +385,13 @@ app.on("ready", async () => {
desktopCapturer
.getSources({ types: ["screen", "window"] })
.then((sources) => {
// oxlint-disable-next-line promise/no-callback-in-promise
callback({ video: sources[0] });
})
.catch((err) => {
// If the user cancels the dialog an error occurs "Failed to get sources"
console.error("Wayland: failed to get user-selected source:", err);
// oxlint-disable-next-line promise/no-callback-in-promise
callback({ video: { id: "", name: "" } }); // The promise does not return if no dummy is passed here as source
});
} else {
+1 -1
View File
@@ -144,7 +144,7 @@ ipcMain.on("ipcCall", async function (_ev: IpcMainEvent, payload) {
}));
break;
case "callDisplayMediaCallback":
await getDisplayMediaCallback()?.({ video: args[0] });
getDisplayMediaCallback()?.({ video: args[0] });
setDisplayMediaCallback(null);
ret = null;
break;
+2 -2
View File
@@ -113,7 +113,7 @@ export class AppLocalization {
locales = [locales];
}
const loadedLocales = locales.filter((locale) => {
const chosenLocale = locales.find((locale) => {
const translations = this.fetchTranslationJson(locale);
if (translations !== null) {
counterpart.registerTranslations(locale, translations);
@@ -121,7 +121,7 @@ export class AppLocalization {
return !!translations;
});
counterpart.setLocale(loadedLocales[0]);
counterpart.setLocale(chosenLocale!);
this.store.set(AppLocalization.STORE_KEY, locales);
this.resetLocalizedUI();
+1 -1
View File
@@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details.
// This file is compiled to CommonJS rather than ESM otherwise the browser chokes on the import statement.
import { ipcRenderer, contextBridge, IpcRendererEvent } from "electron";
import { ipcRenderer, contextBridge, type IpcRendererEvent } from "electron";
import type { ConfigOptions } from "./config.js" with { "resolution-mode": "import" };
// Expose only expected IPC wrapper APIs to the renderer process to avoid