Merge pull request #1114 from strongloop/feature/upgrade-jscs

Upgrade jscs to ~1.11 via grunt-jscs ^1.5
This commit is contained in:
Miroslav Bajtoš 2015-02-20 17:04:32 +01:00
commit 6276773c0b
8 changed files with 28 additions and 27 deletions

View File

@ -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;
};

View File

@ -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

View File

@ -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);

View File

@ -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",

View File

@ -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) {

View File

@ -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();

View File

@ -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

View File

@ -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) {