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:
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user