lint fixes

This commit is contained in:
Hafiz
2025-08-05 13:10:07 -05:00
parent ffa73698a5
commit c1ab9cb6ca

View File

@@ -168,7 +168,7 @@ export default async function highlightMentions (text) {
members = await User
.find({
$or: usernameRegexes.map(regex => ({ 'auth.local.username': regex })),
'flags.verifiedUsername': true
'flags.verifiedUsername': true,
})
.select(['auth.local.username', '_id', 'preferences.pushNotifications', 'pushDevices', 'party', 'guilds'])
.lean()
@@ -178,12 +178,10 @@ export default async function highlightMentions (text) {
const { username } = member.auth.local;
const regex = new RegExp(`@${escapeRegExp(username)}(?![\\-\\w])`, 'gi');
textBlocks.transformValidBlocks(blockText =>
blockText.replace(regex, match => {
const mentionedUsername = match.substr(1);
return `[@${mentionedUsername}](${baseUrl}/profile/${member._id})`;
})
);
textBlocks.transformValidBlocks(blockText => blockText.replace(regex, match => {
const mentionedUsername = match.substr(1);
return `[@${mentionedUsername}](${baseUrl}/profile/${member._id})`;
}));
});
}