fix: 🚨 Fix DeepSource linter warnings

This commit is contained in:
Jesse Wierzbinski 2025-04-09 02:15:00 +02:00
parent 45e5460975
commit 1d301d72ae
No known key found for this signature in database
10 changed files with 39 additions and 40 deletions

View file

@ -158,7 +158,7 @@ export class FederationRequester {
* Attempt to resolve a webfinger URL to a User
* @returns {Promise<User | null>} The resolved User or null if not found
*/
public async resolveWebFinger(
public static async resolveWebFinger(
username: string,
hostname: string,
contentType = "application/json",

View file

@ -10,7 +10,7 @@ import {
oneOrMore,
} from "magic-regexp";
export const semverRegex: RegExp = new RegExp(
export const semverRegex = new RegExp(
/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/gm,
);
@ -57,8 +57,8 @@ export const emojiRegex: RegExp = createRegExp(
// This will accept a lot of stuff that isn't an ISO string
// but ISO validation is incredibly complex so fuck it
export const isISOString = (val: string | Date): boolean => {
const d = new Date(val);
return !Number.isNaN(d.valueOf());
const date = new Date(val);
return !Number.isNaN(date.valueOf());
};
export const ianaTimezoneRegex = /^(?:[A-Za-z]+(?:\/[A-Za-z_]+)+|UTC)$/;