mirror of
https://github.com/CringeStudios/element-desktop.git
synced 2025-01-18 23:44:59 +01:00
Make eslint happy
This commit is contained in:
parent
d353c68a75
commit
4db0a0ac0c
23
.eslintrc.js
23
.eslintrc.js
@ -1,7 +1,5 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
plugins: [
|
plugins: ["matrix-org"],
|
||||||
"matrix-org",
|
|
||||||
],
|
|
||||||
extends: [
|
extends: [
|
||||||
"plugin:matrix-org/javascript",
|
"plugin:matrix-org/javascript",
|
||||||
],
|
],
|
||||||
@ -19,5 +17,20 @@ module.exports = {
|
|||||||
"indent": "off",
|
"indent": "off",
|
||||||
"prefer-promise-reject-errors": "off",
|
"prefer-promise-reject-errors": "off",
|
||||||
"no-async-promise-executor": "off",
|
"no-async-promise-executor": "off",
|
||||||
}
|
},
|
||||||
}
|
overrides: [{
|
||||||
|
files: ["src/**/*.{ts,tsx}"],
|
||||||
|
extends: [
|
||||||
|
"plugin:matrix-org/typescript",
|
||||||
|
"plugin:matrix-org/react",
|
||||||
|
],
|
||||||
|
rules: {
|
||||||
|
// Things we do that break the ideal style
|
||||||
|
"prefer-promise-reject-errors": "off",
|
||||||
|
"quotes": "off",
|
||||||
|
|
||||||
|
// We disable this while we're transitioning
|
||||||
|
"@typescript-eslint/no-explicit-any": "off",
|
||||||
|
},
|
||||||
|
}],
|
||||||
|
};
|
||||||
|
@ -36,26 +36,32 @@ const CHANNELS = [
|
|||||||
"userDownloadOpen",
|
"userDownloadOpen",
|
||||||
];
|
];
|
||||||
|
|
||||||
|
interface ISource {
|
||||||
|
id: string;
|
||||||
|
name: string;
|
||||||
|
thumbnailURL: string;
|
||||||
|
}
|
||||||
|
|
||||||
contextBridge.exposeInMainWorld(
|
contextBridge.exposeInMainWorld(
|
||||||
"electron",
|
"electron",
|
||||||
{
|
{
|
||||||
on(channel: string, listener: (event: IpcRendererEvent, ...args: any[]) => void) {
|
on(channel: string, listener: (event: IpcRendererEvent, ...args: any[]) => void): void {
|
||||||
if (!CHANNELS.includes(channel)) {
|
if (!CHANNELS.includes(channel)) {
|
||||||
console.error(`Unknown IPC channel ${channel} ignored`);
|
console.error(`Unknown IPC channel ${channel} ignored`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ipcRenderer.on(channel, listener);
|
ipcRenderer.on(channel, listener);
|
||||||
},
|
},
|
||||||
send(channel: string, ...args: any[]) {
|
send(channel: string, ...args: any[]): void {
|
||||||
if (!CHANNELS.includes(channel)) {
|
if (!CHANNELS.includes(channel)) {
|
||||||
console.error(`Unknown IPC channel ${channel} ignored`);
|
console.error(`Unknown IPC channel ${channel} ignored`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ipcRenderer.send(channel, ...args);
|
ipcRenderer.send(channel, ...args);
|
||||||
},
|
},
|
||||||
async getDesktopCapturerSources(options: SourcesOptions) {
|
async getDesktopCapturerSources(options: SourcesOptions): Promise<ISource[]> {
|
||||||
const sources = await desktopCapturer.getSources(options);
|
const sources = await desktopCapturer.getSources(options);
|
||||||
const desktopCapturerSources = [];
|
const desktopCapturerSources: ISource[] = [];
|
||||||
|
|
||||||
for (const source of sources) {
|
for (const source of sources) {
|
||||||
desktopCapturerSources.push({
|
desktopCapturerSources.push({
|
||||||
|
Loading…
Reference in New Issue
Block a user