From 2aff0c47d03458947dad5866069523fca717042f Mon Sep 17 00:00:00 2001 From: cesine Date: Mon, 15 Feb 2016 21:26:25 -0500 Subject: [PATCH] :arrow_up: :shirt: updated to eslint 2.1.0 Verified migration doc (nothing to be done) http://eslint.org/docs/user-guide/migrating-to-2.0.0 And made sure the eslint tasks passed --- atom/browser/lib/rpc-server.js | 6 ++++-- package.json | 2 +- spec/asar-spec.js | 1 - spec/fixtures/api/quit-app/main.js | 12 ++++++------ spec/fixtures/module/call.js | 4 ++-- spec/fixtures/module/id.js | 2 +- spec/fixtures/module/locale-compare.js | 2 +- spec/fixtures/module/original-fs.js | 2 +- spec/fixtures/module/print_name.js | 4 ++-- spec/fixtures/module/promise.js | 2 +- spec/fixtures/module/property.js | 2 +- spec/fixtures/module/send-later.js | 2 +- spec/fixtures/module/set-immediate.js | 2 +- spec/fixtures/workers/shared_worker.js | 6 +++--- spec/fixtures/workers/worker.js | 2 +- spec/static/main.js | 4 ++-- 16 files changed, 28 insertions(+), 27 deletions(-) diff --git a/atom/browser/lib/rpc-server.js b/atom/browser/lib/rpc-server.js index 2f2b739e4..976a42331 100644 --- a/atom/browser/lib/rpc-server.js +++ b/atom/browser/lib/rpc-server.js @@ -130,7 +130,7 @@ var unwrapArgs = function(sender, args) { return Promise.resolve({ then: metaToValue(meta.then) }); - case 'object': + case 'object': { let ret = v8Util.createObjectWithName(meta.name); ref = meta.members; for (i = 0, len = ref.length; i < len; i++) { @@ -138,12 +138,13 @@ var unwrapArgs = function(sender, args) { ret[member.name] = metaToValue(member.value); } return ret; + } case 'function-with-return-value': returnValue = metaToValue(meta.value); return function() { return returnValue; }; - case 'function': + case 'function': { // Cache the callbacks in renderer. if (!sender.callbacks) { sender.callbacks = new IDWeakMap; @@ -172,6 +173,7 @@ var unwrapArgs = function(sender, args) { }); sender.callbacks.set(meta.id, callIntoRenderer); return callIntoRenderer; + } default: throw new TypeError("Unknown type: " + meta.type); } diff --git a/package.json b/package.json index 6d8120871..f68438626 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "0.36.7", "devDependencies": { "asar": "^0.9.0", - "eslint": "^1.10.3", + "eslint": "^2.1.0", "request": "*" }, "optionalDependencies": { diff --git a/spec/asar-spec.js b/spec/asar-spec.js index 81d881f7e..a8f449451 100644 --- a/spec/asar-spec.js +++ b/spec/asar-spec.js @@ -517,7 +517,6 @@ describe('asar package', function() { }); }); describe('child_process.fork', function() { - child_process = require('child_process'); it('opens a normal js file', function(done) { var child; child = child_process.fork(path.join(fixtures, 'asar', 'a.asar', 'ping.js')); diff --git a/spec/fixtures/api/quit-app/main.js b/spec/fixtures/api/quit-app/main.js index e2f97affe..114e83007 100644 --- a/spec/fixtures/api/quit-app/main.js +++ b/spec/fixtures/api/quit-app/main.js @@ -1,12 +1,12 @@ -var app = require('electron').app +var app = require('electron').app; app.on('ready', function () { // This setImmediate call gets the spec passing on Linux setImmediate(function () { - app.exit(123) - }) -}) + app.exit(123); + }); +}); process.on('exit', function (code) { - console.log('Exit event with code: ' + code) -}) + console.log('Exit event with code: ' + code); +}); diff --git a/spec/fixtures/module/call.js b/spec/fixtures/module/call.js index 4cf232e22..ce0eb6324 100644 --- a/spec/fixtures/module/call.js +++ b/spec/fixtures/module/call.js @@ -1,7 +1,7 @@ exports.call = function(func) { return func(); -} +}; exports.constructor = function() { this.test = 'test'; -} +}; diff --git a/spec/fixtures/module/id.js b/spec/fixtures/module/id.js index 2faec9d38..5bfae457f 100644 --- a/spec/fixtures/module/id.js +++ b/spec/fixtures/module/id.js @@ -1 +1 @@ -exports.id = 1127 +exports.id = 1127; diff --git a/spec/fixtures/module/locale-compare.js b/spec/fixtures/module/locale-compare.js index f99e7c3be..32dfb3099 100644 --- a/spec/fixtures/module/locale-compare.js +++ b/spec/fixtures/module/locale-compare.js @@ -1,4 +1,4 @@ -process.on('message', function (msg) { +process.on('message', function () { process.send([ 'a'.localeCompare('a'), 'รค'.localeCompare('z', 'de'), diff --git a/spec/fixtures/module/original-fs.js b/spec/fixtures/module/original-fs.js index 90b6abcf9..7a527c633 100644 --- a/spec/fixtures/module/original-fs.js +++ b/spec/fixtures/module/original-fs.js @@ -1,3 +1,3 @@ -process.on('message', function (msg) { +process.on('message', function () { process.send(typeof require('original-fs')); }); diff --git a/spec/fixtures/module/print_name.js b/spec/fixtures/module/print_name.js index 01d13f4ba..96ac2d6f3 100644 --- a/spec/fixtures/module/print_name.js +++ b/spec/fixtures/module/print_name.js @@ -1,7 +1,7 @@ exports.print = function(obj) { return obj.constructor.name; -} +}; exports.echo = function(obj) { return obj; -} +}; diff --git a/spec/fixtures/module/promise.js b/spec/fixtures/module/promise.js index 2e52ed374..b9b568855 100644 --- a/spec/fixtures/module/promise.js +++ b/spec/fixtures/module/promise.js @@ -2,4 +2,4 @@ exports.twicePromise = function (promise) { return promise.then(function (value) { return value * 2; }); -} +}; diff --git a/spec/fixtures/module/property.js b/spec/fixtures/module/property.js index 88e596f73..36286d800 100644 --- a/spec/fixtures/module/property.js +++ b/spec/fixtures/module/property.js @@ -1 +1 @@ -exports.property = 1127 +exports.property = 1127; diff --git a/spec/fixtures/module/send-later.js b/spec/fixtures/module/send-later.js index 13f02452d..704f47d32 100644 --- a/spec/fixtures/module/send-later.js +++ b/spec/fixtures/module/send-later.js @@ -1,4 +1,4 @@ var ipcRenderer = require('electron').ipcRenderer; window.onload = function() { ipcRenderer.send('answer', typeof window.process); -} +}; diff --git a/spec/fixtures/module/set-immediate.js b/spec/fixtures/module/set-immediate.js index e7d44a75d..d36355ee2 100644 --- a/spec/fixtures/module/set-immediate.js +++ b/spec/fixtures/module/set-immediate.js @@ -3,7 +3,7 @@ process.on('uncaughtException', function(error) { process.exit(1); }); -process.on('message', function(msg) { +process.on('message', function() { setImmediate(function() { process.send('ok'); process.exit(0); diff --git a/spec/fixtures/workers/shared_worker.js b/spec/fixtures/workers/shared_worker.js index d35b47435..402207939 100644 --- a/spec/fixtures/workers/shared_worker.js +++ b/spec/fixtures/workers/shared_worker.js @@ -1,7 +1,7 @@ -onconnect = function(event) { +this.onconnect = function(event) { var port = event.ports[0]; port.start(); port.onmessage = function(event) { port.postMessage(event.data); - } -} + }; +}; diff --git a/spec/fixtures/workers/worker.js b/spec/fixtures/workers/worker.js index 6f9533708..4f445470b 100644 --- a/spec/fixtures/workers/worker.js +++ b/spec/fixtures/workers/worker.js @@ -1,3 +1,3 @@ this.onmessage = function(msg) { this.postMessage(msg.data); -} +}; diff --git a/spec/static/main.js b/spec/static/main.js index 125ef72f6..48fdf17c3 100644 --- a/spec/static/main.js +++ b/spec/static/main.js @@ -74,7 +74,7 @@ app.on('ready', function() { // Send auto updater errors to window to be verified in specs electron.autoUpdater.on('error', function (error) { - window.send('auto-updater-error', error.message) + window.send('auto-updater-error', error.message); }); window = new BrowserWindow({ @@ -108,7 +108,7 @@ app.on('ready', function() { // reply the result to renderer for verifying var downloadFilePath = path.join(__dirname, '..', 'fixtures', 'mock.pdf'); ipcMain.on('set-download-option', function(event, need_cancel, prevent_default) { - window.webContents.session.once('will-download', function(e, item, webContents) { + window.webContents.session.once('will-download', function(e, item) { if (prevent_default) { e.preventDefault(); const url = item.getURL();