Skip to content

Commit

Permalink
Add strict mode and fix some jshint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
voithos committed Nov 28, 2013
1 parent d7a111b commit 65c0a1e
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 5 deletions.
3 changes: 2 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
pkg: grunt.file.readJSON('package.json'),
jshint: {
options: {
newcap: false
newcap: false,
node: true
},
all: jsFiles
},
Expand Down
2 changes: 2 additions & 0 deletions src/config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var settings;
try {
settings = require('./settings');
Expand Down
2 changes: 2 additions & 0 deletions src/db.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var mongoose = require('mongoose');

module.exports.setupConnection = function(config) {
Expand Down
2 changes: 2 additions & 0 deletions src/eventnet.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var events = require('events');

var SwiftCODEEventNet = function() {
Expand Down
2 changes: 2 additions & 0 deletions src/models.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var bcrypt = require('bcrypt');
Expand Down
8 changes: 5 additions & 3 deletions src/routes.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var _ = require('lodash');
var models = require('./models');

Expand Down Expand Up @@ -184,8 +186,8 @@ exports.addLang = function(req, res) {
var langKey = req.body.key,
langName = req.body.name,
order = req.body.order,
projectCount = parseInt(req.body.projectCount),
exerciseCount = parseInt(req.body.exerciseCount),
projectCount = parseInt(req.body.projectCount, 10),
exerciseCount = parseInt(req.body.exerciseCount, 10),
projectKey = getRequestArray('projectKey', projectCount),
projectName = getRequestArray('projectName', projectCount),
projectUrl = getRequestArray('projectUrl', projectCount),
Expand Down Expand Up @@ -235,7 +237,7 @@ exports.addLang = function(req, res) {
}

var projects = Array.prototype.slice.call(arguments, 1);
_.each(_.map(exerciseProject, function(p) { return parseInt(p); }), function(project, i) {
_.each(_.map(exerciseProject, function(p) { return parseInt(p, 10); }), function(project, i) {
exercises[i].project = projects[project]._id;
exercises[i].projectName = projects[project].name;
});
Expand Down
3 changes: 2 additions & 1 deletion src/server.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env node
'use strict';

var express = require('express');
var io = require('socket.io');
Expand Down Expand Up @@ -268,6 +269,6 @@ var SwiftCODE = function() {
};

if (require.main === module) {
app = new SwiftCODE();
var app = new SwiftCODE();
app.listen();
}
2 changes: 2 additions & 0 deletions src/settings.js.example.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var settings = {};

// Note: most of these configuration options can be overridden
Expand Down
2 changes: 2 additions & 0 deletions src/sockets.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var io = require('socket.io');
var moment = require('moment');

Expand Down

0 comments on commit 65c0a1e

Please sign in to comment.