eslint: add lint enforcing camelCase

snake_case is needed in one place in the codebase to format URL arguments.
Co-authored-by: Calvin Lee <pounce@integraldoma.in>
Co-committed-by: Calvin Lee <pounce@integraldoma.in>
This commit is contained in:
Calvin Lee 2025-01-27 16:29:58 +00:00 committed by Simon Ser
parent 513cf825a5
commit 5146b0cad8
2 changed files with 7 additions and 6 deletions

View File

@ -34,6 +34,7 @@ export default [
"no-implicit-coercion": "warn",
"object-shorthand": "warn",
"curly": "warn",
"camelcase": "warn",
"@stylistic/js/indent": ["warn", "tab"],
"@stylistic/js/quotes": ["warn", "double"],
"@stylistic/js/semi": "warn",

View File

@ -43,9 +43,9 @@ export function redirectAuthorize({ serverMetadata, clientId, redirectUri, scope
// TODO: use the state param to prevent cross-site request
// forgery
let params = {
response_type: "code",
client_id: clientId,
redirect_uri: redirectUri,
"response_type": "code",
"client_id": clientId,
"redirect_uri": redirectUri,
};
if (scope) {
params.scope = scope;
@ -66,12 +66,12 @@ function buildPostHeaders(clientId, clientSecret) {
export async function exchangeCode({ serverMetadata, redirectUri, code, clientId, clientSecret }) {
let data = {
grant_type: "authorization_code",
"grant_type": "authorization_code",
code,
redirect_uri: redirectUri,
"redirect_uri": redirectUri,
};
if (!clientSecret) {
data.client_id = clientId;
data["client_id"] = clientId;
}
let resp = await fetch(serverMetadata.token_endpoint, {