mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 21:13:50 +00:00
feat: update ESLint config with @typescript-eslint/consistent-type-imports (#4746)
* update: Add type * fix: update import statement for NextApiRequest type * fix: update imports to use type for LexicalEditor and EditorState * Refactor imports to use 'import type' for type-only imports across multiple files - Updated imports in various components and API files to use 'import type' for better clarity and to optimize TypeScript's type checking. - Ensured consistent usage of type imports in files related to chat, dataset, workflow, and user management. - Improved code readability and maintainability by distinguishing between value and type imports. * refactor: remove old ESLint configuration and add new rules - Deleted the old ESLint configuration file from the app project. - Added a new ESLint configuration file with updated rules and settings. - Changed imports to use type-only imports in various files for better clarity and performance. - Updated TypeScript configuration to remove unnecessary options. - Added an ESLint ignore file to exclude build and dependency directories from linting. * fix: update imports to use 'import type' for type-only imports in schema files
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { SourceMemberType } from '../user/type';
|
||||
import { OperationLogEventEnum } from './constants';
|
||||
import type { SourceMemberType } from '../user/type';
|
||||
import type { OperationLogEventEnum } from './constants';
|
||||
|
||||
export type OperationLogSchema = {
|
||||
_id: string;
|
||||
|
2
packages/global/support/outLink/api.d.ts
vendored
2
packages/global/support/outLink/api.d.ts
vendored
@@ -1,5 +1,5 @@
|
||||
import type { HistoryItemType } from '../../core/chat/type.d';
|
||||
import { OutLinkSchema } from './type.d';
|
||||
import type { OutLinkSchema } from './type.d';
|
||||
|
||||
export type AuthOutLinkInitProps = {
|
||||
outLinkUid: string;
|
||||
|
2
packages/global/support/outLink/type.d.ts
vendored
2
packages/global/support/outLink/type.d.ts
vendored
@@ -1,5 +1,5 @@
|
||||
import { AppSchema } from '../../core/app/type';
|
||||
import { PublishChannelEnum } from './constant';
|
||||
import type { PublishChannelEnum } from './constant';
|
||||
import { RequireOnlyOne } from '../../common/type/utils';
|
||||
|
||||
// Feishu Config interface
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { NullPermission, PermissionKeyEnum, PermissionList } from '../constant';
|
||||
import { PermissionListType } from '../type';
|
||||
import { type PermissionListType } from '../type';
|
||||
import { i18nT } from '../../../../web/i18n/utils';
|
||||
export enum AppPermissionKeyEnum {}
|
||||
export const AppPermissionList: PermissionListType = {
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { PerConstructPros, Permission } from '../controller';
|
||||
import { type PerConstructPros, Permission } from '../controller';
|
||||
import { AppDefaultPermissionVal } from './constant';
|
||||
|
||||
export class AppPermission extends Permission {
|
||||
|
@@ -1,6 +1,7 @@
|
||||
import { RequireAtLeastOne, RequireOnlyOne } from '../../common/type/utils';
|
||||
import { Permission } from './controller';
|
||||
import { PermissionValueType } from './type';
|
||||
import type { RequireOnlyOne } from '../../common/type/utils';
|
||||
import { RequireAtLeastOne } from '../../common/type/utils';
|
||||
import type { Permission } from './controller';
|
||||
import type { PermissionValueType } from './type';
|
||||
|
||||
export type CollaboratorItemType = {
|
||||
teamId: string;
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { PermissionListType } from './type';
|
||||
import { type PermissionListType } from './type';
|
||||
import { i18nT } from '../../../web/i18n/utils';
|
||||
export enum AuthUserTypeEnum {
|
||||
token = 'token',
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { PermissionListType, PermissionValueType } from './type';
|
||||
import { type PermissionListType, type PermissionValueType } from './type';
|
||||
import { PermissionList, NullPermission, OwnerPermissionVal } from './constant';
|
||||
|
||||
export type PerConstructPros = {
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { NullPermission } from '../constant';
|
||||
import { PerConstructPros, Permission } from '../controller';
|
||||
import { type PerConstructPros, Permission } from '../controller';
|
||||
export class DatasetPermission extends Permission {
|
||||
constructor(props?: PerConstructPros) {
|
||||
if (!props) {
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { PermissionKeyEnum, PermissionList } from '../constant';
|
||||
import { PermissionListType } from '../type';
|
||||
import { type PermissionListType } from '../type';
|
||||
|
||||
export enum GroupMemberRole {
|
||||
owner = 'owner',
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import { TeamMemberItemType } from 'support/user/team/type';
|
||||
import { TeamPermission } from '../user/controller';
|
||||
import { GroupMemberRole } from './constant';
|
||||
import { Permission } from '../controller';
|
||||
import type { GroupMemberRole } from './constant';
|
||||
import type { Permission } from '../controller';
|
||||
|
||||
type MemberGroupSchemaType = {
|
||||
_id: string;
|
||||
|
6
packages/global/support/permission/type.d.ts
vendored
6
packages/global/support/permission/type.d.ts
vendored
@@ -1,6 +1,6 @@
|
||||
import { UserModelSchema } from '../user/type';
|
||||
import { RequireOnlyOne } from '../../common/type/utils';
|
||||
import { TeamMemberSchema } from '../user/team/type';
|
||||
import type { UserModelSchema } from '../user/type';
|
||||
import type { RequireOnlyOne } from '../../common/type/utils';
|
||||
import type { TeamMemberSchema } from '../user/team/type';
|
||||
import { MemberGroupSchemaType } from './memberGroup/type';
|
||||
import type { TeamMemberWithUserSchema } from '../user/team/type';
|
||||
import { AuthUserTypeEnum, type PermissionKeyEnum, type PerResourceTypeEnum } from './constant';
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { PermissionKeyEnum } from '../constant';
|
||||
import { PermissionListType } from '../type';
|
||||
import { type PermissionListType } from '../type';
|
||||
import { PermissionList } from '../constant';
|
||||
import { i18nT } from '../../../../web/i18n/utils';
|
||||
export enum TeamPermissionKeyEnum {
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { PerConstructPros, Permission } from '../controller';
|
||||
import { type PerConstructPros, Permission } from '../controller';
|
||||
import {
|
||||
TeamApikeyCreatePermissionVal,
|
||||
TeamAppCreatePermissionVal,
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { PermissionValueType } from './type';
|
||||
import { type PermissionValueType } from './type';
|
||||
import { NullPermission, PermissionTypeEnum } from './constant';
|
||||
import { Permission } from './controller';
|
||||
import type { Permission } from './controller';
|
||||
|
||||
/* team public source, or owner source in team */
|
||||
export function mongoRPermission({
|
||||
|
14
packages/global/support/user/api.d.ts
vendored
14
packages/global/support/user/api.d.ts
vendored
@@ -1,12 +1,10 @@
|
||||
import {
|
||||
MemberGroupSchemaType,
|
||||
MemberGroupListItemType
|
||||
} from 'support/permission/memberGroup/type';
|
||||
import { OAuthEnum } from './constant';
|
||||
import { TrackRegisterParams } from './login/api';
|
||||
import type { MemberGroupSchemaType } from 'support/permission/memberGroup/type';
|
||||
import { MemberGroupListItemType } from 'support/permission/memberGroup/type';
|
||||
import type { OAuthEnum } from './constant';
|
||||
import type { TrackRegisterParams } from './login/api';
|
||||
import { TeamMemberStatusEnum } from './team/constant';
|
||||
import { OrgType } from './team/org/type';
|
||||
import { TeamMemberItemType } from './team/type';
|
||||
import type { OrgType } from './team/org/type';
|
||||
import type { TeamMemberItemType } from './team/type';
|
||||
|
||||
export type PostLoginProps = {
|
||||
username: string;
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { InformLevelEnum, SendInformTemplateCodeEnum } from './constants';
|
||||
import type { InformLevelEnum, SendInformTemplateCodeEnum } from './constants';
|
||||
|
||||
export type SendInformProps = {
|
||||
level: `${InformLevelEnum}`;
|
||||
|
2
packages/global/support/user/login/api.d.ts
vendored
2
packages/global/support/user/login/api.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
import { TrackRegisterParams } from '../../marketing/type';
|
||||
import type { TrackRegisterParams } from '../../marketing/type';
|
||||
|
||||
export type GetWXLoginQRResponse = {
|
||||
code: string;
|
||||
|
@@ -1,6 +1,7 @@
|
||||
import { PermissionValueType } from '../../permission/type';
|
||||
import { TeamMemberRoleEnum } from './constant';
|
||||
import { LafAccountType, TeamMemberSchema, ThirdPartyAccountType } from './type';
|
||||
import type { TeamMemberRoleEnum } from './constant';
|
||||
import type { TeamMemberSchema, ThirdPartyAccountType } from './type';
|
||||
import { LafAccountType } from './type';
|
||||
|
||||
export type AuthTeamRoleProps = {
|
||||
teamId: string;
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { GroupMemberRole } from '../../../../support/permission/memberGroup/constant';
|
||||
import type { GroupMemberRole } from '../../../../support/permission/memberGroup/constant';
|
||||
|
||||
export type postCreateGroupData = {
|
||||
name: string;
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { OrgSchemaType } from './type';
|
||||
import { type OrgSchemaType } from './type';
|
||||
|
||||
export const OrgCollectionName = 'team_orgs';
|
||||
export const OrgMemberCollectionName = 'team_org_members';
|
||||
|
4
packages/global/support/user/team/type.d.ts
vendored
4
packages/global/support/user/team/type.d.ts
vendored
@@ -1,8 +1,8 @@
|
||||
import type { UserModelSchema } from '../type';
|
||||
import type { TeamMemberRoleEnum, TeamMemberStatusEnum } from './constant';
|
||||
import { LafAccountType } from './type';
|
||||
import type { LafAccountType } from './type';
|
||||
import { PermissionValueType, ResourcePermissionType } from '../../permission/type';
|
||||
import { TeamPermission } from '../../permission/user/controller';
|
||||
import type { TeamPermission } from '../../permission/user/controller';
|
||||
|
||||
export type ThirdPartyAccountType = {
|
||||
lafAccount?: LafAccountType;
|
||||
|
8
packages/global/support/user/type.d.ts
vendored
8
packages/global/support/user/type.d.ts
vendored
@@ -1,7 +1,7 @@
|
||||
import { TeamPermission } from '../permission/user/controller';
|
||||
import { UserStatusEnum } from './constant';
|
||||
import { TeamMemberStatusEnum } from './team/constant';
|
||||
import { TeamTmbItemType } from './team/type';
|
||||
import type { TeamPermission } from '../permission/user/controller';
|
||||
import type { UserStatusEnum } from './constant';
|
||||
import type { TeamMemberStatusEnum } from './team/constant';
|
||||
import type { TeamTmbItemType } from './team/type';
|
||||
|
||||
export type UserModelSchema = {
|
||||
_id: string;
|
||||
|
5
packages/global/support/wallet/bill/api.d.ts
vendored
5
packages/global/support/wallet/bill/api.d.ts
vendored
@@ -1,5 +1,6 @@
|
||||
import { StandardSubLevelEnum, SubModeEnum } from '../sub/constants';
|
||||
import { BillTypeEnum, DrawBillQRItem } from './constants';
|
||||
import type { StandardSubLevelEnum, SubModeEnum } from '../sub/constants';
|
||||
import type { BillTypeEnum } from './constants';
|
||||
import { DrawBillQRItem } from './constants';
|
||||
|
||||
export type CreateOrderResponse = {
|
||||
qrCode?: string;
|
||||
|
@@ -1,6 +1,7 @@
|
||||
import { StandardSubLevelEnum, SubModeEnum, SubTypeEnum } from '../sub/constants';
|
||||
import { BillPayWayEnum, BillStatusEnum, BillTypeEnum } from './constants';
|
||||
import { TeamInvoiceHeaderType } from '../../user/team/type';
|
||||
import type { StandardSubLevelEnum, SubModeEnum } from '../sub/constants';
|
||||
import { SubTypeEnum } from '../sub/constants';
|
||||
import type { BillPayWayEnum, BillStatusEnum, BillTypeEnum } from './constants';
|
||||
import type { TeamInvoiceHeaderType } from '../../user/team/type';
|
||||
|
||||
export type BillSchemaType = {
|
||||
_id: string;
|
||||
|
2
packages/global/support/wallet/sub/api.d.ts
vendored
2
packages/global/support/wallet/sub/api.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
import { StandardSubLevelEnum, SubModeEnum } from './constants';
|
||||
import type { StandardSubLevelEnum, SubModeEnum } from './constants';
|
||||
import { TeamSubSchema } from './type.d';
|
||||
|
||||
export type StandardSubPlanParams = {
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { SubTypeEnum, StandardSubLevelEnum } from '../constants';
|
||||
import type { SubTypeEnum, StandardSubLevelEnum } from '../constants';
|
||||
|
||||
export type TeamCouponSub = {
|
||||
type: `${SubTypeEnum}`; // Sub type
|
||||
|
2
packages/global/support/wallet/sub/type.d.ts
vendored
2
packages/global/support/wallet/sub/type.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
import { StandardSubLevelEnum, SubModeEnum, SubTypeEnum } from './constants';
|
||||
import type { StandardSubLevelEnum, SubModeEnum, SubTypeEnum } from './constants';
|
||||
|
||||
// Content of plan
|
||||
export type TeamStandardSubPlanItemType = {
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { UsageSourceEnum } from './constants';
|
||||
import { UsageListItemCountType, UsageListItemType } from './type';
|
||||
import type { UsageSourceEnum } from './constants';
|
||||
import type { UsageListItemCountType, UsageListItemType } from './type';
|
||||
|
||||
export type CreateTrainingUsageProps = {
|
||||
name: string;
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { SourceMemberType } from '../../../support/user/type';
|
||||
import { CreateUsageProps } from './api';
|
||||
import type { SourceMemberType } from '../../../support/user/type';
|
||||
import type { CreateUsageProps } from './api';
|
||||
import { UsageSourceEnum } from './constants';
|
||||
|
||||
export type UsageListItemCountType = {
|
||||
|
Reference in New Issue
Block a user