fix backend lint errors

This commit is contained in:
Hazelnoot 2025-04-02 10:35:11 -04:00
parent 9dffb13be7
commit f9c1535147
13 changed files with 27 additions and 23 deletions

View file

@ -487,7 +487,7 @@ function applyEnvOverrides(config: Source) {
}
}
function _step2name(step: string|number): string {
function _step2name(step: string | number): string {
return step.toString().replaceAll(/[^a-z0-9]+/gi, '').toUpperCase();
}

View file

@ -34,7 +34,7 @@ export class DownloadService {
}
@bindThis
public async downloadUrl(url: string, path: string, options: { timeout?: number, operationTimeout?: number, maxSize?: number} = {} ): Promise<{
public async downloadUrl(url: string, path: string, options: { timeout?: number, operationTimeout?: number, maxSize?: number } = {} ): Promise<{
filename: string;
}> {
this.logger.info(`Downloading ${chalk.cyan(url)} to ${chalk.cyanBright(path)} ...`);

View file

@ -112,7 +112,7 @@ export interface IActivity extends IObject {
actor: IObject | string;
// ActivityPub spec allows for arrays: https://www.w3.org/TR/activitystreams-vocabulary/#properties
// Misskey can only handle one value, so we use a tuple for that case.
object: IObject | string | [IObject | string] ;
object: IObject | string | [IObject | string];
target?: IObject | string;
/** LD-Signature */
signature?: {

View file

@ -77,7 +77,7 @@ type PackedPureRenote = PackedRenote & {
replyId: NonNullable<Packed<'Note'>['replyId']>;
poll: NonNullable<Packed<'Note'>['poll']>;
fileIds: NonNullable<Packed<'Note'>['fileIds']>;
}
};
export function isRenotePacked(note: Packed<'Note'>): note is PackedRenote {
return note.renoteId != null;

View file

@ -83,7 +83,7 @@ export class ImportNotesProcessorService {
}
@bindThis
private downloadUrl(url: string, path:string): Promise<{filename: string}> {
private downloadUrl(url: string, path:string): Promise<{ filename: string }> {
return this.downloadService.downloadUrl(url, path, { operationTimeout: this.config.import?.downloadTimeout, maxSize: this.config.import?.maxFileSize });
}

View file

@ -161,4 +161,4 @@ export type ThinUser = {
export type ScheduleNotePostJobData = {
scheduleNoteId: MiNote['id'];
}
};

View file

@ -100,7 +100,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
id: string;
note: {
text?: string;
cw?: string|null;
cw?: string | null;
fileIds: string[];
visibility: typeof noteVisibilities[number];
visibleUsers: Packed<'UserLite'>[];

View file

@ -192,7 +192,7 @@ export class MastodonApiServerService {
reply.send(response);
});
fastify.post<{ Body: { description?: string; focus?: string }}>('/v2/media', { preHandler: upload.single('file') }, async (_request, reply) => {
fastify.post<{ Body: { description?: string; focus?: string } }>('/v2/media', { preHandler: upload.single('file') }, async (_request, reply) => {
const multipartData = await _request.file();
if (!multipartData) {
reply.code(401).send({ error: 'No image' });
@ -284,7 +284,7 @@ export class MastodonApiServerService {
reply.send(response);
});
fastify.get<{ Querystring: { limit?: string }}>('/v1/follow_requests', async (_request, reply) => {
fastify.get<{ Querystring: { limit?: string } }>('/v1/follow_requests', async (_request, reply) => {
const client = this.clientService.getClient(_request);
const limit = _request.query.limit ? parseInt(_request.query.limit) : 20;

View file

@ -142,7 +142,7 @@ export class ApiAccountMastodon {
reply.send(response);
});
fastify.get<{ Querystring: { acct?: string }}>('/v1/accounts/lookup', async (_request, reply) => {
fastify.get<{ Querystring: { acct?: string } }>('/v1/accounts/lookup', async (_request, reply) => {
if (!_request.query.acct) return reply.code(400).send({ error: 'BAD_REQUEST', error_description: 'Missing required property "acct"' });
const client = this.clientService.getClient(_request);
@ -154,7 +154,7 @@ export class ApiAccountMastodon {
reply.send(response);
});
fastify.get<ApiAccountMastodonRoute & { Querystring: { id?: string | string[] }}>('/v1/accounts/relationships', async (_request, reply) => {
fastify.get<ApiAccountMastodonRoute & { Querystring: { id?: string | string[] } }>('/v1/accounts/relationships', async (_request, reply) => {
if (!_request.query.id) return reply.code(400).send({ error: 'BAD_REQUEST', error_description: 'Missing required property "id"' });
const client = this.clientService.getClient(_request);