* Resolve #4121

* Update tslint.json
This commit is contained in:
Acid Chicken (硫酸鶏) 2019-02-04 18:27:45 +09:00 committed by Aya Morisawa
parent 2f620530b2
commit 1d9ef8cc99
10 changed files with 20 additions and 20 deletions

View file

@ -21,7 +21,7 @@ export type Partial<T> = {
}; };
type ArrayValue<T> = { type ArrayValue<T> = {
[P in keyof T]: T[P] extends number ? Array<T[P]> : ArrayValue<T[P]>; [P in keyof T]: T[P] extends number ? T[P][] : ArrayValue<T[P]>;
}; };
type Span = 'day' | 'hour'; type Span = 'day' | 'hour';

View file

@ -27,11 +27,11 @@ export interface IReversiGame {
isEnded: boolean; isEnded: boolean;
winnerId: mongo.ObjectID; winnerId: mongo.ObjectID;
surrendered: mongo.ObjectID; surrendered: mongo.ObjectID;
logs: Array<{ logs: {
at: Date; at: Date;
color: boolean; color: boolean;
pos: number; pos: number;
}>; }[];
settings: { settings: {
map: string[]; map: string[];
bw: string | number; bw: string | number;

View file

@ -52,11 +52,11 @@ export type INote = {
repliesCount: number; repliesCount: number;
reactionCounts: any; reactionCounts: any;
mentions: mongo.ObjectID[]; mentions: mongo.ObjectID[];
mentionedRemoteUsers: Array<{ mentionedRemoteUsers: {
uri: string; uri: string;
username: string; username: string;
host: string; host: string;
}>; }[];
/** /**
* public ... * public ...

View file

@ -29,22 +29,22 @@ export default define(meta, (ps) => new Promise(async (res, rej) => {
$group: { $group: {
_id: { tag: '$tagsLower', userId: '$userId' } _id: { tag: '$tagsLower', userId: '$userId' }
} }
}]) as Array<{ }]) as {
_id: { _id: {
tag: string; tag: string;
userId: any; userId: any;
} }
}>; }[];
//#endregion //#endregion
if (data.length == 0) { if (data.length == 0) {
return res([]); return res([]);
} }
let tags: Array<{ let tags: {
name: string; name: string;
count: number; count: number;
}> = []; }[] = [];
// カウント // カウント
for (const x of data.map(x => x._id).filter(x => !hidedTags.includes(x.tag))) { for (const x of data.map(x => x._id).filter(x => !hidedTags.includes(x.tag))) {

View file

@ -40,22 +40,22 @@ export default define(meta, () => new Promise(async (res, rej) => {
$group: { $group: {
_id: { tag: '$tagsLower', userId: '$userId' } _id: { tag: '$tagsLower', userId: '$userId' }
} }
}]) as Array<{ }]) as {
_id: { _id: {
tag: string; tag: string;
userId: any; userId: any;
} }
}>; }[];
//#endregion //#endregion
if (data.length == 0) { if (data.length == 0) {
return res([]); return res([]);
} }
const tags: Array<{ const tags: {
name: string; name: string;
count: number; count: number;
}> = []; }[] = [];
// カウント // カウント
for (const x of data.map(x => x._id).filter(x => !hidedTags.includes(x.tag))) { for (const x of data.map(x => x._id).filter(x => !hidedTags.includes(x.tag))) {
@ -108,7 +108,7 @@ export default define(meta, () => new Promise(async (res, rej) => {
//#endregion //#endregion
//#region 2(または3)で話題と判定されたタグそれぞれについて過去の投稿数グラフを取得する //#region 2(または3)で話題と判定されたタグそれぞれについて過去の投稿数グラフを取得する
const countPromises: Array<Promise<any[]>> = []; const countPromises: Promise<any[]>[] = [];
const range = 20; const range = 20;

View file

@ -14,7 +14,7 @@ export default class extends Channel {
const mute = this.user ? await Mute.find({ muterId: this.user._id }) : null; const mute = this.user ? await Mute.find({ muterId: this.user._id }) : null;
const mutedUserIds = mute ? mute.map(m => m.muteeId.toString()) : []; const mutedUserIds = mute ? mute.map(m => m.muteeId.toString()) : [];
const q: Array<string[]> = params.q; const q: string[][] = params.q;
if (q == null) return; if (q == null) return;

View file

@ -121,7 +121,7 @@ const parsePropDefinition = (key: string, prop: any) => {
return prop; return prop;
}; };
const sortParams = (params: Array<{ name: string }>) => { const sortParams = (params: { name: string }[]) => {
return params; return params;
}; };

View file

@ -429,7 +429,7 @@ export default async function(
const properties: {[key: string]: any} = {}; const properties: {[key: string]: any} = {};
let propPromises: Array<Promise<void>> = []; let propPromises: Promise<void>[] = [];
const isImage = ['image/jpeg', 'image/gif', 'image/png', 'image/webp'].includes(mime); const isImage = ['image/jpeg', 'image/gif', 'image/png', 'image/webp'].includes(mime);

View file

@ -38,10 +38,10 @@ type NotificationType = 'reply' | 'renote' | 'quote' | 'mention';
class NotificationManager { class NotificationManager {
private notifier: IUser; private notifier: IUser;
private note: INote; private note: INote;
private queue: Array<{ private queue: {
target: ILocalUser['_id']; target: ILocalUser['_id'];
reason: NotificationType; reason: NotificationType;
}>; }[];
constructor(notifier: IUser, note: INote) { constructor(notifier: IUser, note: INote) {
this.notifier = notifier; this.notifier = notifier;

View file

@ -18,7 +18,7 @@
"no-empty":false, "no-empty":false,
"ordered-imports": [false], "ordered-imports": [false],
"arrow-parens": false, "arrow-parens": false,
"array-type": false, "array-type": [true, "array"],
"object-literal-shorthand": false, "object-literal-shorthand": false,
"object-literal-key-quotes": false, "object-literal-key-quotes": false,
"triple-equals": [false], "triple-equals": [false],