From 913c1d784410e402f2ec718fd05882631ea2788a Mon Sep 17 00:00:00 2001 From: freddcastro Date: Wed, 13 Nov 2024 21:40:54 -0400 Subject: [PATCH] se arreglaron los problemas de linter --- public/src/client/register.js | 2 +- src/posts/create.js | 2 +- src/topics/create.js | 2 +- src/user/create.js | 3 +-- test/api.js | 10 +++++----- 5 files changed, 9 insertions(+), 10 deletions(-) diff --git a/public/src/client/register.js b/public/src/client/register.js index 5b38a874d8..37a681360e 100644 --- a/public/src/client/register.js +++ b/public/src/client/register.js @@ -15,7 +15,7 @@ define('forum/register', [ const password_confirm = $('#password-confirm'); const register = $('#register'); - showSuccess(isProfessor) + showSuccess(isProfessor); handleLanguageOverride(); $('#content #noscript').val('false'); diff --git a/src/posts/create.js b/src/posts/create.js index a626fe77f6..e7f2d93dc4 100644 --- a/src/posts/create.js +++ b/src/posts/create.js @@ -19,7 +19,7 @@ module.exports = function (Posts) { const content = data.content.toString(); const timestamp = data.timestamp || Date.now(); const isMain = data.isMain || false; - let isUrgent = Boolean(data.isUrgent) || false; + const isUrgent = Boolean(data.isUrgent) || false; if (!uid && parseInt(uid, 10) !== 0) { throw new Error('[[error:invalid-uid]]'); diff --git a/src/topics/create.js b/src/topics/create.js index 8ca01f9806..0d6ee1bc19 100644 --- a/src/topics/create.js +++ b/src/topics/create.js @@ -155,7 +155,7 @@ module.exports = function (Topics) { user.notifications.sendTopicNotificationToFollowers(uid, topicData, postData); Topics.notifyTagFollowers(postData, uid); categories.notifyCategoryFollowers(postData, uid); - } + } return { topicData: topicData, diff --git a/src/user/create.js b/src/user/create.js index aadace9d11..fd2603e5cf 100644 --- a/src/user/create.js +++ b/src/user/create.js @@ -41,7 +41,6 @@ module.exports = function (User) { } async function create(data) { - const timestamp = data.timestamp || Date.now(); let userData = { @@ -50,7 +49,7 @@ module.exports = function (User) { joindate: timestamp, lastonline: timestamp, status: 'online', - isProfessor: data.isProfessor == 'on' + isProfessor: data.isProfessor === 'on', }; ['picture', 'fullname', 'location', 'birthday'].forEach((field) => { if (data[field]) { diff --git a/test/api.js b/test/api.js index bb9bcc3cf9..5d8e56fb18 100644 --- a/test/api.js +++ b/test/api.js @@ -251,21 +251,21 @@ describe('API', async () => { cid: testCategory.cid, title: 'Test Topic', content: 'Test topic content', - isUrgent: false + isUrgent: false, }); const unprivTopic = await topics.post({ uid: unprivUid, cid: testCategory.cid, title: 'Test Topic 2', content: 'Test topic 2 content', - isUrgent: false + isUrgent: false, }); await topics.post({ uid: unprivUid, cid: testCategory.cid, title: 'Test Topic 3', content: 'Test topic 3 content', - isUrgent: true + isUrgent: true, }); // Create a post diff @@ -633,9 +633,9 @@ describe('API', async () => { assert.strictEqual(typeof response[prop], 'string', `"${prop}" was expected to be a string, but was ${typeof response[prop]} instead (path: ${method} ${path}, context: ${context})`); break; case 'boolean': - if (response[prop] === "true") { + if (response[prop] === 'true') { response[prop] = true; - } else if (response[prop] === "false") { + } else if (response[prop] === 'false') { response[prop] = false; } assert.strictEqual(typeof response[prop], 'boolean', `"${prop}" was expected to be a boolean, but was ${typeof response[prop]} instead (path: ${method} ${path}, context: ${context})`);