From ce6dcea01814cd47889fc38f9605272d2247400a Mon Sep 17 00:00:00 2001 From: Git Hooks Test Date: Wed, 16 Sep 2026 01:07:41 +0800 Subject: [PATCH] baseline --- .eslintrc.cjs | 433 +--------------------------------------------- .prettierrc.json | 6 +- ignored/legacy.ts | 3 + partial.ts | 2 + sample.ts | 5 + 5 files changed, 12 insertions(+), 437 deletions(-) create mode 100644 ignored/legacy.ts create mode 100644 partial.ts create mode 100644 sample.ts diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 8a4b2d0c6..6d9e0fc39 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -1,432 +1 @@ -const globals = require('globals'); - -module.exports = { - root: true, - env: { - es2022: true, - }, - parser: '@typescript-eslint/parser', - parserOptions: { - ecmaVersion: 'latest', - sourceType: 'module', - ecmaFeatures: { - jsx: true, - }, - }, - globals: { - ...globals.browser, - ...globals.node, - }, - overrides: [ - { - files: ['scripts/**/*.{ts,js,mjs,cjs}'], - rules: { - 'no-console': 'off', - }, - }, - { - files: ['**/scripts/**/*.{ts,js,mjs,cjs}'], - rules: { - 'no-console': 'off', - }, - }, - { - files: ['**/*.test.{ts,tsx,js,mjs,cjs}'], - rules: { - 'no-console': 'off', - 'unused-imports/no-unused-vars': 'off', - }, - }, - { - files: ['miniprogram/**/*.js'], - globals: { - App: 'readonly', - }, - }, - { - files: [ - 'apps/admin-web/src/pages/*.tsx', - 'src/components/platform-entry/PlatformActiveMobileWelcomeDialog.tsx', - 'src/components/platform-entry/PlatformMobileHomeWelcomeDialog.tsx', - ], - rules: { - 'react-refresh/only-export-components': 'off', - }, - }, - { - files: ['src/components/platform-entry/PlatformEntryFlowShellImpl.tsx'], - rules: { - 'react-hooks/exhaustive-deps': 'off', - }, - }, - { - files: [ - 'src/active-main.tsx', - 'src/ActiveApp.tsx', - 'src/AuthenticatedApp.tsx', - 'src/hooks/useGameSettings.ts', - 'src/routing/activeApp*.ts', - 'src/routing/activeApp*.tsx', - 'src/components/auth/**/*.{ts,tsx}', - 'src/components/common/**/*.{ts,tsx}', - 'src/components/creation-home/**/*.{ts,tsx}', - 'src/components/image-editor/**/*.{ts,tsx}', - 'src/components/project/**/*.{ts,tsx}', - 'src/components/platform-entry/PlatformActiveProfileView*.tsx', - 'src/components/platform-entry/PlatformActiveMobileWelcomeDialog*.tsx', - 'src/components/platform-entry/PlatformEntryActiveFlowShell*.tsx', - 'src/components/platform-entry/PlatformEntryFlowShell.tsx', - 'src/components/platform-entry/PlatformProfileApiKeysModal.tsx', - 'src/components/platform-entry/PlatformProfileModalShell.tsx', - 'src/components/platform-entry/PlatformProfilePrimitives.tsx', - 'src/components/platform-entry/PlatformProfileRechargeModal.tsx', - 'src/components/platform-entry/PlatformProfileReferralModal.tsx', - 'src/components/platform-entry/PlatformProfileRewardCodeRedeemModal.tsx', - 'src/components/platform-entry/PlatformProfileWalletLedgerModal.tsx', - 'src/components/platform-entry/PlatformRechargePaymentStatusDialogs.tsx', - 'src/components/platform-entry/platformActiveProfileModel.ts', - 'src/components/platform-entry/platformEntryActiveTypes.ts', - 'src/components/platform-entry/platformProfileFundsModel.ts', - 'src/components/platform-entry/platformProfileHostClipboard.ts', - 'src/components/platform-entry/usePlatformProfileCenterController.ts', - 'src/services/image-editor/**/*.{ts,tsx}', - 'src/services/platform-entry/**/*.{ts,tsx}', - ], - rules: { - 'no-restricted-imports': [ - 'error', - { - patterns: [ - { - group: [ - '**/components/rpg-entry/**', - '**/components/*-creation/**', - '**/components/*-result/**', - '**/components/*-runtime/**', - '**/components/creation-agent/**', - '**/components/creative-agent/**', - '**/components/custom-world-*/**', - '**/components/unified-creation/**', - '**/services/rpg-entry/**', - '**/services/rpg-runtime/**', - '**/services/*-creation/**', - '**/services/*-runtime/**', - '**/services/*-works/**', - '**/services/creation-agent/**', - '**/services/creative-agent/**', - '**/services/puzzle-*/**', - '**/services/storyEngine/**', - ], - message: '现役前端不得重新导入已退役的创作模板模块。', - }, - ], - }, - ], - }, - }, - { - files: ['src/components/game-canvas/**/*.tsx'], - rules: { - 'react-refresh/only-export-components': 'off', - }, - }, - { - files: ['src/components/GameShell.tsx', 'src/hooks/useCombatFlow.ts'], - rules: { - 'simple-import-sort/imports': 'off', - 'simple-import-sort/exports': 'off', - }, - }, - ], - plugins: [ - '@typescript-eslint', - 'react-hooks', - 'react-refresh', - 'simple-import-sort', - 'unused-imports', - ], - extends: [ - 'eslint:recommended', - 'plugin:@typescript-eslint/recommended', - 'plugin:react-hooks/recommended', - 'prettier', - ], - ignorePatterns: [ - 'dist', - 'dist_check', - 'dist_check_monster_position', - 'coverage', - 'build', - 'output', - 'retired/**', - 'node_modules', - 'server-rs/target', - 'server-rs/target-*', - 'apps/desktop-shell/src-tauri/target', - 'apps/ai-game-creator-shell/src/features/ui-editor/types/**', - 'apps/ai-game-creator-shell/src/features/project-workspace/generated/**', - 'target', - 'src/main.tsx', - 'src/App.tsx', - 'src/routing/appPageRoutes.ts', - 'src/routing/appPageRoutes.test.ts', - 'src/routing/appRoutes.tsx', - 'src/routing/appRoutes.test.ts', - 'src/services/appTitle.ts', - 'src/services/appTitle.test.ts', - 'src/components/CharacterAnimator.tsx', - 'src/components/*.ts', - 'src/components/*.tsx', - '!src/components/ResolvedAssetAudio.tsx', - '!src/components/ResolvedAssetImage.tsx', - '!src/components/ResolvedAssetVideo.tsx', - 'src/hooks/*.ts', - 'src/hooks/*.tsx', - '!src/hooks/useGameSettings.ts', - '!src/hooks/useHostNavigationCanGoBack.ts', - '!src/hooks/useHostNavigationCanGoBack.test.tsx', - '!src/hooks/useResolvedAssetReadUrl.ts', - '!src/hooks/useResolvedAssetReadUrl.test.tsx', - 'src/persistence/*.ts', - 'src/persistence/*.tsx', - '!src/persistence/gameSettingsStorage.ts', - '!src/persistence/gameSettingsStorage.test.ts', - '!src/persistence/storage.ts', - '!src/persistence/storage.test.ts', - 'src/routing/*.ts', - 'src/routing/*.tsx', - '!src/routing/activeAppPageRoutes.ts', - '!src/routing/activeAppPageRoutes.test.ts', - '!src/routing/activeAppRoutes.tsx', - '!src/routing/activeAppRoutes.test.ts', - 'src/services/*.ts', - 'src/services/*.tsx', - '!src/services/activeAppTitle.ts', - '!src/services/activeAppTitle.test.ts', - '!src/services/apiClient.ts', - '!src/services/apiClient.test.ts', - '!src/services/assetReadUrlService.ts', - '!src/services/assetReadUrlService.test.ts', - '!src/services/authService.ts', - '!src/services/authService.test.ts', - '!src/services/clipboard.ts', - '!src/services/clipboard.test.ts', - '!src/services/frontendRuntimeConfigService.ts', - '!src/services/frontendRuntimeConfigService.test.ts', - '!src/services/sseStream.ts', - '!src/services/sseStream.test.ts', - 'src/AdventurePanel.tsx', - 'src/AdventureEntityModal.tsx', - 'src/App.tsx', - 'src/App.test.tsx', - 'src/CharacterCreation.tsx', - 'src/RpgRuntimeApp.tsx', - 'src/routing/appPageRoutes.ts', - 'src/routing/appPageRoutes.test.ts', - 'src/routing/appRoutes.tsx', - 'src/routing/appRoutes.test.ts', - 'src/*PlaygroundApp.tsx', - 'src/ChildMotionDemoApp.tsx', - 'src/Match3DPlaygroundApp.tsx', - 'src/components/child-motion-demo/**', - 'src/components/asset-studio/**', - 'src/components/bark-battle-creation/**', - 'src/components/big-fish-creation/**', - 'src/components/big-fish-result/**', - 'src/components/big-fish-runtime/**', - 'src/components/creation-agent/**', - 'src/components/creative-agent/**', - 'src/components/custom-world-agent/**', - 'src/components/custom-world-home/**', - 'src/components/edutainment-creation/**', - 'src/components/edutainment-result/**', - 'src/components/edutainment-runtime/**', - 'src/components/game-canvas/**', - 'src/components/jump-hop-result/**', - 'src/components/jump-hop-runtime/**', - 'src/components/match3d-result/**', - 'src/components/match3d-runtime/**', - 'src/components/puzzle-clear-creation/**', - 'src/components/puzzle-clear-result/**', - 'src/components/puzzle-clear-runtime/**', - 'src/components/puzzle-gallery/**', - 'src/components/puzzle-result/**', - 'src/components/puzzle-runtime/**', - 'src/components/rpg-creation-asset-studio/**', - 'src/components/rpg-creation-result/**', - 'src/components/rpg-runtime-panels/**', - 'src/components/square-hole-creation/**', - 'src/components/square-hole-result/**', - 'src/components/square-hole-runtime/**', - 'src/components/unified-creation/**', - 'src/components/visual-novel-creation/**', - 'src/components/visual-novel-result/**', - 'src/components/visual-novel-runtime/**', - 'src/components/wooden-fish-result/**', - 'src/components/wooden-fish-runtime/**', - 'src/components/common/PublishShare*', - 'src/components/common/publishShare*', - 'src/components/platform-entry/PlatformEntryCreation*', - 'src/components/platform-entry/PlatformEntryFlowShellImpl.tsx', - 'src/components/platform-entry/platformEntryTypes.ts', - 'src/components/platform-entry/PlatformEntryHome*', - 'src/components/platform-entry/PlatformEntryWorld*', - 'src/components/platform-entry/PlatformMobileHome*', - 'src/components/platform-entry/PlatformWork*', - 'src/components/platform-entry/PlatformDraft*', - 'src/components/platform-entry/PlatformTask*', - 'src/components/platform-entry/PlatformError*', - 'src/components/platform-entry/barkBattle*', - 'src/components/platform-entry/platformCreation*', - 'src/components/platform-entry/platformDialog*', - 'src/components/platform-entry/platformDraft*', - 'src/components/platform-entry/platformEdutainment*', - 'src/components/platform-entry/platformEntryCreation*', - 'src/components/platform-entry/platformExternal*', - 'src/components/platform-entry/platformGeneration*', - 'src/components/platform-entry/platformHost*', - 'src/components/platform-entry/platformMiniGame*', - 'src/components/platform-entry/platformPlayed*', - 'src/components/platform-entry/platformPublic*', - 'src/components/platform-entry/platformPuzzle*', - 'src/components/platform-entry/platformRecommend*', - 'src/components/platform-entry/platformRpg*', - 'src/components/platform-entry/platformSelection*', - 'src/components/platform-entry/puzzleDraft*', - 'src/components/platform-entry/usePlatformCreation*', - 'src/components/platform-entry/usePlatformEntry*', - 'src/components/platform-entry/PlatformEntryFlowShellImpl/**', - 'src/components/platform-entry/platformMatch3DRuntimeProfile*', - 'src/components/unified-creation/workspaces/JumpHopCreationWorkspace*', - 'src/components/unified-creation/workspaces/Match3DCreationWorkspace*', - 'src/components/rpg-creation-editor/**', - 'src/components/rpg-entry/**', - 'src/components/custom-world-home/CustomWorldCreationHub.interaction.test.tsx', - 'src/components/custom-world-home/CustomWorldCreationHub.test.tsx', - 'src/components/custom-world-home/CustomWorldCreationHub.testAdapter.tsx', - 'src/components/custom-world-home/creationWorkShelf.test.ts', - 'src/components/rpg-runtime-shell/**', - 'src/hooks/rpg-runtime-story/**', - 'src/hooks/rpg-session/**', - 'src/hooks/combat/**', - 'src/hooks/useCombatFlow.ts', - 'src/hooks/useStoryOptions.ts', - 'src/prompts/customWorldPrompts.ts', - 'src/services/ai.ts', - 'src/services/appTitle.ts', - 'src/services/appTitle.test.ts', - 'src/services/miniGameDraftGenerationProgress.ts', - 'src/services/creationEntryConfigService.ts', - 'src/services/creationUrlState*', - 'src/services/customWorld*', - 'src/services/input-devices/**', - 'src/services/publicWorkCode.ts', - 'src/services/runtimeGuestAuth.ts', - 'src/services/runtimeRequest*', - 'src/services/runtimeAudioFeedback.ts', - 'src/services/useMocapInput*', - 'src/services/wechatMiniProgramSubscribe*', - 'src/services/bark-battle-creation/**', - 'src/services/bark-battle-runtime/**', - 'src/services/big-fish-creation/**', - 'src/services/big-fish-gallery/**', - 'src/services/big-fish-runtime/**', - 'src/services/big-fish-works/**', - 'src/services/creation-agent/**', - 'src/services/creation-audio/**', - 'src/services/creative-agent/**', - 'src/services/edutainment-baby-drawing/**', - 'src/services/edutainment-baby-object/**', - 'src/services/child-motion-demo/**', - 'src/services/jump-hop/**', - 'src/services/match3d-creation/**', - 'src/services/match3d-runtime/**', - 'src/services/match3d-works/**', - 'src/services/match3dGeneratedModelCache*', - 'src/services/match3dSpritesheetParser*', - 'src/services/puzzle-agent/**', - 'src/services/puzzle-gallery/**', - 'src/services/puzzle-onboarding/**', - 'src/services/puzzle-runtime/**', - 'src/services/puzzle-works/**', - 'src/services/rpg-creation/**', - 'src/services/rpg-entry/**', - 'src/services/rpg-runtime/**', - 'src/services/square-hole-creation/**', - 'src/services/square-hole-runtime/**', - 'src/services/square-hole-works/**', - 'src/services/storyEngine/**', - 'src/services/visual-novel-creation/**', - 'src/services/visual-novel-runtime/**', - 'src/services/visual-novel-works/**', - 'src/services/wooden-fish/**', - 'src/types.ts', - 'src/types/**', - 'src/uiAssets.ts', - 'scripts/loadtest/**', - 'packages/shared/src/contracts/jumpHop.ts', - 'packages/shared/src/contracts/match3dAgent.ts', - 'packages/shared/src/contracts/match3dRuntime.ts', - 'packages/shared/src/contracts/match3dWorks.ts', - 'packages/shared/src/contracts/barkBattle*', - 'packages/shared/src/contracts/bigFish*', - 'packages/shared/src/contracts/creationAgent*', - 'packages/shared/src/contracts/creationAudio*', - 'packages/shared/src/contracts/creativeAgent*', - 'packages/shared/src/contracts/customWorld*', - 'packages/shared/src/contracts/edutainment*', - 'packages/shared/src/contracts/playTypes*', - 'packages/shared/src/contracts/publicWork*', - 'packages/shared/src/contracts/puzzle*', - 'packages/shared/src/contracts/rpg*', - 'packages/shared/src/contracts/squareHole*', - 'packages/shared/src/contracts/story*', - 'packages/shared/src/contracts/visualNovel*', - 'packages/shared/src/contracts/woodenFish*', - 'scripts/export-match3d-resource-pipeline*', - 'scripts/generate-child-motion-demo-assets.mjs', - 'src/services/puzzle-clear/**', - 'src/games/**', - 'src/data/**', - 'src/prompts/**', - 'apps/admin-web/src/pages/AdminCreationEntrySwitchPage*', - 'apps/admin-web/src/pages/AdminWorkVisibilityPage*', - 'src/services/recommendedRuntimeGuestLaunch.test.ts', - 'src/data/sceneEncounterPreviews.ts', - 'public/Icons', - 'media', - '.codex-logs', - '*.log', - '.preview.*', - 'temp-build-goal-check/**', - 'tmp_*', - 'tmp/**', - 'npc-editor-*', - 'temp-write-check.txt', - '**/__pycache__/**', - '*.timestamp-*.mjs', - ], - rules: { - '@typescript-eslint/no-var-requires': 'off', - 'react-hooks/rules-of-hooks': 'error', - 'react-refresh/only-export-components': [ - 'error', - { allowConstantExport: true }, - ], - 'simple-import-sort/imports': 'error', - 'simple-import-sort/exports': 'error', - '@typescript-eslint/no-unused-vars': 'off', - 'unused-imports/no-unused-imports': 'error', - 'unused-imports/no-unused-vars': [ - 'error', - { - argsIgnorePattern: '^_', - varsIgnorePattern: '^_', - }, - ], - 'no-constant-condition': 'error', - 'no-console': ['error', { allow: ['warn', 'error'] }], - 'no-useless-escape': 'error', - 'prefer-const': 'error', - }, -}; +module.exports = {"root":true,"ignorePatterns":["ignored/**"],"parserOptions":{"ecmaVersion":"latest","sourceType":"module"},"plugins":["simple-import-sort"],"rules":{"simple-import-sort/imports":"error"}}; diff --git a/.prettierrc.json b/.prettierrc.json index 7d2081a95..0bed832ed 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -1,5 +1 @@ -{ - "singleQuote": true, - "semi": true, - "trailingComma": "all" -} +{"singleQuote":true,"semi":true,"trailingComma":"all"} \ No newline at end of file diff --git a/ignored/legacy.ts b/ignored/legacy.ts new file mode 100644 index 000000000..fb7d518bd --- /dev/null +++ b/ignored/legacy.ts @@ -0,0 +1,3 @@ +import { zebra } from './zebra'; +import { alpha } from './alpha'; +void zebra; void alpha; diff --git a/partial.ts b/partial.ts new file mode 100644 index 000000000..9b439571d --- /dev/null +++ b/partial.ts @@ -0,0 +1,2 @@ +const original = 1; +const keep = 2; diff --git a/sample.ts b/sample.ts new file mode 100644 index 000000000..d93acb27d --- /dev/null +++ b/sample.ts @@ -0,0 +1,5 @@ +import { alpha } from './alpha'; +import { zebra } from './zebra'; + +void alpha; +void zebra;