Remove unnecessary eslint-disable directives

This commit is contained in:
Labhansh Agrawal 2020-03-02 23:29:56 +05:30 committed by Benjamin Staneck
parent 833b222e2a
commit 039b90aa65
26 changed files with 1 additions and 84 deletions

View file

@ -54,7 +54,6 @@ const _watch = () => {
// https://github.com/zeit/hyper/pull/1772 // https://github.com/zeit/hyper/pull/1772
_watcher = fs.watchFile(cfgPath, {interval: 2000}, (curr, prev) => { _watcher = fs.watchFile(cfgPath, {interval: 2000}, (curr, prev) => {
if (!curr.mtime || curr.mtime.getTime() === 0) { if (!curr.mtime || curr.mtime.getTime() === 0) {
//eslint-disable-next-line no-console
console.error('error watching config'); console.error('error watching config');
} else if (curr.mtime.getTime() !== prev.mtime.getTime()) { } else if (curr.mtime.getTime() !== prev.mtime.getTime()) {
onChange(); onChange();
@ -73,13 +72,11 @@ const _watch = () => {
} }
}); });
} catch (e) { } catch (e) {
//eslint-disable-next-line no-console
console.error('Failed to watch config file:', cfgPath, e); console.error('Failed to watch config file:', cfgPath, e);
return; return;
} }
_watcher.on('change', onChange); _watcher.on('change', onChange);
_watcher.on('error', error => { _watcher.on('error', error => {
//eslint-disable-next-line no-console
console.error('error watching config', error); console.error('error watching config', error);
}); });
} }

View file

@ -89,7 +89,6 @@ const _importConf = () => {
try { try {
migrateHyper2Config(); migrateHyper2Config();
} catch (err) { } catch (err) {
//eslint-disable-next-line no-console
console.error(err); console.error(err);
} }
@ -102,7 +101,6 @@ const _importConf = () => {
const mapping = JSON.parse(content) as Record<string, string | string[]>; const mapping = JSON.parse(content) as Record<string, string | string[]>;
_defaultCfg.keymaps = mapping; _defaultCfg.keymaps = mapping;
} catch (err) { } catch (err) {
//eslint-disable-next-line no-console
console.error(err); console.error(err);
} }
@ -115,7 +113,6 @@ const _importConf = () => {
return {userCfg: defaultCfgRaw, defaultCfg: _defaultCfg}; return {userCfg: defaultCfgRaw, defaultCfg: _defaultCfg};
} }
} catch (err) { } catch (err) {
//eslint-disable-next-line no-console
console.log(err); console.log(err);
} }
}; };

View file

@ -64,12 +64,10 @@ if (process.platform === 'win32') {
if (yes) { if (yes) {
return shell.openItem(cfgPath); return shell.openItem(cfgPath);
} }
//eslint-disable-next-line no-console
console.warn('No default app set for .js files, using notepad.exe fallback'); console.warn('No default app set for .js files, using notepad.exe fallback');
return openNotepad(cfgPath); return openNotepad(cfgPath);
}) })
.catch(err => { .catch(err => {
//eslint-disable-next-line no-console
console.error('Open config with default app error:', err); console.error('Open config with default app error:', err);
return openNotepad(cfgPath); return openNotepad(cfgPath);
}); });

View file

