Fix linter issues (#321)

This commit is contained in:
Darin Morrison 2016-07-20 16:21:29 -06:00 committed by Guillermo Rauch
parent f1facf4a32
commit 6072b4ca90
7 changed files with 20 additions and 14 deletions

4
.eslintignore Normal file
View file

@ -0,0 +1,4 @@
app/dist
app/node_modules
build
dist

1
app/.eslintignore Normal file
View file

@ -0,0 +1 @@
dist

View file

@ -143,7 +143,7 @@ export function showPreferences () {
rpc.once('session data', () => { rpc.once('session data', () => {
dispatch(sendSessionData( dispatch(sendSessionData(
uid, uid,
['echo Attempting to open ~/.hyperterm.js with your \$EDITOR', ['echo Attempting to open ~/.hyperterm.js with your \$EDITOR', // eslint-disable-line no-useless-escape
'echo If it fails, open it manually with your favorite editor!', 'echo If it fails, open it manually with your favorite editor!',
'exec env $EDITOR ~/.hyperterm.js', 'exec env $EDITOR ~/.hyperterm.js',
'' ''

View file

@ -50,7 +50,7 @@ class HyperTerm extends Component {
keys.bind('command+alt+left', moveLeft); keys.bind('command+alt+left', moveLeft);
keys.bind('command+alt+right', moveRight); keys.bind('command+alt+right', moveRight);
const bound = method => { return term[method].bind(term) } const bound = method => { return term[method].bind(term); };
keys.bind('alt+left', bound('moveWordLeft')); keys.bind('alt+left', bound('moveWordLeft'));
keys.bind('alt+right', bound('moveWordRight')); keys.bind('alt+right', bound('moveWordRight'));
keys.bind('alt+backspace', bound('deleteWordLeft')); keys.bind('alt+backspace', bound('deleteWordLeft'));

View file

@ -88,23 +88,24 @@ hterm.Terminal.prototype.clearPreserveCursorRow = function () {
// fixes a bug in hterm, where the shorthand hex // fixes a bug in hterm, where the shorthand hex
// is not properly converted to rgb // is not properly converted to rgb
lib.colors.hexToRGB = function(arg) { lib.colors.hexToRGB = function (arg) {
var hex16 = lib.colors.re_.hex16; var hex16 = lib.colors.re_.hex16;
var hex24 = lib.colors.re_.hex24; var hex24 = lib.colors.re_.hex24;
function convert(hex) { function convert (hex) {
if (hex.length == 4) { if (hex.length === 4) {
hex = hex.replace(hex16, function(h, r, g, b) { hex = hex.replace(hex16, function (h, r, g, b) {
return "#" + r + r + g + g + b + b; return '#' + r + r + g + g + b + b;
}); });
} }
var ary = hex.match(hex24); var ary = hex.match(hex24);
if (!ary) if (!ary) return null;
return null;
return 'rgb(' + parseInt(ary[1], 16) + ', ' + return 'rgb(' +
parseInt(ary[2], 16) + ', ' + parseInt(ary[1], 16) + ', ' +
parseInt(ary[3], 16) + ')'; parseInt(ary[2], 16) + ', ' +
parseInt(ary[3], 16) +
')';
} }
if (arg instanceof Array) { if (arg instanceof Array) {

View file

@ -72,7 +72,7 @@
}, },
"scripts": { "scripts": {
"dev": "webpack --watch", "dev": "webpack --watch",
"lint": "eslint *.js", "lint": "eslint .",
"build": "NODE_ENV=production webpack" "build": "NODE_ENV=production webpack"
} }
} }

View file

@ -46,6 +46,6 @@
}, },
"scripts": { "scripts": {
"start": "electron index", "start": "electron index",
"lint": "eslint *.js" "lint": "eslint ."
} }
} }