enable and fix no-unused-vars and no-async-promise-executor (#17070)

* dev: set --no-bail for lint task

* lint: enable no-async-promise-executor lint and fix them

* lint: enable no-unused-vars with allowing _ prefix

* lint: fix semi
This commit is contained in:
anatawa12 2026-01-08 11:49:12 +09:00 committed by GitHub
parent cf89c4e363
commit 666f78e676
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
144 changed files with 324 additions and 354 deletions

View File

@ -39,7 +39,7 @@
"migrateandstart": "pnpm migrate && pnpm start", "migrateandstart": "pnpm migrate && pnpm start",
"watch": "pnpm dev", "watch": "pnpm dev",
"dev": "node scripts/dev.mjs", "dev": "node scripts/dev.mjs",
"lint": "pnpm -r lint", "lint": "pnpm --no-bail -r lint",
"cy:open": "pnpm cypress open --config-file=cypress.config.ts", "cy:open": "pnpm cypress open --config-file=cypress.config.ts",
"cy:run": "pnpm cypress run", "cy:run": "pnpm cypress run",
"e2e": "pnpm start-server-and-test start:test http://localhost:61812 cy:run", "e2e": "pnpm start-server-and-test start:test http://localhost:61812 cy:run",

View File

@ -9,7 +9,7 @@ window.onload = async () => {
const account = JSON.parse(localStorage.getItem('account')); const account = JSON.parse(localStorage.getItem('account'));
const i = account.token; const i = account.token;
const api = (endpoint, data = {}) => { const _api = (endpoint, data = {}) => {
const promise = new Promise((resolve, reject) => { const promise = new Promise((resolve, reject) => {
// Append a credential // Append a credential
if (i) data.i = i; if (i) data.i = i;

View File

@ -25,7 +25,6 @@ export default [
}, },
}, },
rules: { rules: {
'@typescript-eslint/no-unused-vars': 'off',
'import/order': ['warn', { 'import/order': ['warn', {
groups: [ groups: [
'builtin', 'builtin',

View File

@ -16,24 +16,22 @@ async function connectToPostgres() {
} }
async function connectToRedis(redisOptions) { async function connectToRedis(redisOptions) {
return await new Promise(async (resolve, reject) => { let redis;
const redis = new Redis({ try {
redis = new Redis({
...redisOptions, ...redisOptions,
lazyConnect: true, lazyConnect: true,
reconnectOnError: false, reconnectOnError: false,
showFriendlyErrorStack: true, showFriendlyErrorStack: true,
}); });
redis.on('error', e => reject(e));
try { await Promise.race([
await redis.connect(); new Promise((_, reject) => redis.on('error', e => reject(e))),
resolve(); redis.connect(),
} catch (e) { ]);
reject(e); } finally {
} finally { redis.disconnect(false);
redis.disconnect(false); }
}
});
} }
// If not all of these are defined, the default one gets reused. // If not all of these are defined, the default one gets reused.

View File

@ -58,7 +58,7 @@ export async function masterMain() {
//await connectDb(); //await connectDb();
if (config.pidFile) fs.writeFileSync(config.pidFile, process.pid.toString()); if (config.pidFile) fs.writeFileSync(config.pidFile, process.pid.toString());
} catch (e) { } catch (e) {
bootLogger.error('Fatal error occurred during initialization', null, true); bootLogger.error('Fatal error occurred during initialization: ' + e, null, true);
process.exit(1); process.exit(1);
} }

View File

@ -352,7 +352,7 @@ export function loadConfig(): Config {
function tryCreateUrl(url: string) { function tryCreateUrl(url: string) {
try { try {
return new URL(url); return new URL(url);
} catch (e) { } catch (_) {
throw new Error(`url="${url}" is not a valid URL.`); throw new Error(`url="${url}" is not a valid URL.`);
} }
} }

View File

@ -75,7 +75,7 @@ export class AccountMoveService {
*/ */
@bindThis @bindThis
public async moveFromLocal(src: MiLocalUser, dst: MiLocalUser | MiRemoteUser): Promise<unknown> { public async moveFromLocal(src: MiLocalUser, dst: MiLocalUser | MiRemoteUser): Promise<unknown> {
const srcUri = this.userEntityService.getUserUri(src); const _srcUri = this.userEntityService.getUserUri(src);
const dstUri = this.userEntityService.getUserUri(dst); const dstUri = this.userEntityService.getUserUri(dst);
// add movedToUri to indicate that the user has moved // add movedToUri to indicate that the user has moved

View File

@ -205,7 +205,7 @@ export class AnnouncementService {
announcementId: announcementId, announcementId: announcementId,
userId: user.id, userId: user.id,
}); });
} catch (e) { } catch (_) {
return; return;
} }

View File

@ -39,7 +39,7 @@ export class AvatarDecorationService implements OnApplicationShutdown {
const obj = JSON.parse(data); const obj = JSON.parse(data);
if (obj.channel === 'internal') { if (obj.channel === 'internal') {
const { type, body } = obj.message as GlobalEvents['internal']['payload']; const { type, body: _ } = obj.message as GlobalEvents['internal']['payload'];
switch (type) { switch (type) {
case 'avatarDecorationCreated': case 'avatarDecorationCreated':
case 'avatarDecorationUpdated': case 'avatarDecorationUpdated':

View File

@ -366,7 +366,7 @@ export class EmailService {
valid: true, valid: true,
reason: null, reason: null,
}; };
} catch (error) { } catch (_) {
return { return {
valid: false, valid: false,
reason: 'network', reason: 'network',

View File

@ -484,25 +484,13 @@ export class FileInfoService {
* Calculate blurhash string of image * Calculate blurhash string of image
*/ */
@bindThis @bindThis
private getBlurhash(path: string, type: string): Promise<string> { private async getBlurhash(path: string, type: string): Promise<string> {
return new Promise(async (resolve, reject) => { const sharp = await sharpBmp(path, type);
(await sharpBmp(path, type)) const { data: buffer, info } = await sharp
.raw() .raw()
.ensureAlpha() .ensureAlpha()
.resize(64, 64, { fit: 'inside' }) .resize(64, 64, { fit: 'inside' })
.toBuffer((err, buffer, info) => { .toBuffer({ resolveWithObject: true });
if (err) return reject(err); return blurhash.encode(new Uint8ClampedArray(buffer), info.width, info.height, 5, 5);
let hash;
try {
hash = blurhash.encode(new Uint8ClampedArray(buffer), info.width, info.height, 5, 5);
} catch (e) {
return reject(e);
}
resolve(hash);
});
});
} }
} }

View File

@ -308,7 +308,7 @@ export class MfmService {
try { try {
const date = new Date(parseInt(text, 10) * 1000); const date = new Date(parseInt(text, 10) * 1000);
return `<time datetime="${escapeHtml(date.toISOString())}">${escapeHtml(date.toISOString())}</time>`; return `<time datetime="${escapeHtml(date.toISOString())}">${escapeHtml(date.toISOString())}</time>`;
} catch (err) { } catch (_) {
return fnDefault(node); return fnDefault(node);
} }
} }
@ -376,7 +376,7 @@ export class MfmService {
try { try {
const url = new URL(node.props.url); const url = new URL(node.props.url);
return `<a href="${escapeHtml(url.href)}">${toHtml(node.children)}</a>`; return `<a href="${escapeHtml(url.href)}">${toHtml(node.children)}</a>`;
} catch (err) { } catch (_) {
return `[${toHtml(node.children)}](${escapeHtml(node.props.url)})`; return `[${toHtml(node.children)}](${escapeHtml(node.props.url)})`;
} }
}, },
@ -390,7 +390,7 @@ export class MfmService {
try { try {
const url = new URL(href); const url = new URL(href);
return `<a href="${escapeHtml(url.href)}" class="u-url mention">${escapeHtml(acct)}</a>`; return `<a href="${escapeHtml(url.href)}" class="u-url mention">${escapeHtml(acct)}</a>`;
} catch (err) { } catch (_) {
return escapeHtml(acct); return escapeHtml(acct);
} }
}, },
@ -419,7 +419,7 @@ export class MfmService {
try { try {
const url = new URL(node.props.url); const url = new URL(node.props.url);
return `<a href="${escapeHtml(url.href)}">${escapeHtml(node.props.url)}</a>`; return `<a href="${escapeHtml(url.href)}">${escapeHtml(node.props.url)}</a>`;
} catch (err) { } catch (_) {
return escapeHtml(node.props.url); return escapeHtml(node.props.url);
} }
}, },

View File

@ -187,9 +187,9 @@ export class NoteDraftService {
} }
//#region visibleUsers //#region visibleUsers
let visibleUsers: MiUser[] = []; let _visibleUsers: MiUser[] = [];
if (data.visibleUserIds != null && data.visibleUserIds.length > 0) { if (data.visibleUserIds != null && data.visibleUserIds.length > 0) {
visibleUsers = await this.usersRepository.findBy({ _visibleUsers = await this.usersRepository.findBy({
id: In(data.visibleUserIds), id: In(data.visibleUserIds),
}); });
} }

View File

@ -314,7 +314,7 @@ export class RoleService implements OnApplicationShutdown, OnModuleInit {
default: default:
return false; return false;
} }
} catch (err) { } catch (_) {
// TODO: log error // TODO: log error
return false; return false;
} }

View File

@ -190,8 +190,7 @@ export class SearchService {
return this.searchNoteByMeiliSearch(q, me, opts, pagination); return this.searchNoteByMeiliSearch(q, me, opts, pagination);
} }
default: { default: {
// eslint-disable-next-line @typescript-eslint/no-unused-vars const _: never = this.provider;
const typeCheck: never = this.provider;
return []; return [];
} }
} }

View File

@ -49,8 +49,8 @@ export class UserSuspendService {
}); });
(async () => { (async () => {
await this.postSuspend(user).catch(e => {}); await this.postSuspend(user).catch(_ => {});
await this.unFollowAll(user).catch(e => {}); await this.unFollowAll(user).catch(_ => {});
})(); })();
} }
@ -67,7 +67,7 @@ export class UserSuspendService {
}); });
(async () => { (async () => {
await this.postUnsuspend(user).catch(e => {}); await this.postUnsuspend(user).catch(_ => {});
})(); })();
} }

