diff --git a/.eslintrc.js b/.eslintrc.js index c6ea09b46..eb674c08a 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -12,7 +12,7 @@ module.exports = { 'plugin:import/typescript' ], rules: { - 'indent': ['error', 'tab', { + 'indent': ['warn', 'tab', { 'SwitchCase': 1, 'MemberExpression': 'off', 'flatTernaryExpressions': true, @@ -29,11 +29,14 @@ module.exports = { 'no-multi-spaces': ['error'], 'no-var': ['error'], 'prefer-arrow-callback': ['error'], - 'no-throw-literal': ['error'], + 'no-throw-literal': ['warn'], 'no-param-reassign': ['warn'], 'no-constant-condition': ['warn'], 'no-empty-pattern': ['warn'], + 'no-async-promise-executor': ['off'], '@typescript-eslint/no-inferrable-types': ['warn'], + '@typescript-eslint/no-empty-function': ['off'], + '@typescript-eslint/no-non-null-assertion': ['off'], 'import/no-unresolved': ['off'], 'import/no-default-export': ['warn'], }, diff --git a/src/remote/activitypub/models/question.ts b/src/remote/activitypub/models/question.ts index 79f93c3a3..eee94022a 100644 --- a/src/remote/activitypub/models/question.ts +++ b/src/remote/activitypub/models/question.ts @@ -1,6 +1,6 @@ import config from '@/config/index'; import Resolver from '../resolver'; -import { IObject, IQuestion, isQuestion, } from '../type'; +import { IObject, IQuestion, isQuestion, } from '../type'; import { apLogger } from '../logger'; import { Notes, Polls } from '@/models/index'; import { IPoll } from '@/models/entities/poll'; @@ -40,7 +40,7 @@ export async function extractPollFromQuestion(source: string | IObject, resolver * @param uri URI of AP Question object * @returns true if updated */ -export async function updateQuestion(value: any) { +export async function updateQuestion(value: string | IObject): Promise { const uri = typeof value === 'string' ? value : value.id; // URIがこのサーバーを指しているならスキップ diff --git a/src/server/web/feed.ts b/src/server/web/feed.ts index 4b6de517b..7795f5b34 100644 --- a/src/server/web/feed.ts +++ b/src/server/web/feed.ts @@ -4,7 +4,8 @@ import { User } from '@/models/entities/user'; import { Notes, DriveFiles, UserProfiles } from '@/models/index'; import { In } from 'typeorm'; -export default async function(user: User) { +// eslint-disable-next-line import/no-default-export +export default async function(user: User): Promise { const author = { link: `${config.url}/@${user.username}`, name: user.name || user.username