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:
Theresa
2025-05-06 17:33:09 +08:00
committed by GitHub
parent 5361674a2c
commit 2d3117c5da
806 changed files with 2223 additions and 1881 deletions

View File

@@ -1,4 +1,4 @@
import { ErrType } from '../errorCode';
import { type ErrType } from '../errorCode';
import { i18nT } from '../../../../web/i18n/utils';
/* dataset: 502000 */
export enum AppErrEnum {

View File

@@ -1,4 +1,4 @@
import { ErrType } from '../errorCode';
import { type ErrType } from '../errorCode';
import { i18nT } from '../../../../web/i18n/utils';
/* dataset: 504000 */
export enum ChatErrEnum {

View File

@@ -1,5 +1,5 @@
import { i18nT } from '../../../../web/i18n/utils';
import { ErrType } from '../errorCode';
import { type ErrType } from '../errorCode';
/* dataset: 507000 */
const startCode = 507000;

View File

@@ -1,5 +1,5 @@
import { i18nT } from '../../../../web/i18n/utils';
import { ErrType } from '../errorCode';
import { type ErrType } from '../errorCode';
/* dataset: 501000 */
export enum DatasetErrEnum {

View File

@@ -1,4 +1,4 @@
import { ErrType } from '../errorCode';
import { type ErrType } from '../errorCode';
import { i18nT } from '../../../../web/i18n/utils';
/* dataset: 506000 */
export enum OpenApiErrEnum {

View File

@@ -1,4 +1,4 @@
import { ErrType } from '../errorCode';
import { type ErrType } from '../errorCode';
import { i18nT } from '../../../../web/i18n/utils';
/* dataset: 505000 */
export enum OutLinkErrEnum {

View File

@@ -1,4 +1,4 @@
import { ErrType } from '../errorCode';
import { type ErrType } from '../errorCode';
import { i18nT } from '../../../../web/i18n/utils';
/* dataset: 508000 */
export enum PluginErrEnum {

View File

@@ -1,4 +1,4 @@
import { ErrType } from '../errorCode';
import { type ErrType } from '../errorCode';
import { i18nT } from '../../../../web/i18n/utils';
/* dataset: 509000 */
export enum SystemErrEnum {

View File

@@ -1,4 +1,4 @@
import { ErrType } from '../errorCode';
import { type ErrType } from '../errorCode';
import { i18nT } from '../../../../web/i18n/utils';
/* team: 503000 */
export enum UserErrEnum {

View File

@@ -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;

View File

@@ -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 => {

View File

@@ -1,4 +1,4 @@
import { BucketNameEnum } from './constants';
import type { BucketNameEnum } from './constants';
export type FileTokenQuery = {
bucketName: `${BucketNameEnum}`;

View File

@@ -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';

View File

@@ -1,4 +1,4 @@
import { ParentIdType } from './type';
import { type ParentIdType } from './type';
export const parseParentIdInMongo = (parentId: ParentIdType) => {
if (parentId === undefined) return {};

View File

@@ -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;
};
};

View File

@@ -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,