chore(style): update eslint

This commit is contained in:
Isaac
2025-02-11 18:42:43 +00:00
parent e7467800f2
commit 276243b487
9 changed files with 207 additions and 462 deletions

View File

@@ -9,7 +9,7 @@ const msToMins = ms => Number((ms / 1000 / 60).toFixed(2));
const getAvgResolutionTime = tickets => (tickets.reduce((total, ticket) => total + (ticket.closedAt - ticket.createdAt), 0) || 1) / Math.max(tickets.length, 1);
const getAvgResponseTime = tickets => (tickets.reduce((total, ticket) => total + (ticket.firstResponseAt - ticket.createdAt), 0) || 1) / Math.max(tickets.length, 1);
const getAvgResponseTime = tickets => (tickets.reduce((total, ticket) => total + (ticket.firstResponseAt - ticket.createdAt), 0) || 1) / Math.max(tickets.length, 1);
expose({
aggregateGuildForHouston(guild, messages) {

View File

@@ -120,8 +120,8 @@ module.exports.patch = fastify => ({
if (!original || original.guildId !== guildId) return res.status(400).send(new Error('Bad Request'));
if (data.hasOwnProperty('id')) delete data.id;
if (data.hasOwnProperty('createdAt')) delete data.createdAt;
if (Object.prototype.hasOwnProperty.call(data, 'id')) delete data.id;
if (Object.prototype.hasOwnProperty.call(data, 'createdAt')) delete data.createdAt;
const category = await client.prisma.category.update({
data: {

View File

@@ -49,20 +49,20 @@ module.exports.post = fastify => ({
res.raw.writeHead(200, { 'Content-Type': 'text/html; charset=utf-8' });
const userLog = {
_write(style1, style2, prefix, string) {
res.raw.write(`<p><span class="${style1}">[${prefix}]</span> <span class="${style2}">${string}</span></p>`);
},
error(string) {
this._write('text-red-500 font-bold', 'text-red-700 dark:text-red-200', 'ERROR', string);
this.write('text-red-500 font-bold', 'text-red-700 dark:text-red-200', 'ERROR', string);
},
info(string) {
this._write('text-cyan-500', 'text-cyan-700 dark:text-cyan-200', 'INFO', string);
this.write('text-cyan-500', 'text-cyan-700 dark:text-cyan-200', 'INFO', string);
},
success(string) {
this._write('text-green-500', 'text-green-700 dark:text-green-200', 'SUCCESS', string);
this.write('text-green-500', 'text-green-700 dark:text-green-200', 'SUCCESS', string);
},
warn(string) {
this._write('text-orange-500', 'text-orange-700 dark:text-orange-200', 'WARN', string);
this.write('text-orange-500', 'text-orange-700 dark:text-orange-200', 'WARN', string);
},
write(style1, style2, prefix, string) {
res.raw.write(`<p><span class="${style1}">[${prefix}]</span> <span class="${style2}">${string}</span></p>`);
},
};

View File

@@ -17,8 +17,8 @@ module.exports.get = fastify => ({
module.exports.patch = fastify => ({
handler: async req => {
const data = req.body;
if (data.hasOwnProperty('id')) delete data.id;
if (data.hasOwnProperty('createdAt')) delete data.createdAt;
if (Object.prototype.hasOwnProperty.call(data, 'id')) delete data.id;
if (Object.prototype.hasOwnProperty.call(data, 'createdAt')) delete data.createdAt;
const colours = ['errorColour', 'primaryColour', 'successColour'];
for (const c of colours) {
if (data[c] && !data[c].startsWith('#') && !(data[c] in Colors)) { // if not null/empty and not hex

View File

@@ -66,8 +66,8 @@ module.exports.patch = fastify => ({
if (!original || original.guildId !== guildId) return res.status(400).send(new Error('Bad Request'));
if (data.hasOwnProperty('id')) delete data.id;
if (data.hasOwnProperty('createdAt')) delete data.createdAt;
if (Object.prototype.hasOwnProperty.call(data, 'id')) delete data.id;
if (Object.prototype.hasOwnProperty.call(data, 'createdAt')) delete data.createdAt;
const tag = await client.prisma.tag.update({
data,