Skip to content

Commit a5335e2

Browse files
committed
👕 back to a base state of 0 errors
cc @rueckstiess
1 parent 257ec51 commit a5335e2

23 files changed

+143
-120
lines changed

.eslintrc

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{
2-
"env": {
3-
"mocha": true
4-
},
5-
"extends": "mongodb-js/node"
2+
"extends": [
3+
"mongodb-js/node",
4+
"mongodb-js/browser"
5+
],
6+
"rules": {
7+
"camelcase": 1
8+
}
69
}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@
5757
"release": "gulp release",
5858
"test": "mocha",
5959
"ci": "npm run check && npm run release",
60-
"check": "mongodb-js-precommit",
61-
"fmt": "mongodb-js-fmt src/{**/*.js,*.js}"
60+
"check": "mongodb-js-precommit ./*.js src/{**/*.js,*.js} test/{**/*.js,*.js} tasks/*.js",
61+
"fmt": "mongodb-js-fmt ./*.js src/{**/*.js,*.js} test/{**/*.js,*.js} tasks/*.js"
6262
},
6363
"pre-commit": [
6464
"check"

src/.eslintrc

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/connect/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,8 +344,8 @@ var ConnectView = View.extend({
344344
// `Untitled (\d)` connections, increment a counter
345345
// on them like every MS Office does.
346346
var untitleds = _.chain(this.connections.models)
347-
.filter(function(model) {
348-
return _.startsWith(model.name, 'Untitled (');
347+
.filter(function(m) {
348+
return _.startsWith(m.name, 'Untitled (');
349349
})
350350
.sort('name')
351351
.value();

src/electron/menu.js

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,6 @@
11
var app = require('app');
22
var Menu = require('menu');
33

4-
var menu = (function() {
5-
return {
6-
init: function(window) {
7-
/* eslint-disable no-extra-parens */
8-
var menu = (process.platform == 'darwin')
9-
? darwinMenu(window) : nonDarwinMenu(window);
10-
/* eslint-enable no-extra-parens */
11-
menu = Menu.buildFromTemplate(menu);
12-
Menu.setApplicationMenu(menu);
13-
}
14-
};
15-
}());
16-
174
// menus
185
function darwinMenu(window) {
196
return [
@@ -158,7 +145,7 @@ function darwinMenu(window) {
158145
]
159146
}
160147
];
161-
};
148+
}
162149

163150
function nonDarwinMenu(window) {
164151
return [
@@ -204,6 +191,21 @@ function nonDarwinMenu(window) {
204191
]
205192
}
206193
];
207-
};
194+
}
195+
196+
var menu = (function() {
197+
return {
198+
init: function(window) {
199+
var m;
200+
if (process.platform === 'darwin') {
201+
m = darwinMenu(window);
202+
} else {
203+
m = nonDarwinMenu(window);
204+
}
205+
m = Menu.buildFromTemplate(m);
206+
Menu.setApplicationMenu(m);
207+
}
208+
};
209+
}());
208210

209-
module.exports = menu;
211+
module.exports = menu;

src/electron/scout-server-ctl.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
var fs = require('fs');
1313
var path = require('path');
1414
var app = require('app');
15-
var child_process = require('child_process');
15+
var spawn = require('child_process').spawn;
1616
var debug = require('debug')('scout:electron:scout-server-ctl');
1717

1818
// Where we'll keep the process id.
@@ -67,8 +67,8 @@ var killIfRunning = function(done) {
6767
debug('killing existing pid', pid);
6868
try {
6969
process.kill(pid, 'SIGTERM');
70-
} catch (err) {
71-
if (err.code === 'ESRCH') {
70+
} catch (e) {
71+
if (e.code === 'ESRCH') {
7272
debug('orphaned pid file');
7373
}
7474
}
@@ -92,7 +92,7 @@ module.exports.start = function(done) {
9292
// not! `child_process.exec` has space escape issues
9393
// but not `child_process.spawn`!
9494
debug('spawning: `%s %s`...', process.execPath, BIN);
95-
var server = child_process.spawn(process.execPath, [BIN], {
95+
var server = spawn(process.execPath, [BIN], {
9696
env: {
9797
ATOM_SHELL_INTERNAL_RUN_AS_NODE: '1',
9898
RESOURCES_PATH: process.resourcesPath

src/electron/window-manager.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,22 @@ module.exports.create = function(opts) {
6767
// makes the application a single instance application
6868
// see "app.makeSingleInstance" in https://github.com/atom/electron/blob/master/docs/api/app.md
6969
var shouldQuit = app.makeSingleInstance(function(commandLine, workingDirectory) {
70-
// Someone tried to run a second instance, we should focus our window
70+
debug('Someone tried to run a second instance! We should focus our window', {
71+
commandLine: commandLine,
72+
workingDirectory: workingDirectory
73+
});
7174
if (_window) {
72-
if (_window.isMinimized()) _window.restore();
75+
if (_window.isMinimized()) {
76+
_window.restore();
77+
}
7378
_window.focus();
7479
}
7580
return true;
7681
});
7782

7883
if (shouldQuit) {
7984
app.quit();
80-
return;
85+
return null;
8186
}
8287

8388
_window.loadUrl(opts.url);

src/minicharts/d3-tip.js

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1+
/* eslint no-use-before-define: 1, one-var: 1, no-else-return: 1, no-unused-vars: 1, eqeqeq: 1, no-shadow: 1, yoda: 1, consistent-return: 1, one-var: 1 */
12
// d3.tip
23
// Copyright (c) 2013 Justin Palmer
34
//
45
// Tooltips for d3.js SVG visualizations
56

67
(function(root, factory) {
7-
if (typeof define === 'function' && define.amd) {
8-
// AMD. Register as an anonymous module with d3 as a dependency.
9-
define(['d3'], factory);
10-
} else if (typeof module === 'object' && module.exports) {
8+
if (typeof module === 'object' && module.exports) {
119
// CommonJS
1210
module.exports = function(d3) {
1311
d3.tip = factory(d3);
@@ -18,18 +16,17 @@
1816
root.d3.tip = factory(root.d3);
1917
}
2018
}(this, function(d3) {
21-
2219
// Public - contructs a new tooltip
2320
//
2421
// Returns a tip
2522
return function() {
26-
var direction = d3_tip_direction,
27-
offset = d3_tip_offset,
28-
html = d3_tip_html,
29-
node = initNode(),
30-
svg = null,
31-
point = null,
32-
target = null;
23+
var direction = d3_tip_direction;
24+
var offset = d3_tip_offset;
25+
var html = d3_tip_html;
26+
var node = initNode();
27+
var svg = null;
28+
var point = null;
29+
var target = null;
3330

3431
function tip(vis) {
3532
svg = getSVGNode(vis);
@@ -349,5 +346,4 @@
349346

350347
return tip;
351348
};
352-
353349
}));

src/minicharts/d3fns/date.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint no-use-before-define:1 */
12
var d3 = require('d3');
23
var _ = require('lodash');
34
var $ = require('jquery');
@@ -309,7 +310,7 @@ var minicharts_d3fns_date = function() {
309310

310311
raf(function() {
311312
var chartWidth = width / (upperRatio + 1) - upperMargin;
312-
var chart = many()
313+
var manyChart = many()
313314
.width(chartWidth)
314315
.height(upperBarBottom)
315316
.options({
@@ -323,13 +324,13 @@ var minicharts_d3fns_date = function() {
323324
},
324325
view: options.view
325326
});
326-
weekdayContainer.call(chart);
327+
weekdayContainer.call(manyChart);
327328
});
328329

329330
var hourContainer = g.select('g.hour').data([hours]);
330331
raf(function() {
331332
var chartWidth = width / (upperRatio + 1) * upperRatio - upperMargin;
332-
var chart = many()
333+
var manyChart = many()
333334
.width(chartWidth)
334335
.height(upperBarBottom)
335336
.options({
@@ -342,7 +343,7 @@ var minicharts_d3fns_date = function() {
342343
},
343344
view: options.view
344345
});
345-
hourContainer.call(chart);
346+
hourContainer.call(manyChart);
346347
});
347348
});
348349
}

src/minicharts/d3fns/few.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint no-use-before-define:1 */
12
var d3 = require('d3');
23
var _ = require('lodash');
34
var $ = require('jquery');

0 commit comments

Comments
 (0)