refactor: switch eslint configs to esm

add rules from https://eslint.style/
refactor for in loops to use Object.entries
This commit is contained in:
Barış Soner Uşaklı
2025-04-18 21:57:12 -04:00
parent 0c5ef0e866
commit 92d6e0220b
21 changed files with 93 additions and 132 deletions

View File

@@ -180,14 +180,12 @@ module.exports = function (utils, Benchpress, relative_path) {
function spawnPrivilegeStates(cid, member, privileges, types) {
const states = [];
for (const priv in privileges) {
if (privileges.hasOwnProperty(priv)) {
states.push({
name: priv,
state: privileges[priv],
type: types[priv],
});
}
for (const [priv, state] of Object.entries(privileges)) {
states.push({
name: priv,
state: state,
type: types[priv],
});
}
return states.map(function (priv) {
const guestDisabled = ['groups:moderate', 'groups:posts:upvote', 'groups:posts:downvote', 'groups:local:login', 'groups:group:create'];