mirror of
https://hk.gh-proxy.com/https://github.com/NodeBB/nodebb-plugin-composer-default.git
synced 2025-10-03 04:31:23 +08:00
chore: upgrade eslint
This commit is contained in:
parent
dcd2808e23
commit
70ca805f0b
6 changed files with 26 additions and 19 deletions
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"extends": "nodebb/lib"
|
||||
}
|
10
eslint.config.mjs
Normal file
10
eslint.config.mjs
Normal file
|
@ -0,0 +1,10 @@
|
|||
'use strict';
|
||||
|
||||
import serverConfig from 'eslint-config-nodebb';
|
||||
import publicConfig from 'eslint-config-nodebb/public';
|
||||
|
||||
export default [
|
||||
...publicConfig,
|
||||
...serverConfig,
|
||||
];
|
||||
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue