From 2206a1105076d182b695a7ed380c2acb8c1dac2f Mon Sep 17 00:00:00 2001 From: Null Date: Wed, 15 Apr 2020 11:02:13 -0500 Subject: [PATCH] Ignore eslint loops warning/error --- src/class/Util.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/class/Util.ts b/src/class/Util.ts index 674255b..a64eb89 100644 --- a/src/class/Util.ts +++ b/src/class/Util.ts @@ -53,6 +53,7 @@ export default class Util { if (!role && queries.split(' ').length > 0) { while (!role && queries.split(' ').length > 1) { queries = queries.split(' ').slice(0, queries.split(' ').length - 1).join(' '); + // eslint-disable-next-line no-loop-func role = roles.find((r) => r.id === queries || r.name === queries || r.name.toLowerCase() === queries.toLowerCase() || r.name.toLowerCase().startsWith(queries.toLowerCase())); } } @@ -67,6 +68,7 @@ export default class Util { if (queries.split(' ').length > 1 && !member) { while (!member && queries.split(' ').length > 0) { queries = queries.split(' ').slice(0, queries.length - 1).join(' '); + // eslint-disable-next-line no-loop-func member = members.find((m) => m.mention.replace('!', '') === queries.replace('!', '') || `${m.username}#${m.discriminator}` === query || m.username === queries || m.id === queries || m.nick === queries) // Exact match for mention, username+discrim, username and user ID || members.find((m) => `${m.username.toLowerCase()}#${m.discriminator}` === queries.toLowerCase() || m.username.toLowerCase() === queries.toLowerCase() || (m.nick && m.nick.toLowerCase() === queries.toLowerCase())) // Case insensitive match for username+discrim, username || members.find((m) => m.username.toLowerCase().startsWith(queries.toLowerCase()) || (m.nick && m.nick.toLowerCase().startsWith(queries.toLowerCase())));