diff --git a/common/models/change.js b/common/models/change.js index 53368813..8c6b7ff9 100644 --- a/common/models/change.js +++ b/common/models/change.js @@ -423,8 +423,8 @@ module.exports = function(Change) { var checkpointModel = this.Checkpoint; if (checkpointModel) return checkpointModel; this.Checkpoint = checkpointModel = loopback.Checkpoint.extend('checkpoint'); - assert(this.dataSource, 'Cannot getCheckpointModel(): ' + this.modelName - + ' is not attached to a dataSource'); + assert(this.dataSource, 'Cannot getCheckpointModel(): ' + this.modelName + + ' is not attached to a dataSource'); checkpointModel.attachTo(this.dataSource); return checkpointModel; }; diff --git a/common/models/role.js b/common/models/role.js index e25c3c34..46e2101a 100644 --- a/common/models/role.js +++ b/common/models/role.js @@ -119,8 +119,8 @@ module.exports = function(Role) { * @returns {boolean} */ function matches(id1, id2) { - if (id1 === undefined || id1 === null || id1 === '' - || id2 === undefined || id2 === null || id2 === '') { + if (id1 === undefined || id1 === null || id1 === '' || + id2 === undefined || id2 === null || id2 === '') { return false; } // The id can be a MongoDB ObjectID diff --git a/lib/persisted-model.js b/lib/persisted-model.js index 853df230..490ebe7e 100644 --- a/lib/persisted-model.js +++ b/lib/persisted-model.js @@ -1038,8 +1038,8 @@ PersistedModel.enableChangeTracking = function() { var Change = this.Change || this._defineChangeModel(); var cleanupInterval = Model.settings.changeCleanupInterval || 30000; - assert(this.dataSource, 'Cannot enableChangeTracking(): ' + this.modelName - + ' is not attached to a dataSource'); + assert(this.dataSource, 'Cannot enableChangeTracking(): ' + this.modelName + + ' is not attached to a dataSource'); Change.attachTo(this.dataSource); Change.getCheckpointModel().attachTo(this.dataSource); diff --git a/package.json b/package.json index 1c07d43c..85c4ff39 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "grunt-contrib-jshint": "~0.10.0", "grunt-contrib-uglify": "~0.5.1", "grunt-contrib-watch": "~0.6.1", - "grunt-jscs": "^0.8.1", + "grunt-jscs": "^1.5.0", "grunt-karma": "~0.9.0", "grunt-mocha-test": "^0.11.0", "karma": "~0.12.23", diff --git a/test/acl.test.js b/test/acl.test.js index db4e904e..e66ec0b6 100644 --- a/test/acl.test.js +++ b/test/acl.test.js @@ -112,6 +112,7 @@ describe('security ACLs', function() { }); it('should allow access to models for the given principal by wildcard', function() { + // jscs:disable validateIndentation ACL.create({principalType: ACL.USER, principalId: 'u001', model: 'User', property: ACL.ALL, accessType: ACL.ALL, permission: ACL.ALLOW}, function(err, acl) { diff --git a/test/relations.integration.js b/test/relations.integration.js index 1abb3c58..1da043d5 100644 --- a/test/relations.integration.js +++ b/test/relations.integration.js @@ -241,8 +241,8 @@ describe('relations - integration', function() { name: 'pa1' }, function(err, patient) { root.patient = patient; - root.relUrl = '/api/physicians/' + root.physician.id - + '/patients/rel/' + root.patient.id; + root.relUrl = '/api/physicians/' + root.physician.id + + '/patients/rel/' + root.patient.id; done(); }); } : function(done) { @@ -250,8 +250,8 @@ describe('relations - integration', function() { name: 'pa1' }, function(err, patient) { root.patient = patient; - root.relUrl = '/api/physicians/' + root.physician.id - + '/patients/rel/' + root.patient.id; + root.relUrl = '/api/physicians/' + root.physician.id + + '/patients/rel/' + root.patient.id; done(); }); }], function(err, done) { @@ -367,8 +367,8 @@ describe('relations - integration', function() { before(function(done) { var self = this; setup(true, function(err, root) { - self.url = '/api/physicians/' + root.physician.id - + '/patients/rel/' + '999'; + self.url = '/api/physicians/' + root.physician.id + + '/patients/rel/' + '999'; self.patient = root.patient; self.physician = root.physician; done(); @@ -441,8 +441,8 @@ describe('relations - integration', function() { before(function(done) { var self = this; setup(true, function(err, root) { - self.url = '/api/physicians/' + root.physician.id - + '/patients/' + root.patient.id; + self.url = '/api/physicians/' + root.physician.id + + '/patients/' + root.patient.id; self.patient = root.patient; self.physician = root.physician; done(); @@ -462,8 +462,8 @@ describe('relations - integration', function() { before(function(done) { var self = this; setup(true, function(err, root) { - self.url = '/api/physicians/' + root.physician.id - + '/patients/' + root.patient.id; + self.url = '/api/physicians/' + root.physician.id + + '/patients/' + root.patient.id; self.patient = root.patient; self.physician = root.physician; done(); diff --git a/test/remoting.integration.js b/test/remoting.integration.js index 23bf1351..76840f69 100644 --- a/test/remoting.integration.js +++ b/test/remoting.integration.js @@ -199,7 +199,7 @@ describe('remoting - integration', function() { }); it('should have correct signatures for hasMany-through methods', - function() { + function() { // jscs:disable validateIndentation var physicianClass = findClass('physician'); var methods = physicianClass.methods diff --git a/test/user.test.js b/test/user.test.js index 616cd5b1..6caeb34d 100644 --- a/test/user.test.js +++ b/test/user.test.js @@ -845,9 +845,9 @@ describe('User', function() { it('Confirm a user verification', function(done) { testConfirm(function(result, done) { request(app) - .get('/users/confirm?uid=' + (result.uid) - + '&token=' + encodeURIComponent(result.token) - + '&redirect=' + encodeURIComponent(options.redirect)) + .get('/users/confirm?uid=' + (result.uid) + + '&token=' + encodeURIComponent(result.token) + + '&redirect=' + encodeURIComponent(options.redirect)) .expect(302) .end(function(err, res) { if (err) { @@ -861,9 +861,9 @@ describe('User', function() { it('Report error for invalid user id during verification', function(done) { testConfirm(function(result, done) { request(app) - .get('/users/confirm?uid=' + (result.uid + '_invalid') - + '&token=' + encodeURIComponent(result.token) - + '&redirect=' + encodeURIComponent(options.redirect)) + .get('/users/confirm?uid=' + (result.uid + '_invalid') + + '&token=' + encodeURIComponent(result.token) + + '&redirect=' + encodeURIComponent(options.redirect)) .expect(404) .end(function(err, res) { if (err) { @@ -880,9 +880,9 @@ describe('User', function() { it('Report error for invalid token during verification', function(done) { testConfirm(function(result, done) { request(app) - .get('/users/confirm?uid=' + result.uid - + '&token=' + encodeURIComponent(result.token) + '_invalid' - + '&redirect=' + encodeURIComponent(options.redirect)) + .get('/users/confirm?uid=' + result.uid + + '&token=' + encodeURIComponent(result.token) + '_invalid' + + '&redirect=' + encodeURIComponent(options.redirect)) .expect(400) .end(function(err, res) { if (err) {