View File

@ -98,7 +98,7 @@ export class UtilityService {
try { try {
// TODO: RE2インスタンスをキャッシュ // TODO: RE2インスタンスをキャッシュ
return new RE2(regexp[1], regexp[2]).test(text); return new RE2(regexp[1], regexp[2]).test(text);
} catch (err) { } catch (_) {
// This should never happen due to input sanitisation. // This should never happen due to input sanitisation.
return false; return false;
} }

View File

@ -515,7 +515,7 @@ export class ApRendererService {
const restPart = maybeUrl.slice(match[0].length); const restPart = maybeUrl.slice(match[0].length);
return `<a href="${urlPartParsed.href}" rel="me nofollow noopener" target="_blank">${urlPart}</a>${restPart}`; return `<a href="${urlPartParsed.href}" rel="me nofollow noopener" target="_blank">${urlPart}</a>${restPart}`;
} catch (e) { } catch (_) {
return maybeUrl; return maybeUrl;
} }
}; };

View File

@ -226,7 +226,7 @@ export class ApRequestService {
return await this.signedGet(href, user, allowSoftfail, false); return await this.signedGet(href, user, allowSoftfail, false);
} }
} }
} catch (e) { } catch (_) {
// something went wrong parsing the HTML, ignore the whole thing // something went wrong parsing the HTML, ignore the whole thing
} }
} }

View File

