1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-18 14:15:34 +02:00

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
144 changed files with 324 additions and 354 deletions

View File

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

View File

@@ -76,7 +76,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
try {
// Create file
driveFile = await this.driveService.uploadFromUrl({ url: emoji.originalUrl, user: null, force: true });
} catch (e) {
} catch (_) {
// TODO: need to return Drive Error
throw new ApiError();
}

View File

@@ -117,7 +117,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
case 'SAME_NAME_EMOJI_EXISTS': throw new ApiError(meta.errors.sameNameEmojiExists);
}
// 網羅性チェック
const mustBeNever: never = error;
const _mustBeNever: never = error;
});
}
}

View File

@@ -215,7 +215,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
type: 'Note',
object,
};
} catch (e) {
} catch (_) {
return null;
}
}

View File

@@ -81,7 +81,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
try {
await this.userAuthService.twoFactorAuthenticate(profile, token);
} catch (e) {
} catch (_) {
throw new Error('authentication failed');
}
}

View File

@@ -212,7 +212,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
try {
await this.userAuthService.twoFactorAuthenticate(profile, token);
} catch (e) {
} catch (_) {
throw new Error('authentication failed');
}
}

View File

@@ -72,7 +72,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
try {
await this.userAuthService.twoFactorAuthenticate(profile, token);
} catch (e) {
} catch (_) {
throw new Error('authentication failed');
}
}

View File

@@ -61,7 +61,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
try {
await this.userAuthService.twoFactorAuthenticate(profile, token);
} catch (e) {
} catch (_) {
throw new Error('authentication failed');
}
}

View File

@@ -57,7 +57,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
try {
await this.userAuthService.twoFactorAuthenticate(profile, token);
} catch (e) {
} catch (_) {
throw new Error('authentication failed');
}
}

View File

@@ -45,7 +45,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
try {
await this.userAuthService.twoFactorAuthenticate(profile, token);
} catch (e) {
} catch (_) {
throw new Error('authentication failed');
}
}

View File

@@ -49,7 +49,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
try {
await this.userAuthService.twoFactorAuthenticate(profile, token);
} catch (e) {
} catch (_) {
throw new Error('authentication failed');
}
}

View File

@@ -71,7 +71,6 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private notificationService: NotificationService,
) {
super(meta, paramDef, async (ps, me) => {
const EXTRA_LIMIT = 100;
const untilId = ps.untilId ?? (ps.untilDate ? this.idService.gen(ps.untilDate!) : undefined);
const sinceId = ps.sinceId ?? (ps.sinceDate ? this.idService.gen(ps.sinceDate!) : undefined);

View File

@@ -91,7 +91,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
try {
await this.userAuthService.twoFactorAuthenticate(profile, token);
} catch (e) {
} catch (_) {
throw new Error('authentication failed');
}
}

View File

@@ -323,7 +323,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
try {
new RE2(regexp[1], regexp[2]);
} catch (err) {
} catch (_) {
throw new ApiError(meta.errors.invalidRegexp);
}
}
@@ -587,7 +587,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
})
.execute();
}
} catch (err) {
} catch (_) {
// なにもしない
}
}

View File

@@ -59,7 +59,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
throw err;
});
const mutedNotes = await this.notesRepository.find({
const _mutedNotes = await this.notesRepository.find({
where: [{
id: note.threadId ?? note.id,
}, {

View File

@@ -155,7 +155,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
birthday.shift(); // 年の部分を削除
// なぜか get_birthday_date() = :birthday だとインデックスが効かないので、BETWEEN で対応
query.andWhere('get_birthday_date(followeeProfile.birthday) BETWEEN :birthday AND :birthday', { birthday: parseInt(birthday.join('')) });
} catch (err) {
} catch (_) {
throw new ApiError(meta.errors.birthdayInvalid);
}
}