@ -32,7 +32,6 @@ if (isDev) {
statSync(devCfg); statSync(devCfg);
cfgPath = devCfg; cfgPath = devCfg;
cfgDir = devDir; cfgDir = devDir;
//eslint-disable-next-line no-console
console.log('using config file:', cfgPath); console.log('using config file:', cfgPath);
} catch (err) { } catch (err) {
// ignore // ignore

View file

@ -3,11 +3,8 @@ if (['--help', '-v', '--version'].includes(process.argv[1])) {
// eslint-disable-next-line @typescript-eslint/no-var-requires // eslint-disable-next-line @typescript-eslint/no-var-requires
const {version} = require('./package'); const {version} = require('./package');
const configLocation = process.platform === 'win32' ? `${process.env.userprofile}\\.hyper.js` : '~/.hyper.js'; const configLocation = process.platform === 'win32' ? `${process.env.userprofile}\\.hyper.js` : '~/.hyper.js';
//eslint-disable-next-line no-console
console.log(`Hyper version ${version}`); console.log(`Hyper version ${version}`);
//eslint-disable-next-line no-console
console.log('Hyper does not accept any command line arguments. Please modify the config file instead.'); console.log('Hyper does not accept any command line arguments. Please modify the config file instead.');
//eslint-disable-next-line no-console
console.log(`Hyper configuration file located at: ${configLocation}`); console.log(`Hyper configuration file located at: ${configLocation}`);
process.exit(); process.exit();
} }
@ -104,12 +101,10 @@ app.getLastFocusedWindow = () => {
}); });
}; };
//eslint-disable-next-line no-console
console.log('Disabling Chromium GPU blacklist'); console.log('Disabling Chromium GPU blacklist');
app.commandLine.appendSwitch('ignore-gpu-blacklist'); app.commandLine.appendSwitch('ignore-gpu-blacklist');
if (isDev) { if (isDev) {
//eslint-disable-next-line no-console
console.log('running in dev mode'); console.log('running in dev mode');
// Override default appVersion which is set from package.json // Override default appVersion which is set from package.json
@ -119,19 +114,16 @@ if (isDev) {
} }
}); });
} else { } else {
//eslint-disable-next-line no-console
console.log('running in prod mode'); console.log('running in prod mode');
} }
const url = `file://${resolve(isDev ? __dirname : app.getAppPath(), 'index.html')}`; const url = `file://${resolve(isDev ? __dirname : app.getAppPath(), 'index.html')}`;
//eslint-disable-next-line no-console
console.log('electron will open', url); console.log('electron will open', url);
function installDevExtensions(isDev_: boolean) { function installDevExtensions(isDev_: boolean) {
if (!isDev_) { if (!isDev_) {
return Promise.resolve([]); return Promise.resolve([]);
} }
// eslint-disable-next-line @typescript-eslint/no-var-requires
const installer = require('electron-devtools-installer') as typeof import('electron-devtools-installer'); const installer = require('electron-devtools-installer') as typeof import('electron-devtools-installer');
const extensions = ['REACT_DEVELOPER_TOOLS', 'REDUX_DEVTOOLS'] as const; const extensions = ['REACT_DEVELOPER_TOOLS', 'REDUX_DEVTOOLS'] as const;
@ -248,11 +240,9 @@ app.on('ready', () =>
if (!isDev) { if (!isDev) {
// check if should be set/removed as default ssh protocol client // check if should be set/removed as default ssh protocol client
if (config.getConfig().defaultSSHApp && !app.isDefaultProtocolClient('ssh')) { if (config.getConfig().defaultSSHApp && !app.isDefaultProtocolClient('ssh')) {
//eslint-disable-next-line no-console
console.log('Setting Hyper as default client for ssh:// protocol'); console.log('Setting Hyper as default client for ssh:// protocol');
app.setAsDefaultProtocolClient('ssh'); app.setAsDefaultProtocolClient('ssh');
} else if (!config.getConfig().defaultSSHApp && app.isDefaultProtocolClient('ssh')) { } else if (!config.getConfig().defaultSSHApp && app.isDefaultProtocolClient('ssh')) {
//eslint-disable-next-line no-console
console.log('Removing Hyper from default client for ssh:// protocol'); console.log('Removing Hyper from default client for ssh:// protocol');
app.removeAsDefaultProtocolClient('ssh'); app.removeAsDefaultProtocolClient('ssh');
} }
@ -260,7 +250,6 @@ app.on('ready', () =>
} }
}) })
.catch(err => { .catch(err => {
//eslint-disable-next-line no-console
console.error('Error while loading devtools extensions', err); console.error('Error while loading devtools extensions', err);
}) })
); );

View file

