chore: upgrade eslint

This commit is contained in:
Barış Soner Uşaklı 2025-05-01 10:06:00 -04:00
parent dcd2808e23
commit 70ca805f0b
6 changed files with 26 additions and 19 deletions

View file

@ -1,3 +0,0 @@
{
"extends": "nodebb/lib"
}

10
eslint.config.mjs Normal file
View file

@ -0,0 +1,10 @@
'use strict';

import serverConfig from 'eslint-config-nodebb';
import publicConfig from 'eslint-config-nodebb/public';

export default [
...publicConfig,
...serverConfig,
];

View file

@ -33,8 +33,8 @@
"validator": "^13.7.0"
},
"devDependencies": {
"eslint": "^7.32.0",
"eslint-config-nodebb": "^0.0.1",
"eslint-plugin-import": "^2.23.4"
"eslint": "^9.25.1",
"eslint-config-nodebb": "^1.1.4",
"eslint-plugin-import": "^2.31.0"
}
}

View file

@ -121,7 +121,7 @@ define('composer', [
id = post[type];

// Find a match
for (var uuid in composer.posts) {
for (const uuid of Object.keys(composer.posts)) {
if (composer.posts[uuid].hasOwnProperty(type) && id === composer.posts[uuid][type]) {
return uuid;
}
@ -179,8 +179,8 @@ define('composer', [

composer.findByTid = function (tid) {
// Iterates through the initialised composers and returns the uuid of the matching composer
for (var uuid in composer.posts) {
if (composer.posts.hasOwnProperty(uuid) && composer.posts[uuid].hasOwnProperty('tid') && parseInt(composer.posts[uuid].tid, 10) === parseInt(tid, 10)) {
for (const uuid of Object.keys(composer.posts)) {
if (composer.posts[uuid].hasOwnProperty('tid') && String(composer.posts[uuid].tid) === String(tid)) {
return uuid;
}
}

View file

@ -4,7 +4,7 @@ define('composer/post-queue', [], function () {
const postQueue = {};

postQueue.showAlert = async function (postContainer, postData) {
const alertEl = postContainer.find('[component="composer/post-queue/alert"]')
const alertEl = postContainer.find('[component="composer/post-queue/alert"]');
if (!config.postQueue || app.user.isAdmin || app.user.isGlobalMod || app.user.isMod) {
alertEl.remove();
return;