@ -138,7 +138,7 @@ export class ChatEntityService {
const reactions: { reaction: string; }[] = []; const reactions: { reaction: string; }[] = [];
for (const record of message.reactions) { for (const record of message.reactions) {
const [userId, reaction] = record.split('/'); const [, reaction] = record.split('/');
reactions.push({ reactions.push({
reaction, reaction,
}); });

View File

@ -55,13 +55,13 @@ export class MetaEntityService {
if (instance.defaultLightTheme) { if (instance.defaultLightTheme) {
try { try {
defaultLightTheme = JSON.stringify(JSON5.parse(instance.defaultLightTheme)); defaultLightTheme = JSON.stringify(JSON5.parse(instance.defaultLightTheme));
} catch (e) { } catch (_) {
} }
} }
if (instance.defaultDarkTheme) { if (instance.defaultDarkTheme) {
try { try {
defaultDarkTheme = JSON.stringify(JSON5.parse(instance.defaultDarkTheme)); defaultDarkTheme = JSON.stringify(JSON5.parse(instance.defaultDarkTheme));
} catch (e) { } catch (_) {
} }
} }

View File

@ -54,7 +54,7 @@ export class NoteReactionEntityService implements OnModuleInit {
packedUser?: Packed<'UserLite'> packedUser?: Packed<'UserLite'>
}, },
): Promise<Packed<'NoteReaction'>> { ): Promise<Packed<'NoteReaction'>> {
const opts = Object.assign({ const _opts = Object.assign({
}, options); }, options);
const reaction = typeof src === 'object' ? src : await this.noteReactionsRepository.findOneByOrFail({ id: src }); const reaction = typeof src === 'object' ? src : await this.noteReactionsRepository.findOneByOrFail({ id: src });
@ -90,7 +90,7 @@ export class NoteReactionEntityService implements OnModuleInit {
packedUser?: Packed<'UserLite'> packedUser?: Packed<'UserLite'>
}, },
): Promise<Packed<'NoteReactionWithNote'>> { ): Promise<Packed<'NoteReactionWithNote'>> {
const opts = Object.assign({ const _opts = Object.assign({
}, options); }, options);
const reaction = typeof src === 'object' ? src : await this.noteReactionsRepository.findOneByOrFail({ id: src }); const reaction = typeof src === 'object' ? src : await this.noteReactionsRepository.findOneByOrFail({ id: src });

View File

@ -56,7 +56,7 @@ export async function checkWordMute(note: NoteLike, me: UserLike | null | undefi
try { try {
return new RE2(regexp[1], regexp[2]).test(text); return new RE2(regexp[1], regexp[2]).test(text);
} catch (err) { } catch (_) {
// This should never happen due to input sanitisation. // This should never happen due to input sanitisation.
return false; return false;
} }

View File

@ -12,7 +12,7 @@ export function getIpHash(ip: string): string {
// (this means for IPv4 the entire address is used) // (this means for IPv4 the entire address is used)
const prefix = IPCIDR.createAddress(ip).mask(64); const prefix = IPCIDR.createAddress(ip).mask(64);
return 'ip-' + BigInt('0b' + prefix).toString(36); return 'ip-' + BigInt('0b' + prefix).toString(36);
} catch (e) { } catch (_) {
const prefix = IPCIDR.createAddress(ip.replace(/:[0-9]+$/, '')).mask(64); const prefix = IPCIDR.createAddress(ip.replace(/:[0-9]+$/, '')).mask(64);
return 'ip-' + BigInt('0b' + prefix).toString(36); return 'ip-' + BigInt('0b' + prefix).toString(36);
} }

View File

@ -26,7 +26,7 @@ export class I18n<T extends Record<string, any>> {
} }
} }
return str; return str;
} catch (e) { } catch (_) {
console.warn(`missing localization '${key}'`); console.warn(`missing localization '${key}'`);
return key; return key;
} }

View File

@ -262,8 +262,6 @@ type ObjectSchemaTypeDef<p extends Schema> =
never : never :
any; any;
type ObjectSchemaType<p extends Schema> = NullOrUndefined<p, ObjectSchemaTypeDef<p>>;
export type SchemaTypeDef<p extends Schema> = export type SchemaTypeDef<p extends Schema> =
p['type'] extends 'null' ? null : p['type'] extends 'null' ? null :
p['type'] extends 'integer' ? number : p['type'] extends 'integer' ? number :

View File