@ -10,11 +10,9 @@ export default function fetchNotifications(win: BrowserWindow) {
const retry = (err?: any) => { const retry = (err?: any) => {
setTimeout(() => fetchNotifications(win), ms('30m')); setTimeout(() => fetchNotifications(win), ms('30m'));
if (err) { if (err) {
//eslint-disable-next-line no-console
console.error('Notification messages fetch error', err.stack); console.error('Notification messages fetch error', err.stack);
} }
}; };
//eslint-disable-next-line no-console
console.log('Checking for notification messages'); console.log('Checking for notification messages');
fetch(NEWS_URL, { fetch(NEWS_URL, {
headers: { headers: {
@ -29,7 +27,6 @@ export default function fetchNotifications(win: BrowserWindow) {
throw new Error('Bad response'); throw new Error('Bad response');
} }
if (message === '') { if (message === '') {
//eslint-disable-next-line no-console
console.log('No matching notification messages'); console.log('No matching notification messages');
} else { } else {
rpc.emit('add notification', message); rpc.emit('add notification', message);

View file

@ -12,10 +12,8 @@ let win: BrowserWindow;
let buffer: string[][] = []; let buffer: string[][] = [];
function notify(title: string, body = '', details: any = {}) { function notify(title: string, body = '', details: any = {}) {
//eslint-disable-next-line no-console
console.log(`[Notification] ${title}: ${body}`); console.log(`[Notification] ${title}: ${body}`);
if (details.error) { if (details.error) {
//eslint-disable-next-line no-console
console.error(details.error); console.error(details.error);
} }
if (win) { if (win) {

View file

@ -1,3 +1,4 @@
// eslint-disable-next-line eslint-comments/disable-enable-pair
/* eslint-disable @typescript-eslint/no-use-before-define */ /* eslint-disable @typescript-eslint/no-use-before-define */
import {app, dialog, BrowserWindow, App} from 'electron'; import {app, dialog, BrowserWindow, App} from 'electron';
import {resolve, basename} from 'path'; import {resolve, basename} from 'path';
@ -102,7 +103,6 @@ function updatePlugins({force = false} = {}) {
updating = false; updating = false;
if (err) { if (err) {
//eslint-disable-next-line no-console
notify('Error updating plugins.', err, {error: err}); notify('Error updating plugins.', err, {error: err});
} else { } else {
// flag successful plugin update // flag successful plugin update
@ -177,7 +177,6 @@ export const getLoadedPluginVersions = () => {
// to prevent slowness // to prevent slowness
if (cache.get('hyper.plugins') !== id || process.env.HYPER_FORCE_UPDATE) { if (cache.get('hyper.plugins') !== id || process.env.HYPER_FORCE_UPDATE) {
// install immediately if the user changed plugins // install immediately if the user changed plugins
//eslint-disable-next-line no-console
console.log('plugins have changed / not init, scheduling plugins installation'); console.log('plugins have changed / not init, scheduling plugins installation');
setTimeout(() => { setTimeout(() => {
updatePlugins(); updatePlugins();
@ -287,16 +286,13 @@ function requirePlugins(): any[] {
try { try {
mod._version = require(resolve(path_, 'package.json')).version; mod._version = require(resolve(path_, 'package.json')).version;
} catch (err) { } catch (err) {
//eslint-disable-next-line no-console
console.warn(`No package.json found in ${path_}`); console.warn(`No package.json found in ${path_}`);
} }
//eslint-disable-next-line no-console
console.log(`Plugin ${mod._name} (${mod._version}) loaded.`); console.log(`Plugin ${mod._name} (${mod._version}) loaded.`);
return mod; return mod;
} catch (err) { } catch (err) {
if (err.code === 'MODULE_NOT_FOUND') { if (err.code === 'MODULE_NOT_FOUND') {
//eslint-disable-next-line no-console
console.warn(`Plugin error while loading "${basename(path_)}" (${path_}): ${err.message}`); console.warn(`Plugin error while loading "${basename(path_)}" (${path_}): ${err.message}`);
} else { } else {
notify('Plugin error!', `Plugin "${basename(path_)}" failed to load (${err.message})`, {error: err}); notify('Plugin error!', `Plugin "${basename(path_)}" failed to load (${err.message})`, {error: err});

View file

@ -12,7 +12,6 @@ export const install = (fn: Function) => {
}; };
spawnQueue.push(end => { spawnQueue.push(end => {
const cmd = [process.execPath, yarn].concat(args).join(' '); const cmd = [process.execPath, yarn].concat(args).join(' ');
//eslint-disable-next-line no-console
console.log('Launching yarn:', cmd); console.log('Launching yarn:', cmd);
cp.execFile( cp.execFile(

View file

@ -100,7 +100,6 @@ export default class Session extends EventEmitter {
} }
init({uid, rows, cols: columns, cwd, shell, shellArgs}: SessionOptions) { init({uid, rows, cols: columns, cwd, shell, shellArgs}: SessionOptions) {
// eslint-disable-next-line @typescript-eslint/no-var-requires
const osLocale = require('os-locale') as typeof import('os-locale'); const osLocale = require('os-locale') as typeof import('os-locale');
const baseEnv = Object.assign( const baseEnv = Object.assign(
{}, {},
@ -176,7 +175,6 @@ export default class Session extends EventEmitter {
if (this.pty) { if (this.pty) {
this.pty.write(data); this.pty.write(data);
} else { } else {
//eslint-disable-next-line no-console
console.warn('Warning: Attempted to write to a session with no pty'); console.warn('Warning: Attempted to write to a session with no pty');
} }
} }
@ -186,11 +184,9 @@ export default class Session extends EventEmitter {
try { try {
this.pty.resize(cols, rows); this.pty.resize(cols, rows);
} catch (err) { } catch (err) {
//eslint-disable-next-line no-console
console.error(err.stack); console.error(err.stack);
} }
} else { } else {
//eslint-disable-next-line no-console
console.warn('Warning: Attempted to resize a session with no pty'); console.warn('Warning: Attempted to resize a session with no pty');
} }
} }
@ -200,11 +196,9 @@ export default class Session extends EventEmitter {
try { try {
this.pty.kill(); this.pty.kill();
} catch (err) { } catch (err) {
//eslint-disable-next-line no-console
console.error('exit error', err.stack); console.error('exit error', err.stack);
} }
} else { } else {
//eslint-disable-next-line no-console
console.warn('Warning: Attempted to destroy a session with no pty'); console.warn('Warning: Attempted to destroy a session with no pty');
} }
this.emit('exit'); this.emit('exit');

View file

@ -11,17 +11,14 @@ const regParts = [
function addValues(hyperKey: Registry.Registry, commandKey: Registry.Registry, callback: Function) { function addValues(hyperKey: Registry.Registry, commandKey: Registry.Registry, callback: Function) {
hyperKey.set(regParts[1].name, Registry.REG_SZ, regParts[1].value, error => { hyperKey.set(regParts[1].name, Registry.REG_SZ, regParts[1].value, error => {
if (error) { if (error) {
//eslint-disable-next-line no-console
console.error(error.message); console.error(error.message);
} }
hyperKey.set(regParts[2].name, Registry.REG_SZ, regParts[2].value, err => { hyperKey.set(regParts[2].name, Registry.REG_SZ, regParts[2].value, err => {
if (err) { if (err) {
//eslint-disable-next-line no-console
console.error(err.message); console.error(err.message);
} }
commandKey.set(regParts[0].name, Registry.REG_SZ, regParts[0].value, err_ => { commandKey.set(regParts[0].name, Registry.REG_SZ, regParts[0].value, err_ => {
if (err_) { if (err_) {
//eslint-disable-next-line no-console
console.error(err_.message); console.error(err_.message);
} }
callback(); callback();
@ -39,13 +36,11 @@ export const add = (callback: Function) => {
hyperKey.keyExists((error, exists) => { hyperKey.keyExists((error, exists) => {
if (error) { if (error) {
//eslint-disable-next-line no-console
console.error(error.message); console.error(error.message);
} }
if (exists) { if (exists) {
commandKey.keyExists((err_, exists_) => { commandKey.keyExists((err_, exists_) => {
if (err_) { if (err_) {
//eslint-disable-next-line no-console
console.error(err_.message); console.error(err_.message);
} }
if (exists_) { if (exists_) {
@ -53,7 +48,6 @@ export const add = (callback: Function) => {
} else { } else {
commandKey.create(err => { commandKey.create(err => {
if (err) { if (err) {
//eslint-disable-next-line no-console
console.error(err.message); console.error(err.message);
} }
addValues(hyperKey, commandKey, callback); addValues(hyperKey, commandKey, callback);
@ -63,12 +57,10 @@ export const add = (callback: Function) => {
} else { } else {
hyperKey.create(err => { hyperKey.create(err => {
if (err) { if (err) {
//eslint-disable-next-line no-console
console.error(err.message); console.error(err.message);
} }
commandKey.create(err_ => { commandKey.create(err_ => {
if (err_) { if (err_) {
//eslint-disable-next-line no-console
console.error(err_.message); console.error(err_.message);
} }
addValues(hyperKey, commandKey, callback); addValues(hyperKey, commandKey, callback);
@ -81,7 +73,6 @@ export const add = (callback: Function) => {
export const remove = (callback: Function) => { export const remove = (callback: Function) => {
new Registry({hive: 'HKCU', key: regKey}).destroy(err => { new Registry({hive: 'HKCU', key: regKey}).destroy(err => {
if (err) { if (err) {
//eslint-disable-next-line no-console
console.error(err.message); console.error(err.message);
} }
callback(); callback();

View file

@ -106,7 +106,6 @@ export function newWindow(
if (!isDev) { if (!isDev) {
updater(window); updater(window);
} else { } else {
//eslint-disable-next-line no-console
console.log('ignoring auto updates during dev'); console.log('ignoring auto updates during dev');
} }
}); });

View file

@ -5,7 +5,6 @@ import ms from 'ms';
import retry from 'async-retry'; import retry from 'async-retry';
// Utilities // Utilities
// eslint-disable-next-line no-unused-vars
import {version} from './package'; import {version} from './package';
import {getDecoratedConfig} from './plugins'; import {getDecoratedConfig} from './plugins';
@ -27,7 +26,6 @@ const isCanary = updateChannel => updateChannel === 'canary';
async function init() { async function init() {
autoUpdater.on('error', (err, msg) => { autoUpdater.on('error', (err, msg) => {
//eslint-disable-next-line no-console
console.error('Error fetching updates', `${msg} (${err.stack})`); console.error('Error fetching updates', `${msg} (${err.stack})`);
}); });

View file

@ -29,11 +29,9 @@ const checkInstall = () => {
const addSymlink = () => { const addSymlink = () => {
return checkInstall().then(isInstalled => { return checkInstall().then(isInstalled => {
if (isInstalled) { if (isInstalled) {
//eslint-disable-next-line no-console
console.log('Hyper CLI already in PATH'); console.log('Hyper CLI already in PATH');
return Promise.resolve(); return Promise.resolve();
} }
//eslint-disable-next-line no-console
console.log('Linking HyperCLI'); console.log('Linking HyperCLI');
return symlink(cliScriptPath, cliLinkPath); return symlink(cliScriptPath, cliLinkPath);
}); });
@ -65,7 +63,6 @@ const addBinToUserPath = () => {
const pathParts = value.split(';'); const pathParts = value.split(';');
const existingPath = pathParts.includes(binPath); const existingPath = pathParts.includes(binPath);
if (existingPath) { if (existingPath) {
//eslint-disable-next-line no-console
console.log('Hyper CLI already in PATH'); console.log('Hyper CLI already in PATH');
resolve(); resolve();
return; return;
@ -77,7 +74,6 @@ const addBinToUserPath = () => {
.concat([binPath]) .concat([binPath])
.join(';'); .join(';');
} }
//eslint-disable-next-line no-console
console.log('Adding HyperCLI path (registry)'); console.log('Adding HyperCLI path (registry)');
Registry.setValueRaw(envKey, pathItemName, type, Registry.formatString(newPathValue)); Registry.setValueRaw(envKey, pathItemName, type, Registry.formatString(newPathValue));
Registry.closeKey(envKey); Registry.closeKey(envKey);
@ -117,7 +113,6 @@ export const installCLI = (withNotification: boolean) => {
? `File already exists: ${cliLinkPath}` ? `File already exists: ${cliLinkPath}`
: `Symlink creation failed: ${err.code}`; : `Symlink creation failed: ${err.code}`;
//eslint-disable-next-line no-console
console.error(err); console.error(err);
logNotify(withNotification, 'Hyper CLI installation failed', error); logNotify(withNotification, 'Hyper CLI installation failed', error);
}); });

View file

@ -24,7 +24,6 @@ export default (config: Record<string, string[] | string>) => {
let newShortcut = shortcut; let newShortcut = shortcut;
if (newShortcut.indexOf('cmd') !== -1) { if (newShortcut.indexOf('cmd') !== -1) {
// Mousetrap use `command` and not `cmd` // Mousetrap use `command` and not `cmd`
//eslint-disable-next-line no-console
console.warn('Your config use deprecated `cmd` in key combination. Please use `command` instead.'); console.warn('Your config use deprecated `cmd` in key combination. Please use `command` instead.');
newShortcut = newShortcut.replace('cmd', 'command'); newShortcut = newShortcut.replace('cmd', 'command');
} }

View file

@ -143,7 +143,6 @@ function moveToNeighborPane(type: typeof UI_MOVE_NEXT_PANE | typeof UI_MOVE_PREV
const {uid} = findBySession(termGroups, sessions.activeUid!)!; const {uid} = findBySession(termGroups, sessions.activeUid!)!;
const childGroups = findChildSessions(termGroups.termGroups, termGroups.activeRootGroup!); const childGroups = findChildSessions(termGroups.termGroups, termGroups.activeRootGroup!);
if (childGroups.length === 1) { if (childGroups.length === 1) {
//eslint-disable-next-line no-console
console.log('ignoring move for single group'); console.log('ignoring move for single group');
} else { } else {
const index = getNeighborIndex(childGroups, uid!, type); const index = getNeighborIndex(childGroups, uid!, type);
@ -174,7 +173,6 @@ export function moveLeft() {
const index = groupUids.indexOf(uid); const index = groupUids.indexOf(uid);
const next = groupUids[index - 1] || groupUids[groupUids.length - 1]; const next = groupUids[index - 1] || groupUids[groupUids.length - 1];
if (!next || uid === next) { if (!next || uid === next) {
//eslint-disable-next-line no-console
console.log('ignoring left move action'); console.log('ignoring left move action');
} else { } else {
dispatch(setActiveGroup(next)); dispatch(setActiveGroup(next));
@ -195,7 +193,6 @@ export function moveRight() {
const index = groupUids.indexOf(uid); const index = groupUids.indexOf(uid);
const next = groupUids[index + 1] || groupUids[0]; const next = groupUids[index + 1] || groupUids[0];
if (!next || uid === next) { if (!next || uid === next) {
//eslint-disable-next-line no-console
console.log('ignoring right move action'); console.log('ignoring right move action');
} else { } else {
dispatch(setActiveGroup(next)); dispatch(setActiveGroup(next));
@ -223,12 +220,10 @@ export function moveTo(i: number | 'last') {
const groupUids = getGroupUids(state); const groupUids = getGroupUids(state);
const uid = state.termGroups.activeRootGroup; const uid = state.termGroups.activeRootGroup;
if (uid === groupUids[i as number]) { if (uid === groupUids[i as number]) {
//eslint-disable-next-line no-console
console.log('ignoring same uid'); console.log('ignoring same uid');
} else if (groupUids[i as number]) { } else if (groupUids[i as number]) {
dispatch(setActiveGroup(groupUids[i as number])); dispatch(setActiveGroup(groupUids[i as number]));
} else { } else {
//eslint-disable-next-line no-console
console.log('ignoring inexistent index', i); console.log('ignoring inexistent index', i);
} }
} }

View file

@ -1,4 +1,3 @@
/* eslint-disable quote-props */
import React from 'react'; import React from 'react';
import _ from 'lodash'; import _ from 'lodash';

View file

@ -121,13 +121,11 @@ export default class Term extends React.PureComponent {
let useWebGL = false; let useWebGL = false;
if (props.webGLRenderer) { if (props.webGLRenderer) {
if (needTransparency) { if (needTransparency) {
// eslint-disable-next-line no-console
console.warn( console.warn(
'WebGL Renderer has been disabled since it does not support transparent backgrounds yet. ' + 'WebGL Renderer has been disabled since it does not support transparent backgrounds yet. ' +
'Falling back to canvas-based rendering.' 'Falling back to canvas-based rendering.'
); );
} else if (!isWebgl2Supported()) { } else if (!isWebgl2Supported()) {
// eslint-disable-next-line no-console
console.warn('WebGL2 is not supported on your machine. Falling back to canvas-based rendering.'); console.warn('WebGL2 is not supported on your machine. Falling back to canvas-based rendering.');
} else { } else {
// Experimental WebGL renderer needs some more glue-code to make it work on Hyper. // Experimental WebGL renderer needs some more glue-code to make it work on Hyper.
@ -210,7 +208,6 @@ export default class Term extends React.PureComponent {
} }
getTermDocument() { getTermDocument() {
// eslint-disable-next-line no-console
console.warn( console.warn(
'The underlying terminal engine of Hyper no longer ' + 'The underlying terminal engine of Hyper no longer ' +
'uses iframes with individual `document` objects for each ' + 'uses iframes with individual `document` objects for each ' +

View file

@ -1,4 +1,3 @@
/* eslint-disable max-params */
import {createSelector} from 'reselect'; import {createSelector} from 'reselect';
import Header from '../components/header'; import Header from '../components/header';

View file

@ -1,5 +1,3 @@
/* eslint-disable react/no-danger */
import React from 'react'; import React from 'react';
import Mousetrap from 'mousetrap'; import Mousetrap from 'mousetrap';

View file

@ -99,7 +99,6 @@ const reducer = (state: ImmutableType<sessionState> = initialState, action: Hype
if (state.sessions[action.uid]) { if (state.sessions[action.uid]) {
return deleteSession(state, action.uid); return deleteSession(state, action.uid);
} }
// eslint-disable-next-line no-console
console.log('ignore pty exit: session removed by user'); console.log('ignore pty exit: session removed by user');
return state; return state;

View file

@ -117,10 +117,8 @@ const currentWindow = remote.getCurrentWindow();
const reducer = (state = initial, action: HyperActions) => { const reducer = (state = initial, action: HyperActions) => {
let state_ = state; let state_ = state;
let isMax; let isMax;
//eslint-disable-next-line default-case
switch (action.type) { switch (action.type) {
case CONFIG_LOAD: case CONFIG_LOAD:
// eslint-disable-next-line no-case-declarations, no-fallthrough
case CONFIG_RELOAD: { case CONFIG_RELOAD: {
const {config, now} = action; const {config, now} = action;
state_ = state state_ = state
@ -325,7 +323,6 @@ const reducer = (state = initial, action: HyperActions) => {
); );
break; break;
// eslint-disable-next-line no-case-declarations
case SESSION_PTY_DATA: case SESSION_PTY_DATA:
// ignore activity markers for current tab // ignore activity markers for current tab
if (action.uid === state.activeUid) { if (action.uid === state.activeUid) {

View file

@ -25,7 +25,6 @@ export function getBase64FileData(filePath: string): Promise<string | null> {
return fs.readFile(filePath, (err, data) => { return fs.readFile(filePath, (err, data) => {
if (err) { if (err) {
// Gracefully fail with a warning // Gracefully fail with a warning
//eslint-disable-next-line no-console
console.warn('There was an error reading the file at the local location:', err); console.warn('There was an error reading the file at the local location:', err);
return resolve(null); return resolve(null);
} }

View file

@ -1,9 +1,7 @@
/* eslint no-new:0 */ /* eslint no-new:0 */
export default function notify(title: string, body: string, details: Record<string, any> = {}) { export default function notify(title: string, body: string, details: Record<string, any> = {}) {
//eslint-disable-next-line no-console
console.log(`[Notification] ${title}: ${body}`); console.log(`[Notification] ${title}: ${body}`);
if (details.error) { if (details.error) {
//eslint-disable-next-line no-console
console.error(details.error); console.error(details.error);
} }
new Notification(title, {body}); new Notification(title, {body});

View file

@ -144,15 +144,12 @@ Module._load = function _load(path: string) {
// app/plugins.js // app/plugins.js
switch (path) { switch (path) {
case 'react': case 'react':
//eslint-disable-next-line no-console
console.warn('DEPRECATED: If your plugin requires `react`, it must bundle it as a dependency'); console.warn('DEPRECATED: If your plugin requires `react`, it must bundle it as a dependency');
return React; return React;
case 'react-dom': case 'react-dom':
//eslint-disable-next-line no-console
console.warn('DEPRECATED: If your plugin requires `react-dom`, it must bundle it as a dependency'); console.warn('DEPRECATED: If your plugin requires `react-dom`, it must bundle it as a dependency');
return ReactDOM; return ReactDOM;
case 'hyper/component': case 'hyper/component':
//eslint-disable-next-line no-console
console.warn( console.warn(
'DEPRECATED: If your plugin requires `hyper/component`, it must requires `react.PureComponent` instead and bundle `react` as a dependency' 'DEPRECATED: If your plugin requires `hyper/component`, it must requires `react.PureComponent` instead and bundle `react` as a dependency'
); );
@ -198,14 +195,12 @@ const getPluginVersion = (path: string): string | null => {
try { try {
version = (window.require(pathModule.resolve(path, 'package.json')) as any).version as string; version = (window.require(pathModule.resolve(path, 'package.json')) as any).version as string;
} catch (err) { } catch (err) {
//eslint-disable-next-line no-console
console.warn(`No package.json found in ${path}`); console.warn(`No package.json found in ${path}`);
} }
return version; return version;
}; };
const loadModules = () => { const loadModules = () => {
//eslint-disable-next-line no-console
console.log('(re)loading renderer plugins'); console.log('(re)loading renderer plugins');
const paths = plugins.getPaths(); const paths = plugins.getPaths();
@ -270,14 +265,12 @@ const loadModules = () => {
// mapHyperTermState mapping for backwards compatibility with hyperterm // mapHyperTermState mapping for backwards compatibility with hyperterm
if (mod.mapHyperTermState) { if (mod.mapHyperTermState) {
mod.mapHyperState = mod.mapHyperTermState; mod.mapHyperState = mod.mapHyperTermState;
//eslint-disable-next-line no-console
console.error('mapHyperTermState is deprecated. Use mapHyperState instead.'); console.error('mapHyperTermState is deprecated. Use mapHyperState instead.');
} }
// mapHyperTermDispatch mapping for backwards compatibility with hyperterm // mapHyperTermDispatch mapping for backwards compatibility with hyperterm
if (mod.mapHyperTermDispatch) { if (mod.mapHyperTermDispatch) {
mod.mapHyperDispatch = mod.mapHyperTermDispatch; mod.mapHyperDispatch = mod.mapHyperTermDispatch;
//eslint-disable-next-line no-console
console.error('mapHyperTermDispatch is deprecated. Use mapHyperDispatch instead.'); console.error('mapHyperTermDispatch is deprecated. Use mapHyperDispatch instead.');
} }
@ -348,7 +341,6 @@ const loadModules = () => {
if (mod.onRendererWindow) { if (mod.onRendererWindow) {
mod.onRendererWindow(window); mod.onRendererWindow(window);
} }
//eslint-disable-next-line no-console
console.log(`Plugin ${pluginName} (${pluginVersion}) loaded.`); console.log(`Plugin ${pluginName} (${pluginVersion}) loaded.`);
return mod; return mod;
@ -359,7 +351,6 @@ const loadModules = () => {
Object.keys(deprecatedPlugins).forEach(name => { Object.keys(deprecatedPlugins).forEach(name => {
const {css} = deprecatedPlugins[name]; const {css} = deprecatedPlugins[name];
if (css) { if (css) {
//eslint-disable-next-line no-console
console.warn(`Warning: "${name}" plugin uses some deprecated CSS classes (${css.join(', ')}).`); console.warn(`Warning: "${name}" plugin uses some deprecated CSS classes (${css.join(', ')}).`);
} }
}); });

View file

@ -12,7 +12,6 @@ module.exports = async markdown => {
const {intro} = answers; const {intro} = answers;
if (intro === '') { if (intro === '') {
//eslint-disable-next-line no-console
console.error('Please specify a release summary!'); console.error('Please specify a release summary!');
process.exit(1); process.exit(1);