Stricter lint checks.

This commit is contained in:
Sean Li 2015-02-03 14:30:04 -08:00
parent 117ddb6fa9
commit 3ba951ce94
4 changed files with 26 additions and 28 deletions

View File

@ -1,5 +1,5 @@
{ {
"curly": false, "curly": true,
"noempty": true, "noempty": true,
"newcap": true, "newcap": true,
"eqeqeq": true, "eqeqeq": true,
@ -17,6 +17,10 @@
"immed": true, "immed": true,
"smarttabs": true, "smarttabs": true,
"strict": false, "strict": false,
"quotmark": false,
"nonbsp": true,
"noempty": true,
"camelcase": false,
"globals": { "globals": {
"define": true "define": true
} }

View File

@ -19,16 +19,18 @@ if (argv.integration) {
process.env.TEST_TYPE = 'test'; process.env.TEST_TYPE = 'test';
} }
var windowOptions = {
width: 1000,
height: 700,
'min-width': 1000,
'min-height': 700,
resizable: true,
frame: false,
show: false
};
app.on('activate-with-no-open-windows', function () { app.on('activate-with-no-open-windows', function () {
var mainWindow = new BrowserWindow({ var mainWindow = new BrowserWindow(windowOptions);
width: 1000,
height: 700,
'min-width': 1000,
'min-height': 700,
resizable: true,
frame: false,
show: false
});
if (mainWindow) { if (mainWindow) {
mainWindow.show(); mainWindow.show();
} }
@ -36,15 +38,7 @@ app.on('activate-with-no-open-windows', function () {
}); });
app.on('ready', function() { app.on('ready', function() {
var mainWindow = new BrowserWindow({ var mainWindow = new BrowserWindow(windowOptions);
width: 1000,
height: 700,
'min-width': 1000,
'min-height': 700,
resizable: true,
frame: false,
show: false
});
if (argv.test) { if (argv.test) {
mainWindow.loadUrl('file://' + __dirname + '/../tests/tests.html'); mainWindow.loadUrl('file://' + __dirname + '/../tests/tests.html');
} else { } else {

View File

@ -131,8 +131,8 @@ var Boot2Docker = {
var totalGb = parseInt(tokens[3], 10) / 1000000; var totalGb = parseInt(tokens[3], 10) / 1000000;
var percent = parseInt(tokens[4].replace('%', ''), 10); var percent = parseInt(tokens[4].replace('%', ''), 10);
callback(null, { callback(null, {
used_gb: usedGb.toFixed(2), usedGb: usedGb.toFixed(2),
total_gb: totalGb.toFixed(2), totalGb: totalGb.toFixed(2),
percent: percent percent: percent
}); });
} catch (error) { } catch (error) {
@ -160,9 +160,9 @@ var Boot2Docker = {
var totalGb = usedGb + freeGb; var totalGb = usedGb + freeGb;
var percent = Math.round(usedGb / totalGb * 100); var percent = Math.round(usedGb / totalGb * 100);
callback(null, { callback(null, {
used_gb: usedGb.toFixed(2), usedGb: usedGb.toFixed(2),
total_gb: totalGb.toFixed(2), totalGb: totalGb.toFixed(2),
free_gb: freeGb.toFixed(2), freeGb: freeGb.toFixed(2),
percent: percent percent: percent
}); });
} catch (error) { } catch (error) {

View File

@ -16,11 +16,11 @@ if (process.env.NODE_ENV === 'development') {
if (!window.location.hash.length || window.location.hash === '#/') { if (!window.location.hash.length || window.location.hash === '#/') {
SetupStore.run(function () { SetupStore.run(function () {
boot2docker.ip(function (err, ip) { boot2docker.ip(function (err, ip) {
if (err) console.log(err); if (err) { console.log(err); }
docker.setHost(ip); docker.setHost(ip);
router.transitionTo('containers'); router.transitionTo('containers');
ContainerStore.init(function (err) { ContainerStore.init(function (err) {
if (err) console.log(err); if (err) { console.log(err); }
router.run(function (Handler) { router.run(function (Handler) {
React.render(<Handler/>, document.body); React.render(<Handler/>, document.body);
}); });
@ -29,10 +29,10 @@ if (!window.location.hash.length || window.location.hash === '#/') {
}); });
} else { } else {
boot2docker.ip(function (err, ip) { boot2docker.ip(function (err, ip) {
if (err) console.log(err); if (err) { console.log(err); }
docker.setHost(ip); docker.setHost(ip);
ContainerStore.init(function (err) { ContainerStore.init(function (err) {
if (err) console.log(err); if (err) { console.log(err); }
router.run(function (Handler) { router.run(function (Handler) {
React.render(<Handler/>, document.body); React.render(<Handler/>, document.body);
}); });