@ -67,7 +67,7 @@ export class MiAbuseReportNotificationRecipient {
/** /**
* . * .
*/ */
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn({ name: 'userId', referencedColumnName: 'id', foreignKeyConstraintName: 'FK_abuse_report_notification_recipient_userId1' }) @JoinColumn({ name: 'userId', referencedColumnName: 'id', foreignKeyConstraintName: 'FK_abuse_report_notification_recipient_userId1' })
@ -76,7 +76,7 @@ export class MiAbuseReportNotificationRecipient {
/** /**
* . * .
*/ */
@ManyToOne(type => MiUserProfile, { @ManyToOne(() => MiUserProfile, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn({ name: 'userId', referencedColumnName: 'userId', foreignKeyConstraintName: 'FK_abuse_report_notification_recipient_userId2' }) @JoinColumn({ name: 'userId', referencedColumnName: 'userId', foreignKeyConstraintName: 'FK_abuse_report_notification_recipient_userId2' })
@ -96,7 +96,7 @@ export class MiAbuseReportNotificationRecipient {
/** /**
* Webhook. * Webhook.
*/ */
@ManyToOne(type => MiSystemWebhook, { @ManyToOne(() => MiSystemWebhook, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn({ name: 'systemWebhookId', referencedColumnName: 'id', foreignKeyConstraintName: 'FK_abuse_report_notification_recipient_systemWebhookId' }) @JoinColumn({ name: 'systemWebhookId', referencedColumnName: 'id', foreignKeyConstraintName: 'FK_abuse_report_notification_recipient_systemWebhookId' })

View File

@ -18,7 +18,7 @@ export class MiAbuseUserReport {
@Column(id()) @Column(id())
public targetUserId: MiUser['id']; public targetUserId: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()
@ -28,7 +28,7 @@ export class MiAbuseUserReport {
@Column(id()) @Column(id())
public reporterId: MiUser['id']; public reporterId: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()
@ -40,7 +40,7 @@ export class MiAbuseUserReport {
}) })
public assigneeId: MiUser['id'] | null; public assigneeId: MiUser['id'] | null;
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'SET NULL', onDelete: 'SET NULL',
}) })
@JoinColumn() @JoinColumn()

View File

@ -41,7 +41,7 @@ export class MiAccessToken {
@Column(id()) @Column(id())
public userId: MiUser['id']; public userId: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()
@ -53,7 +53,7 @@ export class MiAccessToken {
}) })
public appId: MiApp['id'] | null; public appId: MiApp['id'] | null;
@ManyToOne(type => MiApp, { @ManyToOne(() => MiApp, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()

View File

@ -79,7 +79,7 @@ export class MiAnnouncement {
}) })
public userId: MiUser['id'] | null; public userId: MiUser['id'] | null;
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()

View File

@ -18,7 +18,7 @@ export class MiAnnouncementRead {
@Column(id()) @Column(id())
public userId: MiUser['id']; public userId: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()
@ -28,7 +28,7 @@ export class MiAnnouncementRead {
@Column(id()) @Column(id())
public announcementId: MiAnnouncement['id']; public announcementId: MiAnnouncement['id'];
@ManyToOne(type => MiAnnouncement, { @ManyToOne(() => MiAnnouncement, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()

View File

@ -24,7 +24,7 @@ export class MiAntenna {
}) })
public userId: MiUser['id']; public userId: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()
@ -45,7 +45,7 @@ export class MiAntenna {
}) })
public userListId: MiUserList['id'] | null; public userListId: MiUserList['id'] | null;
@ManyToOne(type => MiUserList, { @ManyToOne(() => MiUserList, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()

View File

@ -20,7 +20,7 @@ export class MiApp {
}) })
public userId: MiUser['id'] | null; public userId: MiUser['id'] | null;
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'SET NULL', onDelete: 'SET NULL',
nullable: true, nullable: true,
}) })

View File

@ -25,7 +25,7 @@ export class MiAuthSession {
}) })
public userId: MiUser['id'] | null; public userId: MiUser['id'] | null;
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
nullable: true, nullable: true,
}) })
@ -35,7 +35,7 @@ export class MiAuthSession {
@Column(id()) @Column(id())
public appId: MiApp['id']; public appId: MiApp['id'];
@ManyToOne(type => MiApp, { @ManyToOne(() => MiApp, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()

View File

@ -20,7 +20,7 @@ export class MiBlocking {
}) })
public blockeeId: MiUser['id']; public blockeeId: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()
@ -33,7 +33,7 @@ export class MiBlocking {
}) })
public blockerId: MiUser['id']; public blockerId: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()

View File

@ -18,7 +18,7 @@ export class MiBubbleGameRecord {
}) })
public userId: MiUser['id']; public userId: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()

View File

@ -27,7 +27,7 @@ export class MiChannel {
}) })
public userId: MiUser['id'] | null; public userId: MiUser['id'] | null;
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'SET NULL', onDelete: 'SET NULL',
}) })
@JoinColumn() @JoinColumn()
@ -52,7 +52,7 @@ export class MiChannel {
}) })
public bannerId: MiDriveFile['id'] | null; public bannerId: MiDriveFile['id'] | null;
@ManyToOne(type => MiDriveFile, { @ManyToOne(() => MiDriveFile, {
onDelete: 'SET NULL', onDelete: 'SET NULL',
}) })
@JoinColumn() @JoinColumn()

View File

@ -20,7 +20,7 @@ export class MiChannelFavorite {
}) })
public channelId: MiChannel['id']; public channelId: MiChannel['id'];
@ManyToOne(type => MiChannel, { @ManyToOne(() => MiChannel, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()
@ -32,7 +32,7 @@ export class MiChannelFavorite {
}) })
public userId: MiUser['id']; public userId: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()

View File

@ -21,7 +21,7 @@ export class MiChannelFollowing {
}) })
public followeeId: MiChannel['id']; public followeeId: MiChannel['id'];
@ManyToOne(type => MiChannel, { @ManyToOne(() => MiChannel, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()
@ -34,7 +34,7 @@ export class MiChannelFollowing {
}) })
public followerId: MiUser['id']; public followerId: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()

View File

@ -20,7 +20,7 @@ export class MiChannelMuting {
}) })
public userId: MiUser['id']; public userId: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()
@ -32,7 +32,7 @@ export class MiChannelMuting {
}) })
public channelId: MiChannel['id']; public channelId: MiChannel['id'];
@ManyToOne(type => MiChannel, { @ManyToOne(() => MiChannel, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()

View File

@ -19,7 +19,7 @@ export class MiChatApproval {
}) })
public userId: MiUser['id']; public userId: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()
@ -31,7 +31,7 @@ export class MiChatApproval {
}) })
public otherId: MiUser['id']; public otherId: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()

View File

@ -20,7 +20,7 @@ export class MiChatMessage {
}) })
public fromUserId: MiUser['id']; public fromUserId: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()
@ -32,7 +32,7 @@ export class MiChatMessage {
}) })
public toUserId: MiUser['id'] | null; public toUserId: MiUser['id'] | null;
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()
@ -44,7 +44,7 @@ export class MiChatMessage {
}) })
public toRoomId: MiChatRoom['id'] | null; public toRoomId: MiChatRoom['id'] | null;
@ManyToOne(type => MiChatRoom, { @ManyToOne(() => MiChatRoom, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()
@ -72,7 +72,7 @@ export class MiChatMessage {
}) })
public fileId: MiDriveFile['id'] | null; public fileId: MiDriveFile['id'] | null;
@ManyToOne(type => MiDriveFile, { @ManyToOne(() => MiDriveFile, {
onDelete: 'SET NULL', onDelete: 'SET NULL',
}) })
@JoinColumn() @JoinColumn()

