Skip to content

Commit adfe62e

Browse files
authored
Merge pull request #129 from digitalsadhu/replace_eslint_with_standard
Replace eslint with standard
2 parents 30bc4bf + 624beac commit adfe62e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+2803
-2947
lines changed

.eslintignore

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

.eslintrc

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

lib/create.js

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,39 @@
1-
var url = require('url');
2-
var utils = require('./utils');
3-
var statusCodes = require('http-status-codes');
1+
var url = require('url')
2+
var utils = require('./utils')
3+
var statusCodes = require('http-status-codes')
44

55
module.exports = function (app, options) {
6-
//get remote methods.
7-
//set strong-remoting for more information
8-
//https://github.com/strongloop/strong-remoting
9-
var remotes = app.remotes();
6+
// get remote methods.
7+
// set strong-remoting for more information
8+
// https://github.com/strongloop/strong-remoting
9+
var remotes = app.remotes()
1010

11-
//register after remote method hook on all methods
11+
// register after remote method hook on all methods
1212
remotes.after('**', function (ctx, next) {
13-
1413
if (utils.shouldNotApplyJsonApi(ctx, options)) {
15-
return next();
16-
};
14+
return next()
15+
}
1716

18-
//in this case we are only interested in handling create operations.
17+
// in this case we are only interested in handling create operations.
1918
if (ctx.method.name === 'create') {
20-
//JSON API specifies that created resources should have the
21-
//http status code of 201
22-
ctx.res.statusCode = statusCodes.CREATED;
19+
// JSON API specifies that created resources should have the
20+
// http status code of 201
21+
ctx.res.statusCode = statusCodes.CREATED
2322

24-
//build the location url for the created resource.
23+
// build the location url for the created resource.
2524
var location = url.format({
2625
protocol: ctx.req.protocol,
2726
host: ctx.req.get('host'),
2827
pathname: ctx.req.baseUrl + '/' + ctx.result.data.id
29-
});
28+
})
3029

31-
//we don't need the links property so just delete it.
32-
delete ctx.result.links;
30+
// we don't need the links property so just delete it.
31+
delete ctx.result.links
3332

34-
//JSON API specifies that when creating a resource, there should be a
35-
//location header set with the url of the created resource as the value
36-
ctx.res.append('Location', location);
33+
// JSON API specifies that when creating a resource, there should be a
34+
// location header set with the url of the created resource as the value
35+
ctx.res.append('Location', location)
3736
}
38-
next();
39-
});
40-
};
37+
next()
38+
})
39+
}

lib/delete.js

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,26 @@
1-
var utils = require('./utils');
2-
var statusCodes = require('http-status-codes');
1+
var utils = require('./utils')
2+
var statusCodes = require('http-status-codes')
33

44
module.exports = function (app, options) {
5-
//get remote methods.
6-
//set strong-remoting for more information
7-
//https://github.com/strongloop/strong-remoting
8-
var remotes = app.remotes();
5+
// get remote methods.
6+
// set strong-remoting for more information
7+
// https://github.com/strongloop/strong-remoting
8+
var remotes = app.remotes()
99

10-
//register after remote method hook on all methods
10+
// register after remote method hook on all methods
1111
remotes.after('**', function (ctx, next) {
12-
1312
if (utils.shouldNotApplyJsonApi(ctx, options)) {
14-
return next();
15-
};
13+
return next()
14+
}
1615

17-
//in this case we are only interested in handling create operations.
16+
// in this case we are only interested in handling create operations.
1817
if (ctx.method.name === 'deleteById') {
19-
//JSON API specifies that successful
20-
//deletes with no content returned should be 204
18+
// JSON API specifies that successful
19+
// deletes with no content returned should be 204
2120
if (ctx.res.statusCode === statusCodes.OK) {
22-
ctx.res.status(statusCodes.NO_CONTENT);
21+
ctx.res.status(statusCodes.NO_CONTENT)
2322
}
2423
}
25-
next();
26-
});
27-
};
24+
next()
25+
})
26+
}

0 commit comments

Comments
 (0)