mirror of
https://github.com/labring/FastGPT.git
synced 2025-10-15 07:31:19 +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,4 +1,4 @@
|
||||
import { ErrType } from '../errorCode';
|
||||
import { type ErrType } from '../errorCode';
|
||||
import { i18nT } from '../../../../web/i18n/utils';
|
||||
/* dataset: 502000 */
|
||||
export enum AppErrEnum {
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { ErrType } from '../errorCode';
|
||||
import { type ErrType } from '../errorCode';
|
||||
import { i18nT } from '../../../../web/i18n/utils';
|
||||
/* dataset: 504000 */
|
||||
export enum ChatErrEnum {
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { i18nT } from '../../../../web/i18n/utils';
|
||||
import { ErrType } from '../errorCode';
|
||||
import { type ErrType } from '../errorCode';
|
||||
|
||||
/* dataset: 507000 */
|
||||
const startCode = 507000;
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { i18nT } from '../../../../web/i18n/utils';
|
||||
import { ErrType } from '../errorCode';
|
||||
import { type ErrType } from '../errorCode';
|
||||
|
||||
/* dataset: 501000 */
|
||||
export enum DatasetErrEnum {
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { ErrType } from '../errorCode';
|
||||
import { type ErrType } from '../errorCode';
|
||||
import { i18nT } from '../../../../web/i18n/utils';
|
||||
/* dataset: 506000 */
|
||||
export enum OpenApiErrEnum {
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { ErrType } from '../errorCode';
|
||||
import { type ErrType } from '../errorCode';
|
||||
import { i18nT } from '../../../../web/i18n/utils';
|
||||
/* dataset: 505000 */
|
||||
export enum OutLinkErrEnum {
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { ErrType } from '../errorCode';
|
||||
import { type ErrType } from '../errorCode';
|
||||
import { i18nT } from '../../../../web/i18n/utils';
|
||||
/* dataset: 508000 */
|
||||
export enum PluginErrEnum {
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { ErrType } from '../errorCode';
|
||||
import { type ErrType } from '../errorCode';
|
||||
import { i18nT } from '../../../../web/i18n/utils';
|
||||
/* dataset: 509000 */
|
||||
export enum SystemErrEnum {
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { ErrType } from '../errorCode';
|
||||
import { type ErrType } from '../errorCode';
|
||||
import { i18nT } from '../../../../web/i18n/utils';
|
||||
/* team: 503000 */
|
||||
export enum UserErrEnum {
|
||||
|
2
packages/global/common/file/api.d.ts
vendored
2
packages/global/common/file/api.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
import { OutLinkChatAuthProps } from '../../support/permission/chat.d';
|
||||
import type { OutLinkChatAuthProps } from '../../support/permission/chat.d';
|
||||
|
||||
export type preUploadImgProps = OutLinkChatAuthProps & {
|
||||
// expiredTime?: Date;
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import { detect } from 'jschardet';
|
||||
import { documentFileType } from './constants';
|
||||
import { ChatFileTypeEnum } from '../../core/chat/constants';
|
||||
import { UserChatItemValueItemType } from '../../core/chat/type';
|
||||
import { type UserChatItemValueItemType } from '../../core/chat/type';
|
||||
import * as fs from 'fs';
|
||||
|
||||
export const formatFileSize = (bytes: number): string => {
|
||||
|
2
packages/global/common/file/type.d.ts
vendored
2
packages/global/common/file/type.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
import { BucketNameEnum } from './constants';
|
||||
import type { BucketNameEnum } from './constants';
|
||||
|
||||
export type FileTokenQuery = {
|
||||
bucketName: `${BucketNameEnum}`;
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { TrackEnum } from './constants';
|
||||
import type { TrackEnum } from './constants';
|
||||
import { OAuthEnum } from '../../../support/user/constant';
|
||||
import { AppTypeEnum } from '../../../core/app/constants';
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { ParentIdType } from './type';
|
||||
import { type ParentIdType } from './type';
|
||||
|
||||
export const parseParentIdInMongo = (parentId: ParentIdType) => {
|
||||
if (parentId === undefined) return {};
|
||||
|
@@ -1,8 +1,8 @@
|
||||
import { SystemConfigsTypeEnum } from "./constants";
|
||||
import type { SystemConfigsTypeEnum } from './constants';
|
||||
|
||||
export type SystemConfigsType = {
|
||||
_id: string;
|
||||
type: `${SystemConfigsTypeEnum}`;
|
||||
value: Record<string, any>;
|
||||
createTime: Date;
|
||||
};
|
||||
};
|
||||
|
@@ -1,4 +1,5 @@
|
||||
import { StandSubPlanLevelMapType, SubPlanType } from '../../../support/wallet/sub/type';
|
||||
import type { SubPlanType } from '../../../support/wallet/sub/type';
|
||||
import { StandSubPlanLevelMapType } from '../../../support/wallet/sub/type';
|
||||
import type {
|
||||
ChatModelItemType,
|
||||
FunctionModelItemType,
|
||||
|
Reference in New Issue
Block a user