mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-12 20:18:41 -09:00
Fix @typescript-eslint/unbound-method errors
This commit is contained in:
parent
ae70054e59
commit
b9a52b06c7
6 changed files with 16 additions and 21 deletions
|
|
@ -109,8 +109,7 @@
|
||||||
"@typescript-eslint/no-unsafe-member-access": "off",
|
"@typescript-eslint/no-unsafe-member-access": "off",
|
||||||
"@typescript-eslint/no-unsafe-return": "off",
|
"@typescript-eslint/no-unsafe-return": "off",
|
||||||
"@typescript-eslint/restrict-plus-operands": "off",
|
"@typescript-eslint/restrict-plus-operands": "off",
|
||||||
"@typescript-eslint/restrict-template-expressions": "off",
|
"@typescript-eslint/restrict-template-expressions": "off"
|
||||||
"@typescript-eslint/unbound-method": "off"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@ import chokidar from 'chokidar';
|
||||||
import notify from './notify';
|
import notify from './notify';
|
||||||
import {_import, getDefaultConfig} from './config/import';
|
import {_import, getDefaultConfig} from './config/import';
|
||||||
import _openConfig from './config/open';
|
import _openConfig from './config/open';
|
||||||
import win from './config/windows';
|
|
||||||
import {cfgPath, cfgDir} from './config/paths';
|
import {cfgPath, cfgDir} from './config/paths';
|
||||||
import {getColorMap} from './utils/colors';
|
import {getColorMap} from './utils/colors';
|
||||||
import {parsedConfig, configOptions} from '../lib/config';
|
import {parsedConfig, configOptions} from '../lib/config';
|
||||||
|
|
@ -108,9 +107,7 @@ export const setup = () => {
|
||||||
checkDeprecatedConfig();
|
checkDeprecatedConfig();
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getWin = win.get;
|
export {get as getWin, recordState as winRecord, defaults as windowDefaults} from './config/windows';
|
||||||
export const winRecord = win.recordState;
|
|
||||||
export const windowDefaults = win.defaults;
|
|
||||||
|
|
||||||
export const fixConfigDefaults = (decoratedConfig: configOptions) => {
|
export const fixConfigDefaults = (decoratedConfig: configOptions) => {
|
||||||
const defaultConfig = getDefaultConfig().config!;
|
const defaultConfig = getDefaultConfig().config!;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import Config from 'electron-store';
|
import Config from 'electron-store';
|
||||||
import {BrowserWindow} from 'electron';
|
import {BrowserWindow} from 'electron';
|
||||||
|
|
||||||
const defaults = {
|
export const defaults = {
|
||||||
windowPosition: [50, 50],
|
windowPosition: [50, 50],
|
||||||
windowSize: [540, 380]
|
windowSize: [540, 380]
|
||||||
};
|
};
|
||||||
|
|
@ -9,15 +9,12 @@ const defaults = {
|
||||||
// local storage
|
// local storage
|
||||||
const cfg = new Config({defaults});
|
const cfg = new Config({defaults});
|
||||||
|
|
||||||
export default {
|
export function get() {
|
||||||
defaults,
|
const position = cfg.get('windowPosition', defaults.windowPosition);
|
||||||
get() {
|
const size = cfg.get('windowSize', defaults.windowSize);
|
||||||
const position = cfg.get('windowPosition', defaults.windowPosition);
|
return {position, size};
|
||||||
const size = cfg.get('windowSize', defaults.windowSize);
|
}
|
||||||
return {position, size};
|
export function recordState(win: BrowserWindow) {
|
||||||
},
|
cfg.set('windowPosition', win.getPosition());
|
||||||
recordState(win: BrowserWindow) {
|
cfg.set('windowSize', win.getSize());
|
||||||
cfg.set('windowPosition', win.getPosition());
|
}
|
||||||
cfg.set('windowSize', win.getSize());
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ export class Server extends EventEmitter {
|
||||||
const uid = uuidv4();
|
const uid = uuidv4();
|
||||||
this.id = uid;
|
this.id = uid;
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/unbound-method
|
||||||
ipcMain.on(uid, this.ipcListener);
|
ipcMain.on(uid, this.ipcListener);
|
||||||
|
|
||||||
// we intentionally subscribe to `on` instead of `once`
|
// we intentionally subscribe to `on` instead of `once`
|
||||||
|
|
@ -48,6 +49,7 @@ export class Server extends EventEmitter {
|
||||||
this.removeAllListeners();
|
this.removeAllListeners();
|
||||||
this.wc.removeAllListeners();
|
this.wc.removeAllListeners();
|
||||||
if (this.id) {
|
if (this.id) {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/unbound-method
|
||||||
ipcMain.removeListener(this.id, this.ipcListener);
|
ipcMain.removeListener(this.id, this.ipcListener);
|
||||||
} else {
|
} else {
|
||||||
// mark for `genUid` in constructor
|
// mark for `genUid` in constructor
|
||||||
|
|
|
||||||
|
|
@ -210,8 +210,7 @@ export function newWindow(
|
||||||
});
|
});
|
||||||
rpc.on('open context menu', (selection) => {
|
rpc.on('open context menu', (selection) => {
|
||||||
const {createWindow} = app;
|
const {createWindow} = app;
|
||||||
const {buildFromTemplate} = Menu;
|
Menu.buildFromTemplate(contextMenuTemplate(createWindow, selection)).popup({window});
|
||||||
buildFromTemplate(contextMenuTemplate(createWindow, selection)).popup({window});
|
|
||||||
});
|
});
|
||||||
rpc.on('open hamburger menu', ({x, y}) => {
|
rpc.on('open hamburger menu', ({x, y}) => {
|
||||||
Menu.getApplicationMenu()!.popup({x: Math.ceil(x), y: Math.ceil(y)});
|
Menu.getApplicationMenu()!.popup({x: Math.ceil(x), y: Math.ceil(y)});
|
||||||
|
|
|
||||||
|
|
@ -152,6 +152,7 @@ export default class Term extends React.PureComponent<TermProps> {
|
||||||
return event && (!props.webLinksActivationKey || event[`${props.webLinksActivationKey}Key`]);
|
return event && (!props.webLinksActivationKey || event[`${props.webLinksActivationKey}Key`]);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/unbound-method
|
||||||
this.term.attachCustomKeyEventHandler(this.keyboardHandler);
|
this.term.attachCustomKeyEventHandler(this.keyboardHandler);
|
||||||
this.term.loadAddon(this.fitAddon);
|
this.term.loadAddon(this.fitAddon);
|
||||||
this.term.loadAddon(this.searchAddon);
|
this.term.loadAddon(this.searchAddon);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue