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-return": "off",
|
||||
"@typescript-eslint/restrict-plus-operands": "off",
|
||||
"@typescript-eslint/restrict-template-expressions": "off",
|
||||
"@typescript-eslint/unbound-method": "off"
|
||||
"@typescript-eslint/restrict-template-expressions": "off"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ import chokidar from 'chokidar';
|
|||
import notify from './notify';
|
||||
import {_import, getDefaultConfig} from './config/import';
|
||||
import _openConfig from './config/open';
|
||||
import win from './config/windows';
|
||||
import {cfgPath, cfgDir} from './config/paths';
|
||||
import {getColorMap} from './utils/colors';
|
||||
import {parsedConfig, configOptions} from '../lib/config';
|
||||
|
|
@ -108,9 +107,7 @@ export const setup = () => {
|
|||
checkDeprecatedConfig();
|
||||
};
|
||||
|
||||
export const getWin = win.get;
|
||||
export const winRecord = win.recordState;
|
||||
export const windowDefaults = win.defaults;
|
||||
export {get as getWin, recordState as winRecord, defaults as windowDefaults} from './config/windows';
|
||||
|
||||
export const fixConfigDefaults = (decoratedConfig: configOptions) => {
|
||||
const defaultConfig = getDefaultConfig().config!;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import Config from 'electron-store';
|
||||
import {BrowserWindow} from 'electron';
|
||||
|
||||
const defaults = {
|
||||
export const defaults = {
|
||||
windowPosition: [50, 50],
|
||||
windowSize: [540, 380]
|
||||
};
|
||||
|
|
@ -9,15 +9,12 @@ const defaults = {
|
|||
// local storage
|
||||
const cfg = new Config({defaults});
|
||||
|
||||
export default {
|
||||
defaults,
|
||||
get() {
|
||||
export function get() {
|
||||
const position = cfg.get('windowPosition', defaults.windowPosition);
|
||||
const size = cfg.get('windowSize', defaults.windowSize);
|
||||
return {position, size};
|
||||
},
|
||||
recordState(win: BrowserWindow) {
|
||||
}
|
||||
export function recordState(win: BrowserWindow) {
|
||||
cfg.set('windowPosition', win.getPosition());
|
||||
cfg.set('windowSize', win.getSize());
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ export class Server extends EventEmitter {
|
|||
const uid = uuidv4();
|
||||
this.id = uid;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/unbound-method
|
||||
ipcMain.on(uid, this.ipcListener);
|
||||
|
||||
// we intentionally subscribe to `on` instead of `once`
|
||||
|
|
@ -48,6 +49,7 @@ export class Server extends EventEmitter {
|
|||
this.removeAllListeners();
|
||||
this.wc.removeAllListeners();
|
||||
if (this.id) {
|
||||
// eslint-disable-next-line @typescript-eslint/unbound-method
|
||||
ipcMain.removeListener(this.id, this.ipcListener);
|
||||
} else {
|
||||
// mark for `genUid` in constructor
|
||||
|
|
|
|||
|
|
@ -210,8 +210,7 @@ export function newWindow(
|
|||
});
|
||||
rpc.on('open context menu', (selection) => {
|
||||
const {createWindow} = app;
|
||||
const {buildFromTemplate} = Menu;
|
||||
buildFromTemplate(contextMenuTemplate(createWindow, selection)).popup({window});
|
||||
Menu.buildFromTemplate(contextMenuTemplate(createWindow, selection)).popup({window});
|
||||
});
|
||||
rpc.on('open hamburger menu', ({x, 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`]);
|
||||
};
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/unbound-method
|
||||
this.term.attachCustomKeyEventHandler(this.keyboardHandler);
|
||||
this.term.loadAddon(this.fitAddon);
|
||||
this.term.loadAddon(this.searchAddon);
|
||||
|
|
|
|||
Loading…
Reference in a new issue