xo: Enable object-curly-spacing.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
Anders Kaseorg
2020-04-25 17:23:25 -07:00
committed by Anders Kaseorg
parent e49a880ed6
commit ba191c3699
42 changed files with 115 additions and 116 deletions

View File

@@ -1,6 +1,6 @@
import { app, dialog } from 'electron';
import { UpdateDownloadedEvent, UpdateInfo, autoUpdater } from 'electron-updater';
import { linuxUpdateNotification } from './linuxupdater'; // Required only in case of linux
import {app, dialog} from 'electron';
import {UpdateDownloadedEvent, UpdateInfo, autoUpdater} from 'electron-updater';
import {linuxUpdateNotification} from './linuxupdater'; // Required only in case of linux
import log from 'electron-log';
import isDev from 'electron-is-dev';
@@ -70,7 +70,7 @@ export function appUpdater(updateFromMenu = false): void {
autoUpdater.removeAllListeners();
const messageText = (updateAvailable) ? ('Unable to download the updates') : ('Unable to check for updates');
const { response } = await dialog.showMessageBox({
const {response} = await dialog.showMessageBox({
type: 'error',
buttons: ['Manual Download', 'Cancel'],
message: messageText,
@@ -86,7 +86,7 @@ export function appUpdater(updateFromMenu = false): void {
// Ask the user if update is available
autoUpdater.on('update-downloaded', async (event: UpdateDownloadedEvent) => {
// Ask user to update the app
const { response } = await dialog.showMessageBox({
const {response} = await dialog.showMessageBox({
type: 'question',
buttons: ['Install and Relaunch', 'Install Later'],
defaultId: 0,

View File

@@ -1,11 +1,11 @@
import { sentryInit } from '../renderer/js/utils/sentry-util';
import { appUpdater } from './autoupdater';
import { setAutoLaunch } from './startup';
import {sentryInit} from '../renderer/js/utils/sentry-util';
import {appUpdater} from './autoupdater';
import {setAutoLaunch} from './startup';
import windowStateKeeper from 'electron-window-state';
import path from 'path';
import fs from 'fs';
import electron, { app, ipcMain, session, dialog } from 'electron';
import electron, {app, ipcMain, session, dialog} from 'electron';
import * as AppMenu from './menu';
import * as BadgeSettings from '../renderer/js/pages/preference/badge-settings';

View File

@@ -1,4 +1,4 @@
import { app, Notification } from 'electron';
import {app, Notification} from 'electron';
import request from 'request';
import semver from 'semver';

View File

@@ -1,5 +1,5 @@
import { app, shell, BrowserWindow, Menu, dialog } from 'electron';
import { appUpdater } from './autoupdater';
import {app, shell, BrowserWindow, Menu, dialog} from 'electron';
import {appUpdater} from './autoupdater';
import AdmZip from 'adm-zip';
import fs from 'fs-extra';
@@ -9,7 +9,7 @@ import Logger from '../renderer/js/utils/logger-util';
import * as ConfigUtil from '../renderer/js/utils/config-util';
import * as LinkUtil from '../renderer/js/utils/link-util';
import * as t from '../renderer/js/utils/translation-util';
import type { ServerOrFunctionalTab } from '../renderer/js/main';
import type {ServerOrFunctionalTab} from '../renderer/js/main';
export interface MenuProps {
tabs: ServerOrFunctionalTab[];
@@ -290,7 +290,7 @@ function getWindowSubmenu(tabs: ServerOrFunctionalTab[], activeTabIndex: number,
}
function getDarwinTpl(props: MenuProps): Electron.MenuItemConstructorOptions[] {
const { tabs, activeTabIndex, enableMenu } = props;
const {tabs, activeTabIndex, enableMenu} = props;
return [{
label: app.name,
@@ -431,7 +431,7 @@ function getDarwinTpl(props: MenuProps): Electron.MenuItemConstructorOptions[] {
}
function getOtherTpl(props: MenuProps): Electron.MenuItemConstructorOptions[] {
const { tabs, activeTabIndex, enableMenu } = props;
const {tabs, activeTabIndex, enableMenu} = props;
return [{
label: t.__('File'),
submenu: [{
@@ -586,7 +586,7 @@ async function resetAppSettings(): Promise<void> {
// We save App's settings/configurations in following files
const settingFiles = ['config/window-state.json', 'config/domain.json', 'config/settings.json', 'config/certificates.json'];
const { response } = await dialog.showMessageBox({
const {response} = await dialog.showMessageBox({
type: 'warning',
buttons: ['YES', 'NO'],
defaultId: 0,

View File

@@ -1,4 +1,4 @@
import { app } from 'electron';
import {app} from 'electron';
import AutoLaunch from 'auto-launch';
import isDev from 'electron-is-dev';

View File

@@ -1,4 +1,4 @@
import Tab, { TabProps } from './tab';
import Tab, {TabProps} from './tab';
export default class FunctionalTab extends Tab {
$closeButton: Element;

View File

@@ -1,10 +1,10 @@
import { ipcRenderer, remote } from 'electron';
import {ipcRenderer, remote} from 'electron';
import * as LinkUtil from '../utils/link-util';
import * as ConfigUtil from '../utils/config-util';
import type WebView from './webview';
const { shell, app } = remote;
const {shell, app} = remote;
const dingSound = new Audio('../resources/sounds/ding.ogg');

View File

@@ -1,6 +1,6 @@
import { ipcRenderer } from 'electron';
import {ipcRenderer} from 'electron';
import Tab, { TabProps } from './tab';
import Tab, {TabProps} from './tab';
import * as SystemUtil from '../utils/system-util';
export default class ServerTab extends Tab {

View File

@@ -1,4 +1,4 @@
import { ipcRenderer, remote } from 'electron';
import {ipcRenderer, remote} from 'electron';
import path from 'path';
import fs from 'fs';
@@ -7,7 +7,7 @@ import * as SystemUtil from '../utils/system-util';
import BaseComponent from './base';
import handleExternalLink from './handle-external-link';
const { app, dialog } = remote;
const {app, dialog} = remote;
const shouldSilentWebview = ConfigUtil.getConfigItem('silent');
@@ -87,7 +87,7 @@ export default class WebView extends BaseComponent {
}
this.$el.addEventListener('page-title-updated', event => {
const { title } = event;
const {title} = event;
this.badgeCount = this.getBadgeCount(title);
this.props.onTitleChange();
});
@@ -106,7 +106,7 @@ export default class WebView extends BaseComponent {
});
this.$el.addEventListener('page-favicon-updated', event => {
const { favicons } = event;
const {favicons} = event;
// This returns a string of favicons URL. If there is a PM counts in unread messages then the URL would be like
// https://chat.zulip.org/static/images/favicon/favicon-pms.png
@@ -136,7 +136,7 @@ export default class WebView extends BaseComponent {
});
this.$el.addEventListener('did-fail-load', event => {
const { errorDescription } = event;
const {errorDescription} = event;
const hasConnectivityErr = SystemUtil.connectivityERR.includes(errorDescription);
if (hasConnectivityErr) {
console.error('error', errorDescription);

View File

@@ -1,8 +1,8 @@
import { ipcRenderer } from 'electron';
import {ipcRenderer} from 'electron';
import { EventEmitter } from 'events';
import {EventEmitter} from 'events';
import { NotificationData, newNotification } from './notification';
import {NotificationData, newNotification} from './notification';
type ListenerType = ((...args: any[]) => void);

View File

@@ -1,10 +1,10 @@
import { remote } from 'electron';
import {remote} from 'electron';
import SendFeedback from '@electron-elements/send-feedback';
import path from 'path';
import fs from 'fs';
const { app } = remote;
const {app} = remote;
interface SendFeedback extends HTMLElement {
[key: string]: any;

View File

@@ -39,7 +39,7 @@
});
}
const { page_params } = zulipWindow;
const {page_params} = zulipWindow;
if (page_params) {
electron_bridge.send_event('zulip-loaded', {
serverLanguage: page_params.default_language
@@ -48,9 +48,9 @@
})();
electron_bridge.on_event('narrow-by-topic', (id: string) => {
const { narrow } = zulipWindow;
const {narrow} = zulipWindow;
const narrowByTopic = narrow.by_topic || narrow.by_subject;
narrowByTopic(id, { trigger: 'notification' });
narrowByTopic(id, {trigger: 'notification'});
});
function attributeListener<T extends EventTarget>(type: string): PropertyDescriptor {

View File

@@ -1,10 +1,10 @@
import { ipcRenderer, remote, clipboard } from 'electron';
import { feedbackHolder } from './feedback';
import {ipcRenderer, remote, clipboard} from 'electron';
import {feedbackHolder} from './feedback';
import path from 'path';
import escape from 'escape-html';
import isDev from 'electron-is-dev';
const { session, app, Menu, dialog } = remote;
const {session, app, Menu, dialog} = remote;
// eslint-disable-next-line import/no-unassigned-import
import './tray';
@@ -284,7 +284,7 @@ class ServerManagerView {
if (preAddedDomains.length > 0) {
// User already has servers added
// ask them before reloading the app
const { response } = await dialog.showMessageBox({
const {response} = await dialog.showMessageBox({
type: 'question',
buttons: ['Yes', 'Later'],
defaultId: 0,
@@ -307,7 +307,7 @@ class ServerManagerView {
failedDomains.push(org);
}
const { title, content } = Messages.enterpriseOrgError(domainsAdded.length, failedDomains);
const {title, content} = Messages.enterpriseOrgError(domainsAdded.length, failedDomains);
dialog.showErrorBox(title, content);
if (DomainUtil.getDomains().length === 0) {
// No orgs present, stop showing loading gif
@@ -490,7 +490,7 @@ class ServerManagerView {
// as that of its parent element.
// This needs to handled only for the add server tooltip and not others.
if (addServer) {
const { top } = SidebarButton.getBoundingClientRect();
const {top} = SidebarButton.getBoundingClientRect();
SidebarTooltip.style.top = `${top}px`;
}
});
@@ -506,7 +506,7 @@ class ServerManagerView {
// To handle position of servers' tooltip due to scrolling of list of organizations
// This could not be handled using CSS, hence the top of the tooltip is made same
// as that of its parent element.
const { top } = this.$serverIconTooltip[index].parentElement.getBoundingClientRect();
const {top} = this.$serverIconTooltip[index].parentElement.getBoundingClientRect();
this.$serverIconTooltip[index].style.top = `${top}px`;
}
@@ -608,7 +608,7 @@ class ServerManagerView {
const proto = Object.create(Object.getPrototypeOf(tab));
const tabClone = Object.assign(proto, tab);
tabClone.webview = { props: {} };
tabClone.webview = {props: {}};
tabClone.webview.props.name = tab.webview.props.name;
delete tabClone.props.webview;
tabs.push(tabClone);
@@ -766,7 +766,7 @@ class ServerManagerView {
{
label: 'Disconnect organization',
click: async () => {
const { response } = await dialog.showMessageBox({
const {response} = await dialog.showMessageBox({
type: 'warning',
buttons: ['YES', 'NO'],
defaultId: 0,
@@ -776,7 +776,7 @@ class ServerManagerView {
if (DomainUtil.removeDomain(index)) {
ipcRenderer.send('reload-full-app');
} else {
const { title, content } = Messages.orgRemovalError(DomainUtil.getDomain(index).url);
const {title, content} = Messages.orgRemovalError(DomainUtil.getDomain(index).url);
dialog.showErrorBox(title, content);
}
}
@@ -799,7 +799,7 @@ class ServerManagerView {
}
];
const contextMenu = Menu.buildFromTemplate(template);
contextMenu.popup({ window: remote.getCurrentWindow() });
contextMenu.popup({window: remote.getCurrentWindow()});
});
}

View File

@@ -1,4 +1,4 @@
import { ipcRenderer } from 'electron';
import {ipcRenderer} from 'electron';
import {
appId, customReply, focusCurrentServer, parseReply
} from './helpers';
@@ -21,7 +21,7 @@ class DarwinNotification {
constructor(title: string, options: NotificationOptions) {
const silent: boolean = ConfigUtil.getConfigItem('silent') || false;
const { icon } = options;
const {icon} = options;
const profilePic = new URL(icon, location.href).href;
this.tag = options.tag;
@@ -84,7 +84,7 @@ class DarwinNotification {
}
}
async notificationHandler({ response }: NotificationHandlerArgs): Promise<void> {
async notificationHandler({response}: NotificationHandlerArgs): Promise<void> {
response = await parseReply(response);
focusCurrentServer();
if (electron_bridge.send_notification_reply_message_supported) {

View File

@@ -1,5 +1,5 @@
import { ipcRenderer } from 'electron';
import { focusCurrentServer } from './helpers';
import {ipcRenderer} from 'electron';
import {focusCurrentServer} from './helpers';
import * as ConfigUtil from '../utils/config-util';

View File

@@ -1,4 +1,4 @@
import { remote } from 'electron';
import {remote} from 'electron';
import Logger from '../utils/logger-util';
@@ -20,8 +20,8 @@ export async function loadBots(): Promise<void> {
botsList.length = 0;
const response = await fetch('/json/users');
if (response.ok) {
const { members } = await response.json();
members.forEach(({ is_bot, full_name }: any) => {
const {members} = await response.json();
members.forEach(({is_bot, full_name}: any) => {
if (is_bot && typeof full_name === 'string') {
const bot = `@${full_name}`;
const mention = `@**${bot.replace(/^@/, '')}**`;

View File

@@ -1,9 +1,9 @@
import { remote } from 'electron';
import {remote} from 'electron';
import electron_bridge from '../electron-bridge';
import { appId, loadBots } from './helpers';
import {appId, loadBots} from './helpers';
import DefaultNotification from './default-notification';
const { app } = remote;
const {app} = remote;
// From https://github.com/felixrieseberg/electron-windows-notifications#appusermodelid
// On windows 8 we have to explicitly set the appUserModelId otherwise notification won't work.

View File

@@ -1,4 +1,4 @@
import { ipcRenderer } from 'electron';
import {ipcRenderer} from 'electron';
export function init($reconnectButton: Element, $settingsButton: Element): void {
$reconnectButton.addEventListener('click', () => {

View File

@@ -1,6 +1,6 @@
'use-strict';
import { remote, OpenDialogOptions } from 'electron';
import {remote, OpenDialogOptions} from 'electron';
import path from 'path';
import BaseComponent from '../../components/base';
@@ -12,7 +12,7 @@ interface AddCertificateProps {
$root: Element;
}
const { dialog } = remote;
const {dialog} = remote;
export default class AddCertificate extends BaseComponent {
props: AddCertificateProps;
@@ -76,9 +76,9 @@ export default class AddCertificate extends BaseComponent {
const showDialogOptions: OpenDialogOptions = {
title: 'Select file',
properties: ['openFile'],
filters: [{ name: 'crt, pem', extensions: ['crt', 'pem'] }]
filters: [{name: 'crt, pem', extensions: ['crt', 'pem']}]
};
const { filePaths, canceled } = await dialog.showOpenDialog(showDialogOptions);
const {filePaths, canceled} = await dialog.showOpenDialog(showDialogOptions);
if (!canceled) {
this._certFile = filePaths[0] || '';
await this.validateAndAdd();

View File

@@ -1,4 +1,4 @@
import electron, { app } from 'electron';
import electron, {app} from 'electron';
import * as ConfigUtil from '../../utils/config-util';

View File

@@ -1,4 +1,4 @@
import { ipcRenderer } from 'electron';
import {ipcRenderer} from 'electron';
import escape from 'escape-html';
import BaseComponent from '../../components/base';

View File

@@ -1,4 +1,4 @@
import { ipcRenderer } from 'electron';
import {ipcRenderer} from 'electron';
import BaseSection from './base-section';
import * as DomainUtil from '../../utils/domain-util';

View File

@@ -1,9 +1,9 @@
import { ipcRenderer, remote, OpenDialogOptions } from 'electron';
import {ipcRenderer, remote, OpenDialogOptions} from 'electron';
import path from 'path';
import fs from 'fs-extra';
const { app, dialog } = remote;
const {app, dialog} = remote;
const currentBrowserWindow = remote.getCurrentWindow();
import BaseSection from './base-section';
@@ -376,7 +376,7 @@ export default class GeneralSection extends BaseSection {
const clearAppDataMessage = 'By clicking proceed you will be removing all added accounts and preferences from Zulip. When the application restarts, it will be as if you are starting Zulip for the first time.';
const getAppPath = path.join(app.getPath('appData'), app.name);
const { response } = await dialog.showMessageBox({
const {response} = await dialog.showMessageBox({
type: 'warning',
buttons: ['YES', 'NO'],
defaultId: 0,
@@ -393,10 +393,10 @@ export default class GeneralSection extends BaseSection {
const showDialogOptions: OpenDialogOptions = {
title: 'Select file',
properties: ['openFile'],
filters: [{ name: 'CSS file', extensions: ['css'] }]
filters: [{name: 'CSS file', extensions: ['css']}]
};
const { filePaths, canceled } = await dialog.showOpenDialog(showDialogOptions);
const {filePaths, canceled} = await dialog.showOpenDialog(showDialogOptions);
if (!canceled) {
ConfigUtil.setConfigItem('customCSS', filePaths[0]);
ipcRenderer.send('forward-message', 'hard-reload');
@@ -468,7 +468,7 @@ export default class GeneralSection extends BaseSection {
properties: ['openDirectory']
};
const { filePaths, canceled } = await dialog.showOpenDialog(showDialogOptions);
const {filePaths, canceled} = await dialog.showOpenDialog(showDialogOptions);
if (!canceled) {
ConfigUtil.setConfigItem('downloadsPath', filePaths[0]);
const downloadFolderPath: HTMLElement = document.querySelector('.download-folder-path');

View File

@@ -1,4 +1,4 @@
import { ipcRenderer } from 'electron';
import {ipcRenderer} from 'electron';
import BaseSection from './base-section';
import * as ConfigUtil from '../../utils/config-util';

View File

@@ -1,11 +1,11 @@
import { ipcRenderer, remote } from 'electron';
import {ipcRenderer, remote} from 'electron';
import BaseComponent from '../../components/base';
import * as DomainUtil from '../../utils/domain-util';
import * as LinkUtil from '../../utils/link-util';
import * as t from '../../utils/translation-util';
const { dialog } = remote;
const {dialog} = remote;
interface NewServerFormProps {
$root: Element;

View File

@@ -1,4 +1,4 @@
import { ipcRenderer } from 'electron';
import {ipcRenderer} from 'electron';
import BaseComponent from '../../components/base';
import Nav from './nav';

View File

@@ -1,11 +1,11 @@
import { remote, ipcRenderer } from 'electron';
import {remote, ipcRenderer} from 'electron';
import BaseComponent from '../../components/base';
import * as DomainUtil from '../../utils/domain-util';
import * as Messages from '../../../../resources/messages';
import * as t from '../../utils/translation-util';
const { dialog } = remote;
const {dialog} = remote;
interface ServerInfoFormProps {
$root: Element;
@@ -66,7 +66,7 @@ export default class ServerInfoForm extends BaseComponent {
initActions(): void {
this.$deleteServerButton.addEventListener('click', async () => {
const { response } = await dialog.showMessageBox({
const {response} = await dialog.showMessageBox({
type: 'warning',
buttons: [t.__('YES'), t.__('NO')],
defaultId: 0,
@@ -76,7 +76,7 @@ export default class ServerInfoForm extends BaseComponent {
if (DomainUtil.removeDomain(this.props.index)) {
ipcRenderer.send('reload-full-app');
} else {
const { title, content } = Messages.orgRemovalError(DomainUtil.getDomain(this.props.index).url);
const {title, content} = Messages.orgRemovalError(DomainUtil.getDomain(this.props.index).url);
dialog.showErrorBox(title, content);
}
}

View File

@@ -1,4 +1,4 @@
import { contextBridge, ipcRenderer, webFrame } from 'electron';
import {contextBridge, ipcRenderer, webFrame} from 'electron';
import fs from 'fs';
import * as SetupSpellChecker from './spellchecker';
@@ -54,7 +54,7 @@ ipcRenderer.on('show-notification-settings', () => {
}, 100);
});
electron_bridge.once('zulip-loaded', ({ serverLanguage }) => {
electron_bridge.once('zulip-loaded', ({serverLanguage}) => {
// Get the default language of the server
if (serverLanguage) {
// Init spellchecker

View File

@@ -1,5 +1,5 @@
import type { Subject } from 'rxjs';
import { SpellCheckHandler, ContextMenuListener, ContextMenuBuilder } from 'electron-spellchecker';
import type {Subject} from 'rxjs';
import {SpellCheckHandler, ContextMenuListener, ContextMenuBuilder} from 'electron-spellchecker';
import * as ConfigUtil from './utils/config-util';
import Logger from './utils/logger-util';

View File

@@ -1,9 +1,9 @@
import { ipcRenderer, remote, WebviewTag, NativeImage } from 'electron';
import {ipcRenderer, remote, WebviewTag, NativeImage} from 'electron';
import path from 'path';
import * as ConfigUtil from './utils/config-util';
const { Tray, Menu, nativeImage, BrowserWindow, nativeTheme } = remote;
const {Tray, Menu, nativeImage, BrowserWindow, nativeTheme} = remote;
let tray: Electron.Tray;

View File

@@ -1,12 +1,12 @@
import { remote } from 'electron';
import { JsonDB } from 'node-json-db';
import { initSetUp } from './default-util';
import {remote} from 'electron';
import {JsonDB} from 'node-json-db';
import {initSetUp} from './default-util';
import fs from 'fs';
import path from 'path';
import Logger from './logger-util';
const { app, dialog } = remote;
const {app, dialog} = remote;
initSetUp();

View File

@@ -1,4 +1,4 @@
import { JsonDB } from 'node-json-db';
import {JsonDB} from 'node-json-db';
import fs from 'fs';
import path from 'path';
@@ -16,7 +16,7 @@ let app: Electron.App = null;
/* To make the util runnable in both main and renderer process */
if (process.type === 'renderer') {
const { remote } = electron;
const {remote} = electron;
dialog = remote.dialog;
app = remote.app;
} else {

View File

@@ -1,17 +1,17 @@
import { JsonDB } from 'node-json-db';
import {JsonDB} from 'node-json-db';
import escape from 'escape-html';
import request from 'request';
import fs from 'fs';
import path from 'path';
import Logger from './logger-util';
import { remote } from 'electron';
import {remote} from 'electron';
import * as RequestUtil from './request-util';
import * as EnterpriseUtil from './enterprise-util';
import * as Messages from '../../../resources/messages';
const { app, dialog } = remote;
const {app, dialog} = remote;
export interface ServerConf {
url: string;
@@ -72,7 +72,7 @@ function updateDomain(index: number, server: ServerConf): void {
}
export async function addDomain(server: ServerConf): Promise<void> {
const { ignoreCerts } = server;
const {ignoreCerts} = server;
if (server.icon) {
const localIconUrl = await saveServerIcon(server, ignoreCerts);
server.icon = localIconUrl;
@@ -118,7 +118,7 @@ async function checkCertError(domain: string, serverConf: ServerConf, error: str
const certErrorMessage = Messages.certErrorMessage(domain, error);
const certErrorDetail = Messages.certErrorDetail();
const { response } = await dialog.showMessageBox({
const {response} = await dialog.showMessageBox({
type: 'warning',
buttons: ['Yes', 'No'],
defaultId: 1,
@@ -185,7 +185,7 @@ async function getServerSettings(domain: string, ignoreCerts = false): Promise<S
return new Promise((resolve, reject) => {
request(serverSettingsOptions, (error: string, response: any) => {
if (!error && response.statusCode === 200) {
const { realm_name, realm_uri, realm_icon } = JSON.parse(response.body);
const {realm_name, realm_uri, realm_icon} = JSON.parse(response.body);
if (
typeof realm_name === 'string' &&
typeof realm_uri === 'string' &&
@@ -251,7 +251,7 @@ export async function saveServerIcon(server: ServerConf, ignoreCerts = false): P
export async function updateSavedServer(url: string, index: number): Promise<void> {
// Does not promise successful update
const oldIcon = getDomain(index).icon;
const { ignoreCerts } = getDomain(index);
const {ignoreCerts} = getDomain(index);
try {
const newServerConf = await checkDomain(url, ignoreCerts, true);
const localIconUrl = await saveServerIcon(newServerConf, ignoreCerts);
@@ -294,7 +294,7 @@ function generateFilePath(url: string): string {
const extension = path.extname(url).split('?')[0];
let hash = 5381;
let { length } = url;
let {length} = url;
while (length) {
hash = (hash * 33) ^ url.charCodeAt(--length);

View File

@@ -1,4 +1,4 @@
import { shell } from 'electron';
import {shell} from 'electron';
import escape from 'escape-html';
import fs from 'fs';
import os from 'os';

View File

@@ -1,4 +1,4 @@
import { JsonDB } from 'node-json-db';
import {JsonDB} from 'node-json-db';
import fs from 'fs';
import path from 'path';
@@ -14,7 +14,7 @@ const logger = new Logger({
});
/* To make the util runnable in both main and renderer process */
const { dialog, app } = remote;
const {dialog, app} = remote;
let db: JsonDB;

View File

@@ -1,6 +1,6 @@
import { Console as NodeConsole } from 'console'; // eslint-disable-line node/prefer-global/console
import { initSetUp } from './default-util';
import { sentryInit, captureException } from './sentry-util';
import {Console as NodeConsole} from 'console'; // eslint-disable-line node/prefer-global/console
import {initSetUp} from './default-util';
import {sentryInit, captureException} from './sentry-util';
import fs from 'fs';
import os from 'os';
@@ -29,7 +29,7 @@ if (process.type === 'renderer') {
// Report Errors to Sentry only if it is enabled in settings
// Gets the value of reportErrors from config-util for renderer process
// For main process, sentryInit() is handled in index.js
const { ipcRenderer } = electron;
const {ipcRenderer} = electron;
ipcRenderer.send('error-reporting');
ipcRenderer.on('error-reporting-val', (_event: any, errorReporting: boolean) => {
reportErrors = errorReporting;
@@ -71,7 +71,7 @@ export default class Logger {
process.nextTick(() => this.trimLog(file));
}
const fileStream = fs.createWriteStream(file, { flags: 'a' });
const fileStream = fs.createWriteStream(file, {flags: 'a'});
const nodeConsole = new NodeConsole(fileStream);
this.nodeConsole = nodeConsole;

View File

@@ -1,4 +1,4 @@
import { ipcRenderer } from 'electron';
import {ipcRenderer} from 'electron';
import type WebView from '../components/webview';
import backoff from 'backoff';

View File

@@ -1,4 +1,4 @@
import { remote } from 'electron';
import {remote} from 'electron';
import fs from 'fs';
import path from 'path';
@@ -8,7 +8,7 @@ import * as ProxyUtil from './proxy-util';
import * as CertificateUtil from './certificate-util';
import * as SystemUtil from './system-util';
const { app } = remote;
const {app} = remote;
const logger = new Logger({
file: 'request-util.log',
@@ -56,7 +56,7 @@ export function requestOptions(domain: string, ignoreCerts: boolean): RequestUti
ca: certificateLocation ? certificateLocation : '',
proxy: proxyEnabled ? ProxyUtil.getProxy(domain) : '',
ecdhCurve: 'auto',
headers: { 'User-Agent': SystemUtil.getUserAgent() },
headers: {'User-Agent': SystemUtil.getUserAgent()},
rejectUnauthorized: !ignoreCerts
};
}

View File

@@ -1,4 +1,4 @@
import { init } from '@sentry/electron';
import {init} from '@sentry/electron';
import isDev from 'electron-is-dev';
@@ -15,4 +15,4 @@ export const sentryInit = (): void => {
}
};
export { captureException } from '@sentry/electron';
export {captureException} from '@sentry/electron';

View File

@@ -1,4 +1,4 @@
import { ipcRenderer } from 'electron';
import {ipcRenderer} from 'electron';
import os from 'os';

View File

@@ -11,5 +11,5 @@ const appLocale = ConfigUtil.getConfigItem('appLanguage');
/* If no locale present in the json, en is set default */
export function __(phrase: string): string {
return i18n.__({ phrase, locale: appLocale ? appLocale : 'en' });
return i18n.__({phrase, locale: appLocale ? appLocale : 'en'});
}

View File

@@ -216,7 +216,6 @@
}
],
"no-warning-comments": "off",
"object-curly-spacing": "off",
"strict": "error",
"unicorn/string-content": "off"
},