Skip to content

Commit 558e8cf

Browse files
committed
Switch to eslint
jshint is no longer maintained, and has security vulnerabilities that have not been addressed. eslint is only supported on Node 6+
1 parent 2808bad commit 558e8cf

19 files changed

+930
-918
lines changed

.eslintrc

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"env": {
3+
"jquery": true,
4+
"mocha": true,
5+
"node": true
6+
},
7+
"globals": {},
8+
"rules": {
9+
"no-bitwise": 2,
10+
"curly": 2,
11+
"eqeqeq": 2,
12+
"no-unused-expressions": 2,
13+
"strict": 0,
14+
"wrap-iife": [
15+
2,
16+
"any"
17+
],
18+
"indent": [
19+
2,
20+
2,
21+
{
22+
"SwitchCase": 1
23+
}
24+
],
25+
"no-use-before-define": 0,
26+
"new-cap": 2,
27+
"no-caller": 2,
28+
"require-yield": 2,
29+
"quotes": [
30+
2,
31+
"single"
32+
],
33+
"no-undef": 2,
34+
"no-unused-vars": 2
35+
}
36+
}

.jshintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.jshintrc

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

.travis.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
language: node_js
22

33
node_js:
4-
- 4
5-
- 4.0
64
- 6
7-
- 6.0
85
- 7
9-
- 7.0
106
- 8
11-
- 8.0
7+
- 9
8+
- 10
129

1310
sudo: false

lib/grant-types/authorization-code-grant-type.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -133,21 +133,21 @@ AuthorizationCodeGrantType.prototype.getAuthorizationCode = function(request, cl
133133
* @see https://tools.ietf.org/html/rfc6749#section-4.1.3
134134
*/
135135

136-
AuthorizationCodeGrantType.prototype.validateRedirectUri = function(request, code) {
137-
if (!code.redirectUri) {
138-
return;
139-
}
136+
AuthorizationCodeGrantType.prototype.validateRedirectUri = function(request, code) {
137+
if (!code.redirectUri) {
138+
return;
139+
}
140140

141-
var redirectUri = request.body.redirect_uri || request.query.redirect_uri;
141+
var redirectUri = request.body.redirect_uri || request.query.redirect_uri;
142142

143-
if (!is.uri(redirectUri)) {
144-
throw new InvalidRequestError('Invalid request: `redirect_uri` is not a valid URI');
145-
}
143+
if (!is.uri(redirectUri)) {
144+
throw new InvalidRequestError('Invalid request: `redirect_uri` is not a valid URI');
145+
}
146146

147-
if (redirectUri !== code.redirectUri) {
148-
throw new InvalidRequestError('Invalid request: `redirect_uri` is invalid');
149-
}
150-
};
147+
if (redirectUri !== code.redirectUri) {
148+
throw new InvalidRequestError('Invalid request: `redirect_uri` is invalid');
149+
}
150+
};
151151

152152
/**
153153
* Revoke the authorization code.

lib/handlers/revoke-handler.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,9 @@ RevokeHandler.prototype.handleRevokeToken = function(request, client) {
111111
})
112112
.then(function(token) {
113113
return Promise.any([
114-
this.getAccessToken(token, client),
115-
this.getRefreshToken(token, client)
116-
])
114+
this.getAccessToken(token, client),
115+
this.getRefreshToken(token, client)
116+
])
117117
.catch(Promise.AggregateError, function(err) {
118118
err.forEach(function(e) {
119119
throw e;

0 commit comments

Comments
 (0)