From b55a037dc3e2a436541a8db436a7784ed56a74fd Mon Sep 17 00:00:00 2001 From: Zach Date: Fri, 15 Mar 2024 17:45:59 -0500 Subject: [PATCH] undid some default linter properties -> enabled standards --- common/js/index-buttons.js | 10 +++++----- lib/create-server.js | 4 ++-- lib/handlers/get.js | 6 +++--- lib/models/account-manager.js | 2 +- test/integration/http-copy-test.js | 4 ++-- test/unit/create-account-request-test.js | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/common/js/index-buttons.js b/common/js/index-buttons.js index 69aa89d1e..1963dd5a3 100644 --- a/common/js/index-buttons.js +++ b/common/js/index-buttons.js @@ -8,14 +8,14 @@ document.addEventListener('DOMContentLoaded', async function () { const authSession = UI.authn.authSession if (!authn.currentUser()) await authn.checkUser() - const user = authn.currentUser() + let user = authn.currentUser() // IF LOGGED IN: SET SolidServerRootRedirectLink. LOGOUT if (user) { window.localStorage.setItem(keyname, user.uri) await authSession.logout() } else { - const webId = window.localStorage.getItem(keyname) + let webId = window.localStorage.getItem(keyname) // IF NOT LOGGED IN AND COOKIE EXISTS: REMOVE COOKIE, HIDE WELCOME, SHOW LINK TO PROFILE if (webId) { @@ -28,9 +28,9 @@ document.addEventListener('DOMContentLoaded', async function () { // SHOW WELCOME, SHOW LOGIN BUTTON // HIDE LOGIN BUTTON, ADD REGISTER BUTTON else { - const loginArea = document.getElementById('loginStatusArea') - const html = '' - const span = document.createElement('span') + let loginArea = document.getElementById('loginStatusArea') + let html = '' + let span = document.createElement('span') span.innerHTML = html loginArea.appendChild(span) loginArea.appendChild(UI.login.loginStatusBox(document, null, {})) diff --git a/lib/create-server.js b/lib/create-server.js index 1b8760ef2..23fe4048d 100644 --- a/lib/create-server.js +++ b/lib/create-server.js @@ -68,8 +68,8 @@ function createServer (argv, app) { } const credentials = Object.assign({ - key, - cert + key: key, + key: cert }, argv) if (ldp.webid && ldp.auth === 'tls') { diff --git a/lib/handlers/get.js b/lib/handlers/get.js index d7c348964..b73146ce5 100644 --- a/lib/handlers/get.js +++ b/lib/handlers/get.js @@ -43,9 +43,9 @@ async function handler (req, res, next) { const options = { hostname: req.hostname, - path, - includeBody, - possibleRDFType, + path: path, + includeBody: includeBody, + possibleRDFType: possibleRDFType, range: req.headers.range, contentType: req.headers.accept } diff --git a/lib/models/account-manager.js b/lib/models/account-manager.js index 0aada4d75..c41cb1ade 100644 --- a/lib/models/account-manager.js +++ b/lib/models/account-manager.js @@ -552,7 +552,7 @@ class AccountManager { const emailData = { to: userAccount.email, webId: userAccount.webId, - deleteUrl + deleteUrl: deleteUrl } return this.emailService.sendWithTemplate('delete-account', emailData) diff --git a/test/integration/http-copy-test.js b/test/integration/http-copy-test.js index 9a31be748..f592b13d2 100644 --- a/test/integration/http-copy-test.js +++ b/test/integration/http-copy-test.js @@ -43,8 +43,8 @@ describe('HTTP COPY API', function () { function createOptions (method, url, user) { const options = { - method, - url, + method: method, + url: url, headers: {} } if (user) { diff --git a/test/unit/create-account-request-test.js b/test/unit/create-account-request-test.js index 209588600..656f4c687 100644 --- a/test/unit/create-account-request-test.js +++ b/test/unit/create-account-request-test.js @@ -107,7 +107,7 @@ describe('CreateAccountRequest', () => { const requests = invalidUsernames.map((username) => { const aliceData = { - username, password: '1234' + username: username, password: '1234' } const req = HttpMocks.createRequest({ app: { locals }, body: aliceData })