Skip to content

Commit 5146b0c

Browse files
4e554c4cemersion
authored andcommitted
eslint: add lint enforcing camelCase
snake_case is needed in one place in the codebase to format URL arguments. Co-authored-by: Calvin Lee <[email protected]> Co-committed-by: Calvin Lee <[email protected]>
1 parent 513cf82 commit 5146b0c

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

eslint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export default [
3434
"no-implicit-coercion": "warn",
3535
"object-shorthand": "warn",
3636
"curly": "warn",
37+
"camelcase": "warn",
3738
"@stylistic/js/indent": ["warn", "tab"],
3839
"@stylistic/js/quotes": ["warn", "double"],
3940
"@stylistic/js/semi": "warn",

lib/oauth2.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ export function redirectAuthorize({ serverMetadata, clientId, redirectUri, scope
4343
// TODO: use the state param to prevent cross-site request
4444
// forgery
4545
let params = {
46-
response_type: "code",
47-
client_id: clientId,
48-
redirect_uri: redirectUri,
46+
"response_type": "code",
47+
"client_id": clientId,
48+
"redirect_uri": redirectUri,
4949
};
5050
if (scope) {
5151
params.scope = scope;
@@ -66,12 +66,12 @@ function buildPostHeaders(clientId, clientSecret) {
6666

6767
export async function exchangeCode({ serverMetadata, redirectUri, code, clientId, clientSecret }) {
6868
let data = {
69-
grant_type: "authorization_code",
69+
"grant_type": "authorization_code",
7070
code,
71-
redirect_uri: redirectUri,
71+
"redirect_uri": redirectUri,
7272
};
7373
if (!clientSecret) {
74-
data.client_id = clientId;
74+
data["client_id"] = clientId;
7575
}
7676

7777
let resp = await fetch(serverMetadata.token_endpoint, {

0 commit comments

Comments
 (0)