From 8e9c65fab045f9f9e945a812a6f4de30b4f70d23 Mon Sep 17 00:00:00 2001 From: Johann150 Date: Tue, 13 Dec 2022 23:07:48 +0100 Subject: [PATCH] chore: fix some import related lints --- packages/backend/src/db/postgre.ts | 2 +- packages/backend/src/models/entities/auth-session.ts | 2 +- packages/backend/src/remote/activitypub/db-resolver.ts | 2 +- packages/backend/src/remote/activitypub/deliver-manager.ts | 1 - packages/backend/src/remote/activitypub/resolver.ts | 2 -- packages/backend/src/remote/resolve-user.ts | 3 +-- packages/backend/src/server/api/common/oauth.ts | 3 +-- packages/backend/src/server/api/define.ts | 2 +- packages/backend/src/server/api/endpoints/app/create.ts | 1 - .../backend/src/server/api/endpoints/auth/session/userkey.ts | 2 +- packages/backend/src/server/api/endpoints/notes/replies.ts | 2 +- packages/backend/src/server/api/endpoints/notes/state.ts | 4 ++-- 12 files changed, 10 insertions(+), 16 deletions(-) diff --git a/packages/backend/src/db/postgre.ts b/packages/backend/src/db/postgre.ts index b3d103082..c7a2a9b6c 100644 --- a/packages/backend/src/db/postgre.ts +++ b/packages/backend/src/db/postgre.ts @@ -1,6 +1,5 @@ // https://github.com/typeorm/typeorm/issues/2400 import pg from 'pg'; -import { SECOND } from '@/const.js'; pg.types.setTypeParser(20, Number); @@ -8,6 +7,7 @@ import { Logger, DataSource } from 'typeorm'; import * as highlight from 'cli-highlight'; import config from '@/config/index.js'; +import { SECOND } from '@/const.js'; import { User } from '@/models/entities/user.js'; import { DriveFile } from '@/models/entities/drive-file.js'; import { DriveFolder } from '@/models/entities/drive-folder.js'; diff --git a/packages/backend/src/models/entities/auth-session.ts b/packages/backend/src/models/entities/auth-session.ts index 8e3057dc6..511a7fad6 100644 --- a/packages/backend/src/models/entities/auth-session.ts +++ b/packages/backend/src/models/entities/auth-session.ts @@ -1,4 +1,4 @@ -import { Entity, PrimaryColumn, Index, Column, ManyToOne, OneToOne, JoinColumn } from 'typeorm'; +import { Entity, PrimaryColumn, Index, Column, ManyToOne, JoinColumn } from 'typeorm'; import { id } from '../id.js'; import { AccessToken } from './access-token.js'; import { App } from './app.js'; diff --git a/packages/backend/src/remote/activitypub/db-resolver.ts b/packages/backend/src/remote/activitypub/db-resolver.ts index 0a5f32be4..7f913de0b 100644 --- a/packages/backend/src/remote/activitypub/db-resolver.ts +++ b/packages/backend/src/remote/activitypub/db-resolver.ts @@ -1,7 +1,7 @@ import escapeRegexp from 'escape-regexp'; import config from '@/config/index.js'; import { Note } from '@/models/entities/note.js'; -import { CacheableRemoteUser, CacheableUser } from '@/models/entities/user.js'; +import { CacheableUser } from '@/models/entities/user.js'; import { MessagingMessage } from '@/models/entities/messaging-message.js'; import { Notes, MessagingMessages } from '@/models/index.js'; import { uriPersonCache, userByIdCache } from '@/services/user-cache.js'; diff --git a/packages/backend/src/remote/activitypub/deliver-manager.ts b/packages/backend/src/remote/activitypub/deliver-manager.ts index 8b5297acd..4bc651c98 100644 --- a/packages/backend/src/remote/activitypub/deliver-manager.ts +++ b/packages/backend/src/remote/activitypub/deliver-manager.ts @@ -1,4 +1,3 @@ -import { IsNull, Not } from 'typeorm'; import { ILocalUser, IRemoteUser, User } from '@/models/entities/user.js'; import { Users, Followings } from '@/models/index.js'; import { deliver } from '@/queue/index.js'; diff --git a/packages/backend/src/remote/activitypub/resolver.ts b/packages/backend/src/remote/activitypub/resolver.ts index fd96758f6..957557afc 100644 --- a/packages/backend/src/remote/activitypub/resolver.ts +++ b/packages/backend/src/remote/activitypub/resolver.ts @@ -1,5 +1,3 @@ -import config from '@/config/index.js'; -import { getJson } from '@/misc/fetch.js'; import { ILocalUser } from '@/models/entities/user.js'; import { getInstanceActor } from '@/services/instance-actor.js'; import { extractDbHost, isSelfHost } from '@/misc/convert-host.js'; diff --git a/packages/backend/src/remote/resolve-user.ts b/packages/backend/src/remote/resolve-user.ts index a459e847e..2b49afc40 100644 --- a/packages/backend/src/remote/resolve-user.ts +++ b/packages/backend/src/remote/resolve-user.ts @@ -2,14 +2,13 @@ import { URL } from 'node:url'; import chalk from 'chalk'; import { IsNull } from 'typeorm'; import { DAY } from '@/const.js'; -import config from '@/config/index.js'; import { isSelfHost, toPuny } from '@/misc/convert-host.js'; import { User, IRemoteUser } from '@/models/entities/user.js'; import { Users } from '@/models/index.js'; +import { Resolver } from '@/remote/activitypub/resolver.js'; import webFinger from './webfinger.js'; import { createPerson, updatePerson } from './activitypub/models/person.js'; import { remoteLogger } from './logger.js'; -import { Resolver } from '@/remote/activitypub/resolver.js'; const logger = remoteLogger.createSubLogger('resolve-user'); diff --git a/packages/backend/src/server/api/common/oauth.ts b/packages/backend/src/server/api/common/oauth.ts index 894842d40..3fec3ef11 100644 --- a/packages/backend/src/server/api/common/oauth.ts +++ b/packages/backend/src/server/api/common/oauth.ts @@ -1,8 +1,7 @@ import * as crypto from 'node:crypto'; import Koa from 'koa'; import { IsNull, Not } from 'typeorm'; -import { Apps, AuthSessions, AccessTokens } from '@/models/index.js'; -import config from '@/config/index.js'; +import { Apps, AuthSessions } from '@/models/index.js'; import { compareUrl } from './compare-url.js'; export async function oauth(ctx: Koa.Context): void { diff --git a/packages/backend/src/server/api/define.ts b/packages/backend/src/server/api/define.ts index 840283957..243b105ae 100644 --- a/packages/backend/src/server/api/define.ts +++ b/packages/backend/src/server/api/define.ts @@ -1,6 +1,6 @@ import * as fs from 'node:fs'; import Ajv from 'ajv'; -import { CacheableLocalUser, ILocalUser } from '@/models/entities/user.js'; +import { CacheableLocalUser } from '@/models/entities/user.js'; import { Schema, SchemaType } from '@/misc/schema.js'; import { AccessToken } from '@/models/entities/access-token.js'; import { IEndpointMeta } from './endpoints.js'; diff --git a/packages/backend/src/server/api/endpoints/app/create.ts b/packages/backend/src/server/api/endpoints/app/create.ts index 350f988e2..61de50d39 100644 --- a/packages/backend/src/server/api/endpoints/app/create.ts +++ b/packages/backend/src/server/api/endpoints/app/create.ts @@ -1,6 +1,5 @@ import { Apps } from '@/models/index.js'; import { genId } from '@/misc/gen-id.js'; -import { unique } from '@/prelude/array.js'; import { secureRndstr } from '@/misc/secure-rndstr.js'; import { kinds } from '@/misc/api-permissions.js'; import define from '../../define.js'; diff --git a/packages/backend/src/server/api/endpoints/auth/session/userkey.ts b/packages/backend/src/server/api/endpoints/auth/session/userkey.ts index 3e857645a..a9e69c895 100644 --- a/packages/backend/src/server/api/endpoints/auth/session/userkey.ts +++ b/packages/backend/src/server/api/endpoints/auth/session/userkey.ts @@ -1,4 +1,4 @@ -import { Apps, AuthSessions, AccessTokens, Users } from '@/models/index.js'; +import { Apps, AuthSessions, Users } from '@/models/index.js'; import define from '../../../define.js'; import { ApiError } from '../../../error.js'; diff --git a/packages/backend/src/server/api/endpoints/notes/replies.ts b/packages/backend/src/server/api/endpoints/notes/replies.ts index b289e1147..96a656ec6 100644 --- a/packages/backend/src/server/api/endpoints/notes/replies.ts +++ b/packages/backend/src/server/api/endpoints/notes/replies.ts @@ -1,10 +1,10 @@ import { Notes } from '@/models/index.js'; +import { ApiError } from '@/server/api/error.js'; import define from '../../define.js'; import { makePaginationQuery } from '../../common/make-pagination-query.js'; import { generateVisibilityQuery } from '../../common/generate-visibility-query.js'; import { generateMutedUserQuery } from '../../common/generate-muted-user-query.js'; import { generateBlockedUserQuery } from '../../common/generate-block-query.js'; -import { ApiError } from '@/server/api/error.js'; export const meta = { tags: ['notes'], diff --git a/packages/backend/src/server/api/endpoints/notes/state.ts b/packages/backend/src/server/api/endpoints/notes/state.ts index 610b1f497..5a7d9dc40 100644 --- a/packages/backend/src/server/api/endpoints/notes/state.ts +++ b/packages/backend/src/server/api/endpoints/notes/state.ts @@ -1,7 +1,7 @@ -import { NoteFavorites, Notes, NoteThreadMutings, NoteWatchings } from '@/models/index.js'; +import { NoteFavorites, NoteThreadMutings, NoteWatchings } from '@/models/index.js'; +import { ApiError } from '@/server/api/error.js'; import { getNote } from '../../common/getters.js'; import define from '../../define.js'; -import { ApiError } from '@/server/api/error.js'; export const meta = { tags: ['notes'],