diff --git a/app/index.js b/app/index.js index 0046dd99..0b8b7515 100644 --- a/app/index.js +++ b/app/index.js @@ -3,8 +3,8 @@ const {resolve} = require('path'); // Packages const {parse: parseUrl} = require('url'); -const {gitDescribe} = require('git-describe'); const {app, BrowserWindow, shell, Menu} = require('electron'); +const {gitDescribe} = require('git-describe'); const uuid = require('uuid'); const fileUriToPath = require('file-uri-to-path'); const isDev = require('electron-is-dev'); @@ -410,7 +410,8 @@ function installDevExtensions(isDev) { if (!isDev) { return Promise.resolve(); } - const installer = require('electron-devtools-installer'); // eslint-disable-line global-require + // eslint-disable-next-line import/no-extraneous-dependencies + const installer = require('electron-devtools-installer'); const extensions = [ 'REACT_DEVELOPER_TOOLS', diff --git a/app/menu.js b/app/menu.js index c942a162..73bc00f2 100644 --- a/app/menu.js +++ b/app/menu.js @@ -8,7 +8,7 @@ const appName = app.getName(); // based on and inspired by // https://github.com/sindresorhus/anatine/blob/master/menu.js -module.exports = function createMenu({createWindow, updatePlugins}) { +module.exports = ({createWindow, updatePlugins}) => { const osxApplicationMenu = { // This menu label is overrided by OSX to be the appName // The label is set to appName here so it matches actual behavior diff --git a/app/package.json b/app/package.json index af366aab..977a6df3 100644 --- a/app/package.json +++ b/app/package.json @@ -22,7 +22,9 @@ "mkdirp": "0.5.1", "ms": "0.7.1", "node-fetch": "1.6.3", + "semver": "5.3.0", "shell-env": "0.2.0", "uuid": "2.0.2" - } + }, + "xo": false } diff --git a/app/plugins.js b/app/plugins.js index 70fc925a..8ed3de3f 100644 --- a/app/plugins.js +++ b/app/plugins.js @@ -132,6 +132,7 @@ function getPluginVersions() { return paths_.map(path => { let version = null; try { + // eslint-disable-next-line import/no-dynamic-require version = require(resolve(path, 'package.json')).version; } catch (err) { } return [ @@ -280,6 +281,7 @@ function requirePlugins() { const load = path => { let mod; try { + // eslint-disable-next-line import/no-dynamic-require mod = require(path); const exposed = mod && Object.keys(mod).some(key => availableExtensions.has(key)); if (!exposed) { diff --git a/app/rpc.js b/app/rpc.js index 45f1f3a3..cffd5da8 100644 --- a/app/rpc.js +++ b/app/rpc.js @@ -51,6 +51,6 @@ class Server extends EventEmitter { } -module.exports = function createRPC(win) { +module.exports = win => { return new Server(win); }; diff --git a/app/utils/to-electron-background-color.js b/app/utils/to-electron-background-color.js index 1156a84f..4203d3e8 100644 --- a/app/utils/to-electron-background-color.js +++ b/app/utils/to-electron-background-color.js @@ -3,7 +3,7 @@ const Color = require('color'); // returns a background color that's in hex // format including the alpha channel (e.g.: `#00000050`) // input can be any css value (rgb, hsl, string…) -module.exports = function toElectronBackgroundColor(bgColor) { +module.exports = bgColor => { const color = Color(bgColor); if (color.alpha() === 1) { return color.hexString(); diff --git a/lib/actions/sessions.js b/lib/actions/sessions.js index bada1d0f..34c986d0 100644 --- a/lib/actions/sessions.js +++ b/lib/actions/sessions.js @@ -88,7 +88,7 @@ function createExitAction(type) { } const sessions = keys(getState().sessions.sessions); - if (!sessions.length) { + if (sessions.length === 0) { window.close(); } } diff --git a/lib/components/split-pane.js b/lib/components/split-pane.js index bce58cf0..d23d9aea 100644 --- a/lib/components/split-pane.js +++ b/lib/components/split-pane.js @@ -1,3 +1,4 @@ +/* eslint-disable quote-props */ import React from 'react'; import Component from '../component'; diff --git a/lib/components/term-group.js b/lib/components/term-group.js index f50545b3..5d841abe 100644 --- a/lib/components/term-group.js +++ b/lib/components/term-group.js @@ -29,7 +29,7 @@ class TermGroup_ extends Component { renderSplit(groups) { const [first, ...rest] = groups; - if (!rest.length) { + if (rest.length === 0) { return first; } diff --git a/lib/components/term.js b/lib/components/term.js index a2e9ea13..487f98e3 100644 --- a/lib/components/term.js +++ b/lib/components/term.js @@ -299,11 +299,11 @@ export default class Term extends Component { height: '100%' }} /> : -
+ } { this.props.customChildren } ); diff --git a/lib/index.js b/lib/index.js index 1ee1bb4f..55908f4d 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,8 +1,8 @@ +import {webFrame} from 'electron'; import forceUpdate from 'react-deep-force-update'; import {Provider} from 'react-redux'; import React from 'react'; import {render} from 'react-dom'; -import {webFrame} from 'electron'; import rpc from './rpc'; import {init} from './actions/index'; diff --git a/lib/utils/file.js b/lib/utils/file.js index 40a1b60b..b11af41d 100644 --- a/lib/utils/file.js +++ b/lib/utils/file.js @@ -16,8 +16,8 @@ export function isExecutable(fileStat) { } return Boolean( - (fileStat.mode & parseInt('0001', 8)) || - (fileStat.mode & parseInt('0010', 8)) || - (fileStat.mode & parseInt('0100', 8)) + (fileStat.mode & 0o0001) || + (fileStat.mode & 0o0010) || + (fileStat.mode & 0o0100) ); } diff --git a/lib/utils/key-code.js b/lib/utils/key-code.js index dc4ae006..1e1cc186 100644 --- a/lib/utils/key-code.js +++ b/lib/utils/key-code.js @@ -5,50 +5,50 @@ */ const _toAscii = { - '188': '44', - '109': '45', - '190': '46', - '191': '47', - '192': '96', - '220': '92', - '222': '39', - '221': '93', - '219': '91', - '173': '45', - '187': '61', // IE Key codes - '186': '59', // IE Key codes - '189': '45' // IE Key codes + 188: '44', + 109: '45', + 190: '46', + 191: '47', + 192: '96', + 220: '92', + 222: '39', + 221: '93', + 219: '91', + 173: '45', + 187: '61', // IE Key codes + 186: '59', // IE Key codes + 189: '45' // IE Key codes }; const _shiftUps = { - '96': '~', - '49': '!', - '50': '@', - '51': '#', - '52': '$', - '53': '%', - '54': '^', - '55': '&', - '56': '*', - '57': '(', - '48': ')', - '45': '_', - '61': '+', - '91': '{', - '93': '}', - '92': '|', - '59': ':', - '39': '\'', - '44': '<', - '46': '>', - '47': '?' + 96: '~', + 49: '!', + 50: '@', + 51: '#', + 52: '$', + 53: '%', + 54: '^', + 55: '&', + 56: '*', + 57: '(', + 48: ')', + 45: '_', + 61: '+', + 91: '{', + 93: '}', + 92: '|', + 59: ':', + 39: '\'', + 44: '<', + 46: '>', + 47: '?' }; const _arrowKeys = { - '38': '[A', - '40': '[B', - '39': '[C', - '37': '[D' + 38: '[A', + 40: '[B', + 39: '[C', + 37: '[D' }; /** diff --git a/package.json b/package.json index cad06a31..338ca249 100644 --- a/package.json +++ b/package.json @@ -63,13 +63,11 @@ "rules": { "eqeqeq": ["error", "allow-null"], "no-eq-null": 0, - "react/prop-types": 0, - "babel/new-cap": 0, - "quote-props": 0, - "import/no-extraneous-dependencies": 0, + "new-cap": 0, "no-warning-comments": 0, "complexity": 0, - "no-nested-ternary": 0, + "import/prefer-default-export": 0, + "react/prop-types": 0, "react/jsx-no-bind": 0 }, "ignore": [ diff --git a/webpack.config.js b/webpack.config.js index 800662be..a2d9d561 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -29,7 +29,7 @@ module.exports = { plugins: [ new webpack.DefinePlugin({ 'process.env': { // eslint-disable-line quote-props - 'NODE_ENV': JSON.stringify(nodeEnv) + NODE_ENV: JSON.stringify(nodeEnv) } }), new Copy([