Migrate to eslint

This commit is contained in:
Chris Svenningsen 2020-09-16 12:31:05 -07:00 committed by Josh Perez
parent 0fe7e30398
commit b4e9c278d3
27 changed files with 104 additions and 71 deletions

View file

@ -1,18 +1,21 @@
export function getSearchResultsProps(attributes: any) {
// @ts-ignore
// Matching Whisper.Message API
// eslint-disable-next-line max-len
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
export function getSearchResultsProps(attributes: any): any {
const model = new window.Whisper.Message(attributes);
return model.getPropsForSearchResult();
}
export function getBubbleProps(attributes: any) {
// @ts-ignore
// Matching Whisper.Message API
// eslint-disable-next-line max-len
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
export function getBubbleProps(attributes: any): any {
const model = new window.Whisper.Message(attributes);
return model.getPropsForBubble();
}
export function showSettings() {
// @ts-ignore
export function showSettings(): void {
window.showSettings();
}

View file

@ -1,9 +1,9 @@
import { ipcRenderer } from 'electron';
export function bounceAppIconStart(isCritical = false) {
export function bounceAppIconStart(isCritical = false): void {
ipcRenderer.send('bounce-app-icon-start', isCritical);
}
export function bounceAppIconStop() {
export function bounceAppIconStop(): void {
ipcRenderer.send('bounce-app-icon-stop');
}

View file

@ -1,3 +1,6 @@
export function trigger(name: string, param1?: any, param2?: any) {
// Matching Whisper.events.trigger API
// eslint-disable-next-line max-len
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
export function trigger(name: string, param1?: any, param2?: any): void {
window.Whisper.events.trigger(name, param1, param2);
}

View file

@ -1,4 +1,4 @@
export function getSocketStatus() {
export function getSocketStatus(): number {
const { getSocketStatus: getMessageReceiverStatus } = window;
return getMessageReceiverStatus();

View file

@ -1,7 +1,10 @@
export function put(key: string, value: any) {
// Matching window.storage.put API
// eslint-disable-next-line max-len
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
export function put(key: string, value: any): void {
window.storage.put(key, value);
}
export async function remove(key: string) {
export async function remove(key: string): Promise<void> {
await window.storage.remove(key);
}

View file

@ -2,7 +2,7 @@ export function sendStickerPackSync(
packId: string,
packKey: string,
installed: boolean
) {
): void {
const { ConversationController, textsecure, log } = window;
const ourNumber = textsecure.storage.user.getNumber();
const { wrap, sendOptions } = ConversationController.prepareForSend(

View file

@ -1,9 +1,9 @@
import { ipcRenderer } from 'electron';
export function startUpdate() {
export function startUpdate(): void {
ipcRenderer.send('start-update');
}
export function ackRender() {
export function ackRender(): void {
ipcRenderer.send('show-update-dialog-ack');
}