View File

@ -23,7 +23,7 @@ export class MiChatRoom {
}) })
public ownerId: MiUser['id']; public ownerId: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()

View File

@ -20,7 +20,7 @@ export class MiChatRoomInvitation {
}) })
public userId: MiUser['id']; public userId: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()
@ -32,7 +32,7 @@ export class MiChatRoomInvitation {
}) })
public roomId: MiChatRoom['id']; public roomId: MiChatRoom['id'];
@ManyToOne(type => MiChatRoom, { @ManyToOne(() => MiChatRoom, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()

View File

@ -20,7 +20,7 @@ export class MiChatRoomMembership {
}) })
public userId: MiUser['id']; public userId: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()
@ -32,7 +32,7 @@ export class MiChatRoomMembership {
}) })
public roomId: MiChatRoom['id']; public roomId: MiChatRoom['id'];
@ManyToOne(type => MiChatRoom, { @ManyToOne(() => MiChatRoom, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()

View File

@ -25,7 +25,7 @@ export class MiClip {
}) })
public userId: MiUser['id']; public userId: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()

View File

@ -18,7 +18,7 @@ export class MiClipFavorite {
@Column(id()) @Column(id())
public userId: MiUser['id']; public userId: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()
@ -27,7 +27,7 @@ export class MiClipFavorite {
@Column(id()) @Column(id())
public clipId: MiClip['id']; public clipId: MiClip['id'];
@ManyToOne(type => MiClip, { @ManyToOne(() => MiClip, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()

View File

@ -21,7 +21,7 @@ export class MiClipNote {
}) })
public noteId: MiNote['id']; public noteId: MiNote['id'];
@ManyToOne(type => MiNote, { @ManyToOne(() => MiNote, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()
@ -34,7 +34,7 @@ export class MiClipNote {
}) })
public clipId: MiClip['id']; public clipId: MiClip['id'];
@ManyToOne(type => MiClip, { @ManyToOne(() => MiClip, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()

View File

@ -22,7 +22,7 @@ export class MiDriveFile {
}) })
public userId: MiUser['id'] | null; public userId: MiUser['id'] | null;
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'SET NULL', onDelete: 'SET NULL',
}) })
@JoinColumn() @JoinColumn()
@ -142,7 +142,7 @@ export class MiDriveFile {
}) })
public folderId: MiDriveFolder['id'] | null; public folderId: MiDriveFolder['id'] | null;
@ManyToOne(type => MiDriveFolder, { @ManyToOne(() => MiDriveFolder, {
onDelete: 'SET NULL', onDelete: 'SET NULL',
}) })
@JoinColumn() @JoinColumn()

View File

@ -26,7 +26,7 @@ export class MiDriveFolder {
}) })
public userId: MiUser['id'] | null; public userId: MiUser['id'] | null;
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()
@ -40,7 +40,7 @@ export class MiDriveFolder {
}) })
public parentId: MiDriveFolder['id'] | null; public parentId: MiDriveFolder['id'] | null;
@ManyToOne(type => MiDriveFolder, { @ManyToOne(() => MiDriveFolder, {
onDelete: 'SET NULL', onDelete: 'SET NULL',
}) })
@JoinColumn() @JoinColumn()

View File

@ -38,7 +38,7 @@ export class MiFlash {
}) })
public userId: MiUser['id']; public userId: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()

View File

@ -18,7 +18,7 @@ export class MiFlashLike {
@Column(id()) @Column(id())
public userId: MiUser['id']; public userId: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()
@ -27,7 +27,7 @@ export class MiFlashLike {
@Column(id()) @Column(id())
public flashId: MiFlash['id']; public flashId: MiFlash['id'];
@ManyToOne(type => MiFlash, { @ManyToOne(() => MiFlash, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()

View File

@ -20,7 +20,7 @@ export class MiFollowRequest {
}) })
public followeeId: MiUser['id']; public followeeId: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()
@ -33,7 +33,7 @@ export class MiFollowRequest {
}) })
public followerId: MiUser['id']; public followerId: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()

View File

@ -21,7 +21,7 @@ export class MiFollowing {
}) })
public followeeId: MiUser['id']; public followeeId: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()
@ -34,7 +34,7 @@ export class MiFollowing {
}) })
public followerId: MiUser['id']; public followerId: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()

View File

@ -18,7 +18,7 @@ export class MiGalleryLike {
@Column(id()) @Column(id())
public userId: MiUser['id']; public userId: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()
@ -27,7 +27,7 @@ export class MiGalleryLike {
@Column(id()) @Column(id())
public postId: MiGalleryPost['id']; public postId: MiGalleryPost['id'];
@ManyToOne(type => MiGalleryPost, { @ManyToOne(() => MiGalleryPost, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()

View File

@ -36,7 +36,7 @@ export class MiGalleryPost {
}) })
public userId: MiUser['id']; public userId: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()

View File

@ -21,7 +21,7 @@ export class MiMeta {
}) })
public rootUserId: MiUser['id'] | null; public rootUserId: MiUser['id'] | null;
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'SET NULL', onDelete: 'SET NULL',
nullable: true, nullable: true,
}) })

View File

@ -16,7 +16,7 @@ export class MiModerationLog {
@Column(id()) @Column(id())
public userId: MiUser['id']; public userId: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()

View File

@ -26,7 +26,7 @@ export class MiMuting {
}) })
public muteeId: MiUser['id']; public muteeId: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()
@ -39,7 +39,7 @@ export class MiMuting {
}) })
public muterId: MiUser['id']; public muterId: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()

View File

@ -35,7 +35,7 @@ export class MiNote {
}) })
public replyId: MiNote['id'] | null; public replyId: MiNote['id'] | null;
@ManyToOne(type => MiNote, { @ManyToOne(() => MiNote, {
createForeignKeyConstraints: false, createForeignKeyConstraints: false,
}) })
@JoinColumn() @JoinColumn()
@ -49,7 +49,7 @@ export class MiNote {
}) })
public renoteId: MiNote['id'] | null; public renoteId: MiNote['id'] | null;
@ManyToOne(type => MiNote, { @ManyToOne(() => MiNote, {
createForeignKeyConstraints: false, createForeignKeyConstraints: false,
}) })
@JoinColumn() @JoinColumn()
@ -83,7 +83,7 @@ export class MiNote {
}) })
public userId: MiUser['id']; public userId: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()
@ -208,7 +208,7 @@ export class MiNote {
}) })
public channelId: MiChannel['id'] | null; public channelId: MiChannel['id'] | null;
@ManyToOne(type => MiChannel, { @ManyToOne(() => MiChannel, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()

View File

@ -27,7 +27,7 @@ export class MiNoteDraft {
public replyId: MiNote['id'] | null; public replyId: MiNote['id'] | null;
// There is a possibility that replyId is not null but reply is null when the reply note is deleted. // There is a possibility that replyId is not null but reply is null when the reply note is deleted.
@ManyToOne(type => MiNote, { @ManyToOne(() => MiNote, {
createForeignKeyConstraints: false, createForeignKeyConstraints: false,
}) })
@JoinColumn() @JoinColumn()
@ -42,7 +42,7 @@ export class MiNoteDraft {
public renoteId: MiNote['id'] | null; public renoteId: MiNote['id'] | null;
// There is a possibility that renoteId is not null but renote is null when the renote note is deleted. // There is a possibility that renoteId is not null but renote is null when the renote note is deleted.
@ManyToOne(type => MiNote, { @ManyToOne(() => MiNote, {
createForeignKeyConstraints: false, createForeignKeyConstraints: false,
}) })
@JoinColumn() @JoinColumn()
@ -66,7 +66,7 @@ export class MiNoteDraft {
}) })
public userId: MiUser['id']; public userId: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()
@ -120,7 +120,7 @@ export class MiNoteDraft {
// There is a possibility that channelId is not null but channel is null when the channel is deleted. // There is a possibility that channelId is not null but channel is null when the channel is deleted.
// (deleting channel is not implemented so it's not happening now but may happen in the future) // (deleting channel is not implemented so it's not happening now but may happen in the future)
@ManyToOne(type => MiChannel, { @ManyToOne(() => MiChannel, {
createForeignKeyConstraints: false, createForeignKeyConstraints: false,
}) })
@JoinColumn() @JoinColumn()

View File

@ -18,7 +18,7 @@ export class MiNoteFavorite {
@Column(id()) @Column(id())
public userId: MiUser['id']; public userId: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()
@ -27,7 +27,7 @@ export class MiNoteFavorite {
@Column(id()) @Column(id())
public noteId: MiNote['id']; public noteId: MiNote['id'];
@ManyToOne(type => MiNote, { @ManyToOne(() => MiNote, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()

View File

@ -18,7 +18,7 @@ export class MiNoteReaction {
@Column(id()) @Column(id())
public userId: MiUser['id']; public userId: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()
@ -28,7 +28,7 @@ export class MiNoteReaction {
@Column(id()) @Column(id())
public noteId: MiNote['id']; public noteId: MiNote['id'];
@ManyToOne(type => MiNote, { @ManyToOne(() => MiNote, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()

View File

@ -19,7 +19,7 @@ export class MiNoteThreadMuting {
}) })
public userId: MiUser['id']; public userId: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()

View File

@ -56,7 +56,7 @@ export class MiPage {
}) })
public userId: MiUser['id']; public userId: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()
@ -68,7 +68,7 @@ export class MiPage {
}) })
public eyeCatchingImageId: MiDriveFile['id'] | null; public eyeCatchingImageId: MiDriveFile['id'] | null;
@ManyToOne(type => MiDriveFile, { @ManyToOne(() => MiDriveFile, {
onDelete: 'SET NULL', onDelete: 'SET NULL',
}) })
@JoinColumn() @JoinColumn()

View File

@ -18,7 +18,7 @@ export class MiPageLike {
@Column(id()) @Column(id())
public userId: MiUser['id']; public userId: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()
@ -27,7 +27,7 @@ export class MiPageLike {
@Column(id()) @Column(id())
public pageId: MiPage['id']; public pageId: MiPage['id'];
@ManyToOne(type => MiPage, { @ManyToOne(() => MiPage, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()

View File

@ -24,7 +24,7 @@ export class MiPasswordResetRequest {
}) })
public userId: MiUser['id']; public userId: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()

View File

@ -15,7 +15,7 @@ export class MiPoll {
@PrimaryColumn(id()) @PrimaryColumn(id())
public noteId: MiNote['id']; public noteId: MiNote['id'];
@OneToOne(type => MiNote, { @OneToOne(() => MiNote, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()

View File

@ -18,7 +18,7 @@ export class MiPollVote {
@Column(id()) @Column(id())
public userId: MiUser['id']; public userId: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()
@ -28,7 +28,7 @@ export class MiPollVote {
@Column(id()) @Column(id())
public noteId: MiNote['id']; public noteId: MiNote['id'];
@ManyToOne(type => MiNote, { @ManyToOne(() => MiNote, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()

View File

@ -13,7 +13,7 @@ export class MiPromoNote {
@PrimaryColumn(id()) @PrimaryColumn(id())
public noteId: MiNote['id']; public noteId: MiNote['id'];
@OneToOne(type => MiNote, { @OneToOne(() => MiNote, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()

View File

@ -18,7 +18,7 @@ export class MiPromoRead {
@Column(id()) @Column(id())
public userId: MiUser['id']; public userId: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()
@ -27,7 +27,7 @@ export class MiPromoRead {
@Column(id()) @Column(id())
public noteId: MiNote['id']; public noteId: MiNote['id'];
@ManyToOne(type => MiNote, { @ManyToOne(() => MiNote, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()

View File

@ -23,7 +23,7 @@ export class MiRegistrationTicket {
}) })
public expiresAt: Date | null; public expiresAt: Date | null;
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()
@ -36,7 +36,7 @@ export class MiRegistrationTicket {
}) })
public createdById: MiUser['id'] | null; public createdById: MiUser['id'] | null;
@OneToOne(type => MiUser, { @OneToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()

View File

@ -25,7 +25,7 @@ export class MiRegistryItem {
}) })
public userId: MiUser['id']; public userId: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()

View File

@ -20,7 +20,7 @@ export class MiRenoteMuting {
}) })
public muteeId: MiUser['id']; public muteeId: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()
@ -33,7 +33,7 @@ export class MiRenoteMuting {
}) })
public muterId: MiUser['id']; public muterId: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()

View File

@ -27,7 +27,7 @@ export class MiReversiGame {
@Column(id()) @Column(id())
public user1Id: MiUser['id']; public user1Id: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()
@ -36,7 +36,7 @@ export class MiReversiGame {
@Column(id()) @Column(id())
public user2Id: MiUser['id']; public user2Id: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()

View File

@ -21,7 +21,7 @@ export class MiRoleAssignment {
}) })
public userId: MiUser['id']; public userId: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()
@ -34,7 +34,7 @@ export class MiRoleAssignment {
}) })
public roleId: MiRole['id']; public roleId: MiRole['id'];
@ManyToOne(type => MiRole, { @ManyToOne(() => MiRole, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()

View File

@ -16,7 +16,7 @@ export class MiSignin {
@Column(id()) @Column(id())
public userId: MiUser['id']; public userId: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()

View File

@ -16,7 +16,7 @@ export class MiSwSubscription {
@Column(id()) @Column(id())
public userId: MiUser['id']; public userId: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()

View File

@ -18,7 +18,7 @@ export class MiSystemAccount {
@Column(id()) @Column(id())
public userId: MiUser['id']; public userId: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()

View File

@ -99,7 +99,7 @@ export class MiUser {
}) })
public avatarId: MiDriveFile['id'] | null; public avatarId: MiDriveFile['id'] | null;
@OneToOne(type => MiDriveFile, { @OneToOne(() => MiDriveFile, {
onDelete: 'SET NULL', onDelete: 'SET NULL',
}) })
@JoinColumn() @JoinColumn()
@ -112,7 +112,7 @@ export class MiUser {
}) })
public bannerId: MiDriveFile['id'] | null; public bannerId: MiDriveFile['id'] | null;
@OneToOne(type => MiDriveFile, { @OneToOne(() => MiDriveFile, {
onDelete: 'SET NULL', onDelete: 'SET NULL',
}) })
@JoinColumn() @JoinColumn()

View File

@ -12,7 +12,7 @@ export class MiUserKeypair {
@PrimaryColumn(id()) @PrimaryColumn(id())
public userId: MiUser['id']; public userId: MiUser['id'];
@OneToOne(type => MiUser, { @OneToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()

View File

@ -25,7 +25,7 @@ export class MiUserList {
}) })
public isPublic: boolean; public isPublic: boolean;
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()

View File

@ -18,7 +18,7 @@ export class MiUserListFavorite {
@Column(id()) @Column(id())
public userId: MiUser['id']; public userId: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()
@ -27,7 +27,7 @@ export class MiUserListFavorite {
@Column(id()) @Column(id())
public userListId: MiUserList['id']; public userListId: MiUserList['id'];
@ManyToOne(type => MiUserList, { @ManyToOne(() => MiUserList, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()

View File

@ -21,7 +21,7 @@ export class MiUserListMembership {
}) })
public userId: MiUser['id']; public userId: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()
@ -34,7 +34,7 @@ export class MiUserListMembership {
}) })
public userListId: MiUserList['id']; public userListId: MiUserList['id'];
@ManyToOne(type => MiUserList, { @ManyToOne(() => MiUserList, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()

View File

@ -20,7 +20,7 @@ export class MiUserMemo {
}) })
public userId: MiUser['id']; public userId: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()
@ -33,7 +33,7 @@ export class MiUserMemo {
}) })
public targetUserId: MiUser['id']; public targetUserId: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()

View File

@ -18,7 +18,7 @@ export class MiUserNotePining {
@Column(id()) @Column(id())
public userId: MiUser['id']; public userId: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()
@ -27,7 +27,7 @@ export class MiUserNotePining {
@Column(id()) @Column(id())
public noteId: MiNote['id']; public noteId: MiNote['id'];
@ManyToOne(type => MiNote, { @ManyToOne(() => MiNote, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()

View File

@ -17,7 +17,7 @@ export class MiUserProfile {
@PrimaryColumn(id()) @PrimaryColumn(id())
public userId: MiUser['id']; public userId: MiUser['id'];
@OneToOne(type => MiUser, { @OneToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()
@ -215,7 +215,7 @@ export class MiUserProfile {
}) })
public pinnedPageId: MiPage['id'] | null; public pinnedPageId: MiPage['id'] | null;
@OneToOne(type => MiPage, { @OneToOne(() => MiPage, {
onDelete: 'SET NULL', onDelete: 'SET NULL',
}) })
@JoinColumn() @JoinColumn()

View File

@ -12,7 +12,7 @@ export class MiUserPublickey {
@PrimaryColumn(id()) @PrimaryColumn(id())
public userId: MiUser['id']; public userId: MiUser['id'];
@OneToOne(type => MiUser, { @OneToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()

View File

@ -18,7 +18,7 @@ export class MiUserSecurityKey {
@Column(id()) @Column(id())
public userId: MiUser['id']; public userId: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()

View File

@ -22,7 +22,7 @@ export class MiWebhook {
}) })
public userId: MiUser['id']; public userId: MiUser['id'];
@ManyToOne(type => MiUser, { @ManyToOne(() => MiUser, {
onDelete: 'CASCADE', onDelete: 'CASCADE',
}) })
@JoinColumn() @JoinColumn()

View File

@ -123,8 +123,8 @@ export class ExportCustomEmojisProcessorService {
metaStream.end(); metaStream.end();
// Create archive // Create archive
await new Promise<void>(async (resolve) => { const [archivePath, archiveCleanup] = await createTemp();
const [archivePath, archiveCleanup] = await createTemp(); await new Promise<void>((resolve) => {
const archiveStream = fs.createWriteStream(archivePath); const archiveStream = fs.createWriteStream(archivePath);
const archive = archiver('zip', { const archive = archiver('zip', {
zlib: { level: 0 }, zlib: { level: 0 },

View File

@ -63,7 +63,7 @@ export class PostScheduledNoteProcessorService {
this.notificationService.createNotification(draft.userId, 'scheduledNotePosted', { this.notificationService.createNotification(draft.userId, 'scheduledNotePosted', {
noteId: note.id, noteId: note.id,
}); });
} catch (err) { } catch (_) {
this.notificationService.createNotification(draft.userId, 'scheduledNotePostFailed', { this.notificationService.createNotification(draft.userId, 'scheduledNotePostFailed', {
noteDraftId: draft.id, noteDraftId: draft.id,
}); });

View File

@ -116,7 +116,7 @@ export class ActivityPubServerService {
try { try {
signature = httpSignature.parseRequest(request.raw, { 'headers': ['(request-target)', 'host', 'date'], authorizationHeaderName: 'signature' }); signature = httpSignature.parseRequest(request.raw, { 'headers': ['(request-target)', 'host', 'date'], authorizationHeaderName: 'signature' });
} catch (e) { } catch (_) {
reply.code(401); reply.code(401);
return; return;
} }

View File

@ -48,8 +48,6 @@ export class NodeinfoServerService {
@bindThis @bindThis
public createServer(fastify: FastifyInstance, options: FastifyPluginOptions, done: (err?: Error) => void) { public createServer(fastify: FastifyInstance, options: FastifyPluginOptions, done: (err?: Error) => void) {
const nodeinfo2 = async (version: number) => { const nodeinfo2 = async (version: number) => {
const now = Date.now();
const notesChart = await this.notesChart.getChart('hour', 1, null); const notesChart = await this.notesChart.getChart('hour', 1, null);
const localPosts = notesChart.local.total[0]; const localPosts = notesChart.local.total[0];

View File

@ -426,7 +426,7 @@ export class ApiCallService implements OnApplicationShutdown {
if (['boolean', 'number', 'integer'].includes(param.type ?? '') && typeof data[k] === 'string') { if (['boolean', 'number', 'integer'].includes(param.type ?? '') && typeof data[k] === 'string') {
try { try {
data[k] = JSON.parse(data[k]); data[k] = JSON.parse(data[k]);
} catch (e) { } catch (_) {
throw new ApiError({ throw new ApiError({
message: 'Invalid param.', message: 'Invalid param.',
code: 'INVALID_PARAM', code: 'INVALID_PARAM',

View File

@ -231,7 +231,7 @@ export class SigninApiService {
try { try {
await this.userAuthService.twoFactorAuthenticate(profile, token); await this.userAuthService.twoFactorAuthenticate(profile, token);
} catch (e) { } catch (_) {
return await fail(403, { return await fail(403, {
id: 'cdf1235b-ac71-46d4-a3a6-84ccce48df6f', id: 'cdf1235b-ac71-46d4-a3a6-84ccce48df6f',
}); });

View File

@ -93,7 +93,7 @@ export class SigninWithPasskeyApiService {
// Not more than 1 API call per 250ms and not more than 100 attempts per 30min // Not more than 1 API call per 250ms and not more than 100 attempts per 30min
// NOTE: 1 Sign-in require 2 API calls // NOTE: 1 Sign-in require 2 API calls
await this.rateLimiterService.limit({ key: 'signin-with-passkey', duration: 60 * 30 * 1000, max: 200, minInterval: 250 }, getIpHash(request.ip)); await this.rateLimiterService.limit({ key: 'signin-with-passkey', duration: 60 * 30 * 1000, max: 200, minInterval: 250 }, getIpHash(request.ip));
} catch (err) { } catch (_) {
reply.code(429); reply.code(429);
return { return {
error: { error: {

View File

@ -255,7 +255,7 @@ export class SignupApiService {
throw new FastifyReplyError(400, 'EXPIRED'); throw new FastifyReplyError(400, 'EXPIRED');
} }
const { account, secret } = await this.signupService.signup({ const { account } = await this.signupService.signup({
username: pendingUser.username, username: pendingUser.username,
passwordHash: pendingUser.password, passwordHash: pendingUser.password,
}); });

View File

@ -111,7 +111,7 @@ export class StreamingApiServerService {
user: MiLocalUser | null; user: MiLocalUser | null;
app: MiAccessToken | null app: MiAccessToken | null
}) => { }) => {
const { stream, user, app } = ctx; const { stream, user } = ctx;
const ev = new EventEmitter(); const ev = new EventEmitter();

View File

@ -72,7 +72,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private announcementService: AnnouncementService, private announcementService: AnnouncementService,
) { ) {
super(meta, paramDef, async (ps, me) => { super(meta, paramDef, async (ps, me) => {
const { raw, packed } = await this.announcementService.create({ const { packed } = await this.announcementService.create({
updatedAt: null, updatedAt: null,
title: ps.title, title: ps.title,
text: ps.text, text: ps.text,

Some files were not shown because too many files have changed in this diff Show More