From 2dd6ebef587c6301cbf5b642c16146bae1a262eb Mon Sep 17 00:00:00 2001 From: dolphin Date: Thu, 23 Jul 2026 12:08:35 +0800 Subject: [PATCH] chore(frontend): block new hardcoded Chinese copy via lint (ledger #28) - no-restricted-syntax flags Chinese in string/template/JSX literals in all three packages - existing violations frozen into eslint-suppressions.json (shrink-only) - @bisheng/ui: zero violations in component source; .cjs tooling exempt (token metadata is internal docs) --- src/frontend/client/eslint-suppressions.json | 403 ++++++++++++++ src/frontend/client/eslint.config.mjs | 8 + src/frontend/packages/ui/eslint.config.mjs | 9 + .../platform/eslint-suppressions.json | 505 ++++++++++++++++++ src/frontend/platform/eslint.config.mjs | 8 + 5 files changed, 933 insertions(+) diff --git a/src/frontend/client/eslint-suppressions.json b/src/frontend/client/eslint-suppressions.json index a5b6ab0c8..30f3d28b6 100644 --- a/src/frontend/client/eslint-suppressions.json +++ b/src/frontend/client/eslint-suppressions.json @@ -24,6 +24,9 @@ "no-console": { "count": 2 }, + "no-restricted-syntax": { + "count": 1 + }, "prefer-const": { "count": 6 } @@ -76,6 +79,14 @@ }, "@typescript-eslint/no-unused-vars": { "count": 1 + }, + "no-restricted-syntax": { + "count": 3 + } + }, + "src/api/knowledgeParseFailureMessage.ts": { + "no-restricted-syntax": { + "count": 7 } }, "src/api/linsight.ts": { @@ -120,6 +131,9 @@ }, "no-console": { "count": 1 + }, + "no-restricted-syntax": { + "count": 1 } }, "src/api/user.ts": { @@ -139,6 +153,9 @@ "no-restricted-imports": { "count": 1 }, + "no-restricted-syntax": { + "count": 3 + }, "no-useless-escape": { "count": 2 } @@ -231,6 +248,14 @@ "src/components/ChannelMemberDialog.tsx": { "@typescript-eslint/no-unused-vars": { "count": 1 + }, + "no-restricted-syntax": { + "count": 12 + } + }, + "src/components/ChannelMemberManagementPanel.tsx": { + "no-restricted-syntax": { + "count": 12 } }, "src/components/Chat/AiChatInput.tsx": { @@ -242,12 +267,18 @@ }, "no-restricted-imports": { "count": 1 + }, + "no-restricted-syntax": { + "count": 1 } }, "src/components/Chat/AiChatMessages.tsx": { "no-restricted-imports": { "count": 1 }, + "no-restricted-syntax": { + "count": 1 + }, "react-hooks/exhaustive-deps": { "count": 1 } @@ -261,6 +292,9 @@ }, "no-misleading-character-class": { "count": 1 + }, + "no-restricted-syntax": { + "count": 5 } }, "src/components/Chat/AiModelSelect.tsx": { @@ -281,6 +315,9 @@ "no-restricted-imports": { "count": 1 }, + "no-restricted-syntax": { + "count": 2 + }, "react-hooks/exhaustive-deps": { "count": 2 } @@ -403,6 +440,9 @@ "@typescript-eslint/no-unused-vars": { "count": 6 }, + "no-restricted-syntax": { + "count": 1 + }, "react-hooks/exhaustive-deps": { "count": 1 } @@ -468,6 +508,9 @@ }, "no-console": { "count": 1 + }, + "no-restricted-syntax": { + "count": 1 } }, "src/components/Chat/Landing.tsx": { @@ -509,14 +552,30 @@ "count": 1 } }, + "src/components/Chat/MessageFeedbackButtons.tsx": { + "no-restricted-syntax": { + "count": 4 + } + }, "src/components/Chat/MessageSelection/ExportFormatSheet.tsx": { "@typescript-eslint/no-explicit-any": { "count": 1 + }, + "no-restricted-syntax": { + "count": 1 + } + }, + "src/components/Chat/MessageSelection/ExportSelectionButton.tsx": { + "no-restricted-syntax": { + "count": 4 } }, "src/components/Chat/MessageSelection/MessageSelectionToolbar.tsx": { "@typescript-eslint/no-explicit-any": { "count": 1 + }, + "no-restricted-syntax": { + "count": 2 } }, "src/components/Chat/Messages/Content/ActionIcon.tsx": { @@ -530,6 +589,9 @@ }, "no-restricted-imports": { "count": 1 + }, + "no-restricted-syntax": { + "count": 4 } }, "src/components/Chat/Messages/Content/CitationReferencesDrawer.tsx": { @@ -539,10 +601,18 @@ "no-restricted-imports": { "count": 1 }, + "no-restricted-syntax": { + "count": 17 + }, "react-hooks/exhaustive-deps": { "count": 1 } }, + "src/components/Chat/Messages/Content/CitationSourceIcon.tsx": { + "no-restricted-syntax": { + "count": 2 + } + }, "src/components/Chat/Messages/Content/CodeAnalyze.tsx": { "no-restricted-imports": { "count": 1 @@ -589,6 +659,9 @@ "no-restricted-imports": { "count": 1 }, + "no-restricted-syntax": { + "count": 6 + }, "no-useless-escape": { "count": 1 } @@ -661,6 +734,9 @@ "src/components/Chat/Messages/Content/citationUtils.ts": { "@typescript-eslint/no-explicit-any": { "count": 4 + }, + "no-restricted-syntax": { + "count": 17 } }, "src/components/Chat/Messages/Content/useCitationReferencePanel.tsx": { @@ -668,6 +744,11 @@ "count": 1 } }, + "src/components/Chat/Messages/DeepThinkingGroup.tsx": { + "no-restricted-syntax": { + "count": 6 + } + }, "src/components/Chat/Messages/HoverButtons.tsx": { "@typescript-eslint/no-explicit-any": { "count": 2 @@ -732,11 +813,17 @@ "src/components/Chat/Messages/ThinkingContent.tsx": { "no-restricted-imports": { "count": 1 + }, + "no-restricted-syntax": { + "count": 1 } }, "src/components/Chat/Messages/ToolCallDisplay.tsx": { "@typescript-eslint/no-explicit-any": { "count": 8 + }, + "no-restricted-syntax": { + "count": 13 } }, "src/components/Chat/Messages/ui/MessageRender.tsx": { @@ -798,6 +885,11 @@ "count": 1 } }, + "src/components/FileListRow.tsx": { + "no-restricted-syntax": { + "count": 11 + } + }, "src/components/Files/ActionButton.tsx": { "@typescript-eslint/no-unused-vars": { "count": 1 @@ -873,6 +965,11 @@ "count": 3 } }, + "src/components/InfiniteScroll.tsx": { + "no-restricted-syntax": { + "count": 1 + } + }, "src/components/Input/ModelSelect/PluginsByIndex.tsx": { "no-restricted-imports": { "count": 1 @@ -904,6 +1001,9 @@ "src/components/Linsight/Artifacts/artifactUtils.test.ts": { "@typescript-eslint/no-explicit-any": { "count": 10 + }, + "no-restricted-syntax": { + "count": 19 } }, "src/components/Linsight/Artifacts/artifactUtils.ts": { @@ -952,12 +1052,25 @@ "count": 1 } }, + "src/components/Linsight/Execution/ToolRowLite.tsx": { + "no-restricted-syntax": { + "count": 7 + } + }, + "src/components/Linsight/Execution/stepUtils.test.ts": { + "no-restricted-syntax": { + "count": 133 + } + }, "src/components/Linsight/Execution/stepUtils.ts": { "@typescript-eslint/no-explicit-any": { "count": 8 }, "@typescript-eslint/no-unused-vars": { "count": 1 + }, + "no-restricted-syntax": { + "count": 1 } }, "src/components/Linsight/Input/ContextChips.tsx": { @@ -1028,6 +1141,9 @@ }, "no-restricted-imports": { "count": 1 + }, + "no-restricted-syntax": { + "count": 2 } }, "src/components/Nav/MobileNav.tsx": { @@ -1327,6 +1443,9 @@ "no-console": { "count": 2 }, + "no-restricted-syntax": { + "count": 1 + }, "no-useless-escape": { "count": 1 }, @@ -1550,6 +1669,9 @@ "src/components/Voice/TextToSpeechButton.tsx": { "@typescript-eslint/no-explicit-any": { "count": 1 + }, + "no-restricted-syntax": { + "count": 1 } }, "src/components/Voice/textToSpeechStore.tsx": { @@ -1561,6 +1683,9 @@ "@typescript-eslint/no-explicit-any": { "count": 16 }, + "no-restricted-syntax": { + "count": 4 + }, "react-hooks/exhaustive-deps": { "count": 3 } @@ -1598,9 +1723,17 @@ "count": 1 } }, + "src/components/permission/PermissionGrantTab.tsx": { + "no-restricted-syntax": { + "count": 4 + } + }, "src/components/permission/PermissionListTab.tsx": { "@typescript-eslint/no-explicit-any": { "count": 1 + }, + "no-restricted-syntax": { + "count": 4 } }, "src/components/svg/DownIcon.tsx": { @@ -1626,6 +1759,11 @@ "count": 1 } }, + "src/components/ui/Steps.tsx": { + "no-restricted-syntax": { + "count": 2 + } + }, "src/components/ui/TermsAndConditionsModal.tsx": { "jsx-a11y/no-noninteractive-tabindex": { "count": 1 @@ -1743,6 +1881,9 @@ "no-restricted-imports": { "count": 1 }, + "no-restricted-syntax": { + "count": 1 + }, "react-hooks/exhaustive-deps": { "count": 1 } @@ -1843,6 +1984,9 @@ }, "no-restricted-imports": { "count": 1 + }, + "no-restricted-syntax": { + "count": 1 } }, "src/hooks/Input/useAutoSave.ts": { @@ -1928,6 +2072,9 @@ "no-restricted-imports": { "count": 1 }, + "no-restricted-syntax": { + "count": 1 + }, "react-hooks/exhaustive-deps": { "count": 1 } @@ -2024,6 +2171,9 @@ "src/hooks/SSE/useStepHandler.ts": { "no-restricted-imports": { "count": 1 + }, + "no-restricted-syntax": { + "count": 2 } }, "src/hooks/ThemeContext.tsx": { @@ -2051,6 +2201,11 @@ "count": 5 } }, + "src/hooks/Websocket/mock.js": { + "no-restricted-syntax": { + "count": 37 + } + }, "src/hooks/queries/auth/mutations.ts": { "@typescript-eslint/no-unused-vars": { "count": 1 @@ -2105,6 +2260,9 @@ "no-restricted-imports": { "count": 1 }, + "no-restricted-syntax": { + "count": 2 + }, "react-hooks/exhaustive-deps": { "count": 2 } @@ -2115,6 +2273,9 @@ }, "no-console": { "count": 3 + }, + "no-restricted-syntax": { + "count": 3 } }, "src/hooks/useAutoScroll.ts": { @@ -2172,6 +2333,9 @@ "no-restricted-imports": { "count": 1 }, + "no-restricted-syntax": { + "count": 2 + }, "react-hooks/exhaustive-deps": { "count": 2 } @@ -2241,6 +2405,9 @@ "no-restricted-imports": { "count": 1 }, + "no-restricted-syntax": { + "count": 2 + }, "react-hooks/exhaustive-deps": { "count": 2 } @@ -2248,6 +2415,29 @@ "src/layouts/UserPopMenu.tsx": { "no-restricted-imports": { "count": 1 + }, + "no-restricted-syntax": { + "count": 4 + } + }, + "src/locales/i18n.ts": { + "no-restricted-syntax": { + "count": 3 + } + }, + "src/mock/channels.ts": { + "no-restricted-syntax": { + "count": 62 + } + }, + "src/mock/notifications.ts": { + "no-restricted-syntax": { + "count": 24 + } + }, + "src/mock/sources.ts": { + "no-restricted-syntax": { + "count": 18 } }, "src/pages/ChannelSquare.tsx": { @@ -2257,13 +2447,24 @@ "@typescript-eslint/no-unused-vars": { "count": 3 }, + "no-restricted-syntax": { + "count": 7 + }, "react-hooks/exhaustive-deps": { "count": 1 } }, + "src/pages/ChannelSquareCard.tsx": { + "no-restricted-syntax": { + "count": 2 + } + }, "src/pages/DevLogin/index.tsx": { "@typescript-eslint/no-explicit-any": { "count": 1 + }, + "no-restricted-syntax": { + "count": 10 } }, "src/pages/MenuUnavailablePage.tsx": { @@ -2361,6 +2562,9 @@ "src/pages/Subscription/ChannelDiscoveryHome.tsx": { "@typescript-eslint/no-explicit-any": { "count": 6 + }, + "no-restricted-syntax": { + "count": 3 } }, "src/pages/Subscription/ChannelLayout.tsx": { @@ -2383,6 +2587,9 @@ "@typescript-eslint/no-unused-vars": { "count": 3 }, + "no-restricted-syntax": { + "count": 1 + }, "react-hooks/exhaustive-deps": { "count": 1 } @@ -2415,6 +2622,9 @@ "@typescript-eslint/no-unused-vars": { "count": 9 }, + "no-restricted-syntax": { + "count": 1 + }, "react-hooks/exhaustive-deps": { "count": 1 } @@ -2422,11 +2632,22 @@ "src/pages/Subscription/CreateChannel/FilterConditionEditor.tsx": { "@typescript-eslint/no-unused-vars": { "count": 2 + }, + "no-restricted-syntax": { + "count": 1 + } + }, + "src/pages/Subscription/CreateChannel/KnowledgeSyncSection.tsx": { + "no-restricted-syntax": { + "count": 7 } }, "src/pages/Subscription/CreateChannel/SyncSpaceItem.tsx": { "@typescript-eslint/no-unused-vars": { "count": 1 + }, + "no-restricted-syntax": { + "count": 1 } }, "src/pages/Subscription/Sidebar/ChannelSidebar.tsx": { @@ -2439,6 +2660,11 @@ "count": 1 } }, + "src/pages/Subscription/channelUtils.ts": { + "no-restricted-syntax": { + "count": 3 + } + }, "src/pages/Subscription/hooks/useArticleShare.ts": { "react-hooks/exhaustive-deps": { "count": 1 @@ -2492,6 +2718,91 @@ "count": 1 } }, + "src/pages/_gallery/GalleryApp.tsx": { + "no-restricted-syntax": { + "count": 35 + } + }, + "src/pages/_gallery/components/kit.tsx": { + "no-restricted-syntax": { + "count": 2 + } + }, + "src/pages/_gallery/progress/ButtonProgress.tsx": { + "no-restricted-syntax": { + "count": 56 + } + }, + "src/pages/_gallery/progress/ColorProgress.tsx": { + "no-restricted-syntax": { + "count": 35 + } + }, + "src/pages/_gallery/progress/ConfirmProgress.tsx": { + "no-restricted-syntax": { + "count": 83 + } + }, + "src/pages/_gallery/progress/ModalProgress.tsx": { + "no-restricted-syntax": { + "count": 128 + } + }, + "src/pages/_gallery/progress/ProgressOverview.tsx": { + "no-restricted-syntax": { + "count": 100 + } + }, + "src/pages/_gallery/progress/TypographyProgress.tsx": { + "no-restricted-syntax": { + "count": 23 + } + }, + "src/pages/_gallery/sections/ButtonSection.tsx": { + "no-restricted-syntax": { + "count": 89 + } + }, + "src/pages/_gallery/sections/ColorSection.tsx": { + "no-restricted-syntax": { + "count": 102 + } + }, + "src/pages/_gallery/sections/ConfirmDialogSection.tsx": { + "no-restricted-syntax": { + "count": 37 + } + }, + "src/pages/_gallery/sections/FeedbackSection.tsx": { + "no-restricted-syntax": { + "count": 15 + } + }, + "src/pages/_gallery/sections/IllustrationSection.tsx": { + "no-restricted-syntax": { + "count": 29 + } + }, + "src/pages/_gallery/sections/ModalSection.tsx": { + "no-restricted-syntax": { + "count": 43 + } + }, + "src/pages/_gallery/sections/OverviewSection.tsx": { + "no-restricted-syntax": { + "count": 29 + } + }, + "src/pages/_gallery/sections/ResponsiveSection.tsx": { + "no-restricted-syntax": { + "count": 58 + } + }, + "src/pages/_gallery/sections/TypographySection.tsx": { + "no-restricted-syntax": { + "count": 42 + } + }, "src/pages/appChat/AppChatEntry.tsx": { "no-restricted-imports": { "count": 1 @@ -2536,6 +2847,9 @@ }, "no-restricted-imports": { "count": 1 + }, + "no-restricted-syntax": { + "count": 2 } }, "src/pages/appChat/appUtils/skillMethod.ts": { @@ -2546,6 +2860,9 @@ "src/pages/appChat/components/AppInfoCard.tsx": { "@typescript-eslint/no-explicit-any": { "count": 1 + }, + "no-restricted-syntax": { + "count": 3 } }, "src/pages/appChat/components/AppSidebarConvoItem.tsx": { @@ -2554,6 +2871,9 @@ }, "no-restricted-imports": { "count": 1 + }, + "no-restricted-syntax": { + "count": 1 } }, "src/pages/appChat/components/AppSwitcherDropdown.tsx": { @@ -2624,6 +2944,9 @@ }, "@typescript-eslint/no-unused-vars": { "count": 2 + }, + "no-restricted-syntax": { + "count": 1 } }, "src/pages/appChat/components/MessageButtons.tsx": { @@ -2632,6 +2955,14 @@ }, "no-restricted-imports": { "count": 1 + }, + "no-restricted-syntax": { + "count": 3 + } + }, + "src/pages/appChat/components/MessageFile.tsx": { + "no-restricted-syntax": { + "count": 1 } }, "src/pages/appChat/components/MessageNodeRun.tsx": { @@ -2657,6 +2988,9 @@ "no-restricted-imports": { "count": 1 }, + "no-restricted-syntax": { + "count": 1 + }, "react-hooks/exhaustive-deps": { "count": 1 } @@ -2681,6 +3015,9 @@ "src/pages/appChat/hooks/useAppSidebar.ts": { "no-restricted-imports": { "count": 1 + }, + "no-restricted-syntax": { + "count": 4 } }, "src/pages/appChat/index.tsx": { @@ -2702,6 +3039,9 @@ "no-restricted-imports": { "count": 1 }, + "no-restricted-syntax": { + "count": 3 + }, "react-hooks/exhaustive-deps": { "count": 1 }, @@ -2744,6 +3084,9 @@ "no-restricted-imports": { "count": 1 }, + "no-restricted-syntax": { + "count": 1 + }, "react-hooks/exhaustive-deps": { "count": 1 } @@ -2760,6 +3103,9 @@ }, "no-restricted-imports": { "count": 1 + }, + "no-restricted-syntax": { + "count": 1 } }, "src/pages/appChat/useMessages.ts": { @@ -2775,6 +3121,9 @@ "no-restricted-imports": { "count": 1 }, + "no-restricted-syntax": { + "count": 1 + }, "react-hooks/exhaustive-deps": { "count": 3 } @@ -2795,6 +3144,9 @@ "no-restricted-imports": { "count": 1 }, + "no-restricted-syntax": { + "count": 1 + }, "react-hooks/exhaustive-deps": { "count": 2 } @@ -2802,6 +3154,9 @@ "src/pages/apps/components/AgentCard.tsx": { "@typescript-eslint/no-explicit-any": { "count": 1 + }, + "no-restricted-syntax": { + "count": 1 } }, "src/pages/apps/components/AgentGrid.tsx": { @@ -2814,10 +3169,18 @@ "no-restricted-imports": { "count": 1 }, + "no-restricted-syntax": { + "count": 9 + }, "react-hooks/exhaustive-deps": { "count": 3 } }, + "src/pages/apps/components/AgentNavigation.tsx": { + "no-restricted-syntax": { + "count": 2 + } + }, "src/pages/apps/components/MarkLabel.tsx": { "no-restricted-imports": { "count": 1 @@ -2848,6 +3211,9 @@ "src/pages/apps/hooks/useAppCenter.ts": { "no-restricted-imports": { "count": 1 + }, + "no-restricted-syntax": { + "count": 4 } }, "src/pages/apps/index.tsx": { @@ -2871,6 +3237,9 @@ } }, "src/pages/knowledge/FilePreview/RichKnowledgePreview.tsx": { + "no-restricted-syntax": { + "count": 2 + }, "react-hooks/exhaustive-deps": { "count": 1 } @@ -2901,6 +3270,9 @@ "no-console": { "count": 3 }, + "no-restricted-syntax": { + "count": 8 + }, "no-useless-escape": { "count": 4 }, @@ -3015,6 +3387,11 @@ "count": 2 } }, + "src/pages/knowledge/SpaceDetail/RelateDocumentPanel.tsx": { + "no-restricted-syntax": { + "count": 5 + } + }, "src/pages/knowledge/SpaceDetail/SelectionPathBreadcrumb.tsx": { "@typescript-eslint/no-unused-vars": { "count": 2 @@ -3023,6 +3400,9 @@ "src/pages/knowledge/SpaceDetail/SimilarDocumentDialog.tsx": { "@typescript-eslint/no-unused-vars": { "count": 2 + }, + "no-restricted-syntax": { + "count": 5 } }, "src/pages/knowledge/SpaceDetail/VersionManagementDialog.tsx": { @@ -3044,11 +3424,21 @@ "count": 1 } }, + "src/pages/knowledge/hooks/useFileDragDrop.ts": { + "no-restricted-syntax": { + "count": 1 + } + }, "src/pages/knowledge/hooks/useFileManager.ts": { "@typescript-eslint/no-explicit-any": { "count": 3 } }, + "src/pages/knowledge/hooks/useFileUpload.test.ts": { + "no-restricted-syntax": { + "count": 8 + } + }, "src/pages/knowledge/hooks/useFileUpload.ts": { "@typescript-eslint/no-explicit-any": { "count": 8 @@ -3200,6 +3590,11 @@ "count": 1 } }, + "src/routes/ShareAppRedirect.tsx": { + "no-restricted-syntax": { + "count": 2 + } + }, "src/routes/index.tsx": { "@typescript-eslint/ban-ts-comment": { "count": 1 @@ -3235,6 +3630,11 @@ "count": 3 } }, + "src/store/linsight.test.ts": { + "no-restricted-syntax": { + "count": 1 + } + }, "src/store/linsight.ts": { "@typescript-eslint/no-explicit-any": { "count": 19 @@ -3356,6 +3756,9 @@ }, "no-restricted-imports": { "count": 1 + }, + "no-restricted-syntax": { + "count": 4 } }, "src/utils/json.ts": { diff --git a/src/frontend/client/eslint.config.mjs b/src/frontend/client/eslint.config.mjs index 780d0e379..ec9d57eee 100644 --- a/src/frontend/client/eslint.config.mjs +++ b/src/frontend/client/eslint.config.mjs @@ -53,6 +53,14 @@ export default tseslint.config( ], }, ], + // Ledger #28: user-facing copy must go through i18n. Hardcoded Chinese in + // source is frozen in eslint-suppressions.json; new code uses localize(). + 'no-restricted-syntax': [ + 'error', + { selector: 'Literal[value=/[\\u4e00-\\u9fff]/]', message: 'Hardcoded Chinese string — route copy through i18n (useLocalize → localize()). Ledger #28.' }, + { selector: 'TemplateElement[value.raw=/[\\u4e00-\\u9fff]/]', message: 'Hardcoded Chinese in template string — route copy through i18n (useLocalize → localize()). Ledger #28.' }, + { selector: 'JSXText[value=/[\\u4e00-\\u9fff]/]', message: 'Hardcoded Chinese JSX text — route copy through i18n (useLocalize → localize()). Ledger #28.' }, + ], }, }, { diff --git a/src/frontend/packages/ui/eslint.config.mjs b/src/frontend/packages/ui/eslint.config.mjs index e94d81904..4c6472681 100644 --- a/src/frontend/packages/ui/eslint.config.mjs +++ b/src/frontend/packages/ui/eslint.config.mjs @@ -23,6 +23,13 @@ export default tseslint.config( 'no-console': ['error', { allow: ['warn', 'error'] }], // Package contract: presentation-only — no HTTP at all. 'no-restricted-imports': ['error', { paths: [{ name: 'axios', message: '@bisheng/ui is presentation-only; no HTTP allowed (package contract).' }] }], + // Package contract: ALL text comes in via props — no hardcoded copy in any language. + 'no-restricted-syntax': [ + 'error', + { selector: 'Literal[value=/[\\u4e00-\\u9fff]/]', message: 'Hardcoded Chinese string — @bisheng/ui components receive all text via props (package contract).' }, + { selector: 'TemplateElement[value.raw=/[\\u4e00-\\u9fff]/]', message: 'Hardcoded Chinese in template string — @bisheng/ui components receive all text via props (package contract).' }, + { selector: 'JSXText[value=/[\\u4e00-\\u9fff]/]', message: 'Hardcoded Chinese JSX text — @bisheng/ui components receive all text via props (package contract).' }, + ], }, }, { @@ -32,6 +39,8 @@ export default tseslint.config( rules: { '@typescript-eslint/no-require-imports': 'off', 'no-console': 'off', + // Token metadata (usage notes) is internal Chinese documentation, not UI copy. + 'no-restricted-syntax': 'off', }, }, ) diff --git a/src/frontend/platform/eslint-suppressions.json b/src/frontend/platform/eslint-suppressions.json index 31351fa83..e9f915f42 100644 --- a/src/frontend/platform/eslint-suppressions.json +++ b/src/frontend/platform/eslint-suppressions.json @@ -104,6 +104,9 @@ }, "@typescript-eslint/no-unused-expressions": { "count": 2 + }, + "no-restricted-syntax": { + "count": 1 } }, "src/components/VariablesComponent/VarDialog.tsx": { @@ -145,12 +148,18 @@ "src/components/bs-comp/apiComponent/ApiAccess.tsx": { "no-empty-pattern": { "count": 1 + }, + "no-restricted-syntax": { + "count": 5 } }, "src/components/bs-comp/apiComponent/ApiAccessFlow.tsx": { "@typescript-eslint/no-unused-vars": { "count": 10 }, + "no-restricted-syntax": { + "count": 188 + }, "no-useless-escape": { "count": 6 } @@ -158,6 +167,9 @@ "src/components/bs-comp/apiComponent/ApiAccessSkill.tsx": { "no-empty-pattern": { "count": 1 + }, + "no-restricted-syntax": { + "count": 5 } }, "src/components/bs-comp/apiComponent/ChatLink.tsx": { @@ -179,6 +191,9 @@ }, "no-console": { "count": 1 + }, + "no-restricted-syntax": { + "count": 1 } }, "src/components/bs-comp/cardComponent/index.tsx": { @@ -205,6 +220,9 @@ "no-console": { "count": 3 }, + "no-restricted-syntax": { + "count": 6 + }, "react-hooks/exhaustive-deps": { "count": 3 } @@ -215,11 +233,22 @@ }, "@typescript-eslint/no-unused-vars": { "count": 1 + }, + "no-restricted-syntax": { + "count": 7 } }, "src/components/bs-comp/chatComponent/CitationReferencesDrawer.tsx": { "@typescript-eslint/no-explicit-any": { "count": 1 + }, + "no-restricted-syntax": { + "count": 16 + } + }, + "src/components/bs-comp/chatComponent/CitationSourceIcon.tsx": { + "no-restricted-syntax": { + "count": 2 } }, "src/components/bs-comp/chatComponent/FileBs.tsx": { @@ -244,6 +273,9 @@ }, "@typescript-eslint/no-unused-vars": { "count": 5 + }, + "no-restricted-syntax": { + "count": 2 } }, "src/components/bs-comp/chatComponent/MessageButtons.tsx": { @@ -261,13 +293,29 @@ "no-console": { "count": 1 }, + "no-restricted-syntax": { + "count": 1 + }, "react-hooks/exhaustive-deps": { "count": 2 } }, + "src/components/bs-comp/chatComponent/MessageUser.tsx": { + "no-restricted-syntax": { + "count": 1 + } + }, + "src/components/bs-comp/chatComponent/RunLog.tsx": { + "no-restricted-syntax": { + "count": 10 + } + }, "src/components/bs-comp/chatComponent/citationUtils.ts": { "@typescript-eslint/no-explicit-any": { "count": 7 + }, + "no-restricted-syntax": { + "count": 17 } }, "src/components/bs-comp/chatComponent/index.tsx": { @@ -285,11 +333,17 @@ "no-console": { "count": 3 }, + "no-restricted-syntax": { + "count": 1 + }, "prefer-const": { "count": 4 } }, "src/components/bs-comp/department/LazyDepartmentTree.tsx": { + "no-restricted-syntax": { + "count": 3 + }, "react-hooks/exhaustive-deps": { "count": 1 } @@ -303,6 +357,9 @@ "@typescript-eslint/no-explicit-any": { "count": 1 }, + "no-restricted-syntax": { + "count": 2 + }, "react-hooks/exhaustive-deps": { "count": 1 } @@ -311,10 +368,18 @@ "@typescript-eslint/no-explicit-any": { "count": 1 }, + "no-restricted-syntax": { + "count": 2 + }, "react-hooks/exhaustive-deps": { "count": 1 } }, + "src/components/bs-comp/filterTableDataComponent/FilterByUsergroup.tsx": { + "no-restricted-syntax": { + "count": 1 + } + }, "src/components/bs-comp/knowledgeUploadComponent/DropZone.tsx": { "@typescript-eslint/ban-ts-comment": { "count": 1 @@ -330,6 +395,9 @@ "no-console": { "count": 4 }, + "no-restricted-syntax": { + "count": 4 + }, "react-hooks/exhaustive-deps": { "count": 1 } @@ -347,6 +415,9 @@ "no-console": { "count": 3 }, + "no-restricted-syntax": { + "count": 3 + }, "react-hooks/exhaustive-deps": { "count": 2 } @@ -367,7 +438,20 @@ "count": 1 } }, + "src/components/bs-comp/permission/PermissionGrantTab.tsx": { + "no-restricted-syntax": { + "count": 5 + } + }, + "src/components/bs-comp/permission/PermissionListTab.tsx": { + "no-restricted-syntax": { + "count": 4 + } + }, "src/components/bs-comp/permission/usePermissionLevels.ts": { + "no-restricted-syntax": { + "count": 2 + }, "react-hooks/exhaustive-deps": { "count": 3 } @@ -426,6 +510,9 @@ "src/components/bs-comp/sheets/TaggingSheet.tsx": { "no-restricted-imports": { "count": 1 + }, + "no-restricted-syntax": { + "count": 1 } }, "src/components/bs-comp/sheets/ToolsSheet.tsx": { @@ -443,6 +530,9 @@ "@typescript-eslint/no-unused-vars": { "count": 2 }, + "no-restricted-syntax": { + "count": 1 + }, "react-hooks/exhaustive-deps": { "count": 1 } @@ -710,6 +800,9 @@ "no-console": { "count": 4 }, + "no-restricted-syntax": { + "count": 3 + }, "react-hooks/exhaustive-deps": { "count": 2 } @@ -750,6 +843,9 @@ "@typescript-eslint/no-unused-vars": { "count": 7 }, + "no-restricted-syntax": { + "count": 6 + }, "react-hooks/exhaustive-deps": { "count": 1 } @@ -762,6 +858,9 @@ "src/components/bs-ui/multiSelect.tsx/Example.tsx": { "no-console": { "count": 2 + }, + "no-restricted-syntax": { + "count": 9 } }, "src/components/bs-ui/multiSelect.tsx/index.tsx": { @@ -781,6 +880,9 @@ }, "@typescript-eslint/no-unused-vars": { "count": 1 + }, + "no-restricted-syntax": { + "count": 2 } }, "src/components/bs-ui/select/filter.tsx": { @@ -801,6 +903,11 @@ "count": 1 } }, + "src/components/bs-ui/step/index.tsx": { + "no-restricted-syntax": { + "count": 2 + } + }, "src/components/bs-ui/toast/use-toast.tsx": { "@typescript-eslint/no-unused-vars": { "count": 1 @@ -879,6 +986,9 @@ "no-console": { "count": 2 }, + "no-restricted-syntax": { + "count": 4 + }, "react-hooks/exhaustive-deps": { "count": 1 } @@ -914,6 +1024,9 @@ "src/components/voiceFunction/audioPlayButton.tsx": { "no-console": { "count": 4 + }, + "no-restricted-syntax": { + "count": 5 } }, "src/components/voiceFunction/speechToText.tsx": { @@ -923,6 +1036,9 @@ "no-console": { "count": 1 }, + "no-restricted-syntax": { + "count": 6 + }, "react-hooks/exhaustive-deps": { "count": 1 } @@ -933,6 +1049,9 @@ }, "no-empty": { "count": 1 + }, + "no-restricted-syntax": { + "count": 14 } }, "src/contexts/SSEContext.tsx": { @@ -976,6 +1095,9 @@ }, "no-console": { "count": 1 + }, + "no-restricted-syntax": { + "count": 1 } }, "src/contexts/typesContext.tsx": { @@ -1058,6 +1180,9 @@ }, "no-console": { "count": 6 + }, + "no-restricted-syntax": { + "count": 20 } }, "src/controllers/API/license.ts": { @@ -1106,14 +1231,23 @@ "src/controllers/API/user.ts": { "@typescript-eslint/no-explicit-any": { "count": 17 + }, + "no-restricted-syntax": { + "count": 2 } }, "src/controllers/API/workflow.ts": { "@typescript-eslint/no-explicit-any": { "count": 10 + }, + "no-restricted-syntax": { + "count": 24 } }, "src/controllers/hooks/knowledge.ts": { + "no-restricted-syntax": { + "count": 1 + }, "react-hooks/exhaustive-deps": { "count": 1 } @@ -1127,9 +1261,15 @@ }, "no-console": { "count": 1 + }, + "no-restricted-syntax": { + "count": 4 } }, "src/i18n.js": { + "no-restricted-syntax": { + "count": 3 + }, "no-undef": { "count": 1 } @@ -1275,6 +1415,9 @@ "@typescript-eslint/no-unused-vars": { "count": 2 }, + "no-restricted-syntax": { + "count": 3 + }, "react-hooks/exhaustive-deps": { "count": 1 } @@ -1285,6 +1428,9 @@ }, "@typescript-eslint/no-unused-vars": { "count": 6 + }, + "no-restricted-syntax": { + "count": 1 } }, "src/modals/L2ParamsModal/index.tsx": { @@ -1328,6 +1474,9 @@ }, "no-console": { "count": 1 + }, + "no-restricted-syntax": { + "count": 1 } }, "src/modals/formModal/chatMessage/codeBlock/index.tsx": { @@ -1375,6 +1524,9 @@ "@typescript-eslint/no-explicit-any": { "count": 24 }, + "no-restricted-syntax": { + "count": 35 + }, "react-hooks/exhaustive-deps": { "count": 3 } @@ -1414,6 +1566,9 @@ "@typescript-eslint/no-unused-vars": { "count": 4 }, + "no-restricted-syntax": { + "count": 1 + }, "react-hooks/rules-of-hooks": { "count": 16 } @@ -1499,6 +1654,14 @@ "src/pages/BuildPage/bench/ConfigInheritanceBanner.tsx": { "@typescript-eslint/no-explicit-any": { "count": 6 + }, + "no-restricted-syntax": { + "count": 3 + } + }, + "src/pages/BuildPage/bench/DepartmentKnowledgeSpaceManagerDialog.tsx": { + "no-restricted-syntax": { + "count": 16 } }, "src/pages/BuildPage/bench/DialogueWork.tsx": { @@ -1514,13 +1677,24 @@ "src/pages/BuildPage/bench/KnowledgeSpace.tsx": { "@typescript-eslint/no-explicit-any": { "count": 1 + }, + "no-restricted-syntax": { + "count": 7 } }, "src/pages/BuildPage/bench/KnowledgeSpaceSensitivePolicy.tsx": { + "no-restricted-syntax": { + "count": 5 + }, "react-hooks/exhaustive-deps": { "count": 1 } }, + "src/pages/BuildPage/bench/KnowledgeSpaceTagLibrarySection.tsx": { + "no-restricted-syntax": { + "count": 24 + } + }, "src/pages/BuildPage/bench/ModelManagement.tsx": { "@typescript-eslint/no-unused-vars": { "count": 3 @@ -1533,6 +1707,9 @@ "no-restricted-imports": { "count": 1 }, + "no-restricted-syntax": { + "count": 6 + }, "react-hooks/exhaustive-deps": { "count": 1 } @@ -1546,6 +1723,9 @@ }, "no-restricted-imports": { "count": 1 + }, + "no-restricted-syntax": { + "count": 15 } }, "src/pages/BuildPage/bench/Subscribe.tsx": { @@ -1554,9 +1734,15 @@ }, "@typescript-eslint/no-unused-vars": { "count": 4 + }, + "no-restricted-syntax": { + "count": 4 } }, "src/pages/BuildPage/bench/SubscriptionSensitivePolicy.tsx": { + "no-restricted-syntax": { + "count": 5 + }, "react-hooks/exhaustive-deps": { "count": 1 } @@ -1616,6 +1802,9 @@ "no-console": { "count": 3 }, + "no-restricted-syntax": { + "count": 5 + }, "react-hooks/exhaustive-deps": { "count": 4 } @@ -1661,6 +1850,9 @@ "src/pages/BuildPage/flow/FlowChat/InputForm.tsx": { "@typescript-eslint/no-unused-vars": { "count": 1 + }, + "no-restricted-syntax": { + "count": 1 } }, "src/pages/BuildPage/flow/FlowChat/MessageBs.tsx": { @@ -1683,10 +1875,18 @@ "@typescript-eslint/no-unused-vars": { "count": 4 }, + "no-restricted-syntax": { + "count": 7 + }, "no-useless-escape": { "count": 2 } }, + "src/pages/BuildPage/flow/FlowChat/MessageUser.tsx": { + "no-restricted-syntax": { + "count": 1 + } + }, "src/pages/BuildPage/flow/FlowChat/messageStore.ts": { "@typescript-eslint/no-explicit-any": { "count": 9 @@ -1697,6 +1897,9 @@ "no-console": { "count": 3 }, + "no-restricted-syntax": { + "count": 2 + }, "prefer-const": { "count": 5 } @@ -1930,6 +2133,9 @@ "@typescript-eslint/no-unused-vars": { "count": 2 }, + "no-restricted-syntax": { + "count": 2 + }, "react-hooks/exhaustive-deps": { "count": 1 } @@ -2023,6 +2229,9 @@ "@typescript-eslint/no-unused-vars": { "count": 4 }, + "no-restricted-syntax": { + "count": 3 + }, "react-hooks/exhaustive-deps": { "count": 5 } @@ -2053,6 +2262,9 @@ "no-console": { "count": 2 }, + "no-restricted-syntax": { + "count": 2 + }, "react-hooks/exhaustive-deps": { "count": 5 } @@ -2070,6 +2282,9 @@ "no-restricted-imports": { "count": 1 }, + "no-restricted-syntax": { + "count": 3 + }, "react-hooks/exhaustive-deps": { "count": 2 } @@ -2156,6 +2371,9 @@ "@typescript-eslint/no-unused-vars": { "count": 1 }, + "no-restricted-syntax": { + "count": 5 + }, "react-hooks/exhaustive-deps": { "count": 3 } @@ -2173,6 +2391,11 @@ "count": 1 } }, + "src/pages/BuildPage/skills/editSkill/extraSidebarComponent/PersonalComponents.tsx": { + "no-restricted-syntax": { + "count": 5 + } + }, "src/pages/BuildPage/skills/editSkill/extraSidebarComponent/index.tsx": { "@typescript-eslint/no-explicit-any": { "count": 1 @@ -2198,6 +2421,9 @@ }, "no-case-declarations": { "count": 1 + }, + "no-restricted-syntax": { + "count": 6 } }, "src/pages/BuildPage/skills/editSkill/skillPage.tsx": { @@ -2249,6 +2475,9 @@ }, "no-console": { "count": 1 + }, + "no-restricted-syntax": { + "count": 8 } }, "src/pages/BuildPage/tools/builtInTool/Dalle3.tsx": { @@ -2256,6 +2485,11 @@ "count": 1 } }, + "src/pages/BuildPage/tools/builtInTool/EmailConfig.tsx": { + "no-restricted-syntax": { + "count": 4 + } + }, "src/pages/BuildPage/tools/builtInTool/FinancialData.tsx": { "@typescript-eslint/no-unused-vars": { "count": 1 @@ -2281,6 +2515,9 @@ "no-empty": { "count": 1 }, + "no-restricted-syntax": { + "count": 1 + }, "react-hooks/exhaustive-deps": { "count": 1 } @@ -2295,6 +2532,9 @@ "@typescript-eslint/no-unused-vars": { "count": 1 }, + "no-restricted-syntax": { + "count": 8 + }, "react-hooks/exhaustive-deps": { "count": 1 } @@ -2306,6 +2546,9 @@ "@typescript-eslint/no-unused-vars": { "count": 2 }, + "no-restricted-syntax": { + "count": 1 + }, "react-hooks/rules-of-hooks": { "count": 2 } @@ -2314,6 +2557,9 @@ "@typescript-eslint/no-explicit-any": { "count": 1 }, + "no-restricted-syntax": { + "count": 1 + }, "react-hooks/exhaustive-deps": { "count": 1 }, @@ -2325,6 +2571,9 @@ "@typescript-eslint/no-explicit-any": { "count": 1 }, + "no-restricted-syntax": { + "count": 1 + }, "react-hooks/exhaustive-deps": { "count": 1 } @@ -2366,13 +2615,24 @@ "no-console": { "count": 1 }, + "no-restricted-syntax": { + "count": 2 + }, "no-useless-escape": { "count": 1 } }, + "src/pages/ChatAppPage/components/ForcePrompt.tsx": { + "no-restricted-syntax": { + "count": 1 + } + }, "src/pages/ChatAppPage/components/MarkLabel.tsx": { "no-restricted-imports": { "count": 1 + }, + "no-restricted-syntax": { + "count": 1 } }, "src/pages/ChatAppPage/components/ResouceModal.tsx": { @@ -2385,6 +2645,9 @@ "@typescript-eslint/no-unused-vars": { "count": 1 }, + "no-restricted-syntax": { + "count": 4 + }, "react-hooks/exhaustive-deps": { "count": 5 } @@ -2395,11 +2658,17 @@ }, "@typescript-eslint/no-unused-vars": { "count": 2 + }, + "no-restricted-syntax": { + "count": 1 } }, "src/pages/Dashboard/colorSchemes.ts": { "@typescript-eslint/no-unused-vars": { "count": 1 + }, + "no-restricted-syntax": { + "count": 57 } }, "src/pages/Dashboard/components/AdvancedDatePicker.tsx": { @@ -2441,6 +2710,9 @@ "no-console": { "count": 3 }, + "no-restricted-syntax": { + "count": 1 + }, "react-hooks/exhaustive-deps": { "count": 1 } @@ -2457,6 +2729,9 @@ }, "no-restricted-imports": { "count": 1 + }, + "no-restricted-syntax": { + "count": 12 } }, "src/pages/Dashboard/components/config/ComponentConfigDrawer.tsx": { @@ -2472,6 +2747,9 @@ "no-console": { "count": 2 }, + "no-restricted-syntax": { + "count": 5 + }, "react-hooks/exhaustive-deps": { "count": 5 } @@ -2501,6 +2779,9 @@ }, "no-console": { "count": 2 + }, + "no-restricted-syntax": { + "count": 2 } }, "src/pages/Dashboard/components/config/FilterConditionDialog.tsx": { @@ -2510,6 +2791,9 @@ "no-console": { "count": 2 }, + "no-restricted-syntax": { + "count": 3 + }, "react-hooks/exhaustive-deps": { "count": 5 } @@ -2535,6 +2819,9 @@ "no-console": { "count": 7 }, + "no-restricted-syntax": { + "count": 17 + }, "react-hooks/exhaustive-deps": { "count": 4 } @@ -2678,6 +2965,9 @@ "src/pages/DepartmentPage/components/DepartmentSettings.tsx": { "@typescript-eslint/no-unused-vars": { "count": 1 + }, + "no-restricted-syntax": { + "count": 8 } }, "src/pages/DepartmentPage/components/DepartmentTrafficControl.tsx": { @@ -2685,6 +2975,26 @@ "count": 3 } }, + "src/pages/DepartmentPage/components/DepartmentTree.tsx": { + "no-restricted-syntax": { + "count": 3 + } + }, + "src/pages/DepartmentPage/components/MemberTable.tsx": { + "no-restricted-syntax": { + "count": 1 + } + }, + "src/pages/DepartmentPage/components/MountTenantDialog.tsx": { + "no-restricted-syntax": { + "count": 16 + } + }, + "src/pages/DepartmentPage/index.tsx": { + "no-restricted-syntax": { + "count": 2 + } + }, "src/pages/DiffFlowPage/components/Cell.tsx": { "@typescript-eslint/no-unused-expressions": { "count": 1 @@ -2703,6 +3013,11 @@ "count": 3 } }, + "src/pages/DiffFlowPage/components/RunForm.tsx": { + "no-restricted-syntax": { + "count": 4 + } + }, "src/pages/DiffFlowPage/components/RunTest.tsx": { "@typescript-eslint/no-explicit-any": { "count": 2 @@ -2715,6 +3030,9 @@ }, "no-empty": { "count": 1 + }, + "no-restricted-syntax": { + "count": 2 } }, "src/pages/DiffFlowPage/index.tsx": { @@ -2778,10 +3096,18 @@ "count": 2 } }, + "src/pages/KnowledgePage/components/AddKnowledgeFileMenu.tsx": { + "no-restricted-syntax": { + "count": 2 + } + }, "src/pages/KnowledgePage/components/DocxFileViewer.tsx": { "@typescript-eslint/no-explicit-any": { "count": 1 }, + "no-restricted-syntax": { + "count": 2 + }, "no-useless-escape": { "count": 1 }, @@ -2789,6 +3115,11 @@ "count": 1 } }, + "src/pages/KnowledgePage/components/DuplicateFileDialog.test.tsx": { + "no-restricted-syntax": { + "count": 7 + } + }, "src/pages/KnowledgePage/components/ExcelPreview.tsx": { "@typescript-eslint/no-explicit-any": { "count": 4 @@ -2802,6 +3133,9 @@ "no-restricted-imports": { "count": 2 }, + "no-restricted-syntax": { + "count": 8 + }, "no-useless-escape": { "count": 4 }, @@ -2835,11 +3169,17 @@ }, "no-console": { "count": 1 + }, + "no-restricted-syntax": { + "count": 1 } }, "src/pages/KnowledgePage/components/FileUploadSplitStrategy.tsx": { "no-restricted-imports": { "count": 1 + }, + "no-restricted-syntax": { + "count": 4 } }, "src/pages/KnowledgePage/components/FileUploadStep1.tsx": { @@ -2856,6 +3196,9 @@ }, "@typescript-eslint/no-unused-expressions": { "count": 1 + }, + "no-restricted-syntax": { + "count": 3 } }, "src/pages/KnowledgePage/components/FileUploadStep4.tsx": { @@ -2864,6 +3207,9 @@ }, "no-console": { "count": 5 + }, + "no-restricted-syntax": { + "count": 10 } }, "src/pages/KnowledgePage/components/Files.tsx": { @@ -2873,6 +3219,9 @@ "@typescript-eslint/no-unused-vars": { "count": 7 }, + "no-restricted-syntax": { + "count": 1 + }, "react-hooks/exhaustive-deps": { "count": 1 } @@ -2924,6 +3273,9 @@ }, "@typescript-eslint/no-unused-vars": { "count": 3 + }, + "no-restricted-syntax": { + "count": 3 } }, "src/pages/KnowledgePage/components/ParagraphEdit.tsx": { @@ -2939,6 +3291,9 @@ "no-console": { "count": 1 }, + "no-restricted-syntax": { + "count": 3 + }, "no-useless-escape": { "count": 1 }, @@ -2967,6 +3322,9 @@ "@typescript-eslint/no-unused-vars": { "count": 3 }, + "no-restricted-syntax": { + "count": 3 + }, "no-useless-escape": { "count": 1 }, @@ -2981,6 +3339,9 @@ "no-console": { "count": 1 }, + "no-restricted-syntax": { + "count": 1 + }, "react-hooks/exhaustive-deps": { "count": 5 } @@ -2995,6 +3356,9 @@ "@typescript-eslint/no-unused-vars": { "count": 3 }, + "no-restricted-syntax": { + "count": 1 + }, "prefer-const": { "count": 1 }, @@ -3005,6 +3369,9 @@ "src/pages/KnowledgePage/components/RichPreviewFile.tsx": { "@typescript-eslint/no-explicit-any": { "count": 2 + }, + "no-restricted-syntax": { + "count": 8 } }, "src/pages/KnowledgePage/components/RuleFile.tsx": { @@ -3013,6 +3380,9 @@ }, "@typescript-eslint/no-unused-vars": { "count": 3 + }, + "no-restricted-syntax": { + "count": 1 } }, "src/pages/KnowledgePage/components/RuleTable.tsx": { @@ -3040,9 +3410,15 @@ }, "@typescript-eslint/no-unused-vars": { "count": 1 + }, + "no-restricted-syntax": { + "count": 17 } }, "src/pages/KnowledgePage/components/tags/KnowledgeTagSelect.tsx": { + "no-restricted-syntax": { + "count": 6 + }, "react-hooks/exhaustive-deps": { "count": 1 } @@ -3131,10 +3507,18 @@ "@typescript-eslint/no-unused-vars": { "count": 1 }, + "no-restricted-syntax": { + "count": 2 + }, "react-hooks/exhaustive-deps": { "count": 1 } }, + "src/pages/LogPage/useAppLog/DailyMessageContent.tsx": { + "no-restricted-syntax": { + "count": 1 + } + }, "src/pages/LogPage/useAppLog/appChatDetail.tsx": { "@typescript-eslint/no-unused-expressions": { "count": 3 @@ -3171,6 +3555,9 @@ "src/pages/LoginPage/TenantSelect.tsx": { "@typescript-eslint/ban-ts-comment": { "count": 1 + }, + "no-restricted-syntax": { + "count": 4 } }, "src/pages/LoginPage/UserPwdModal.tsx": { @@ -3213,6 +3600,9 @@ "no-console": { "count": 1 }, + "no-restricted-syntax": { + "count": 1 + }, "react-hooks/exhaustive-deps": { "count": 1 } @@ -3222,6 +3612,11 @@ "count": 1 } }, + "src/pages/MenuPermissionPlaceholder.tsx": { + "no-restricted-syntax": { + "count": 12 + } + }, "src/pages/ModelPage/components/Combobox.tsx": { "@typescript-eslint/no-explicit-any": { "count": 1 @@ -3243,6 +3638,9 @@ }, "no-console": { "count": 1 + }, + "no-restricted-syntax": { + "count": 1 } }, "src/pages/ModelPage/components/FinetuneHead.tsx": { @@ -3277,6 +3675,11 @@ "count": 1 } }, + "src/pages/ModelPage/components/sampleData.js": { + "no-restricted-syntax": { + "count": 21 + } + }, "src/pages/ModelPage/cpuInfo.tsx": { "@typescript-eslint/no-unused-expressions": { "count": 1 @@ -3305,6 +3708,9 @@ "@typescript-eslint/no-unused-vars": { "count": 1 }, + "no-restricted-syntax": { + "count": 10 + }, "react-hooks/exhaustive-deps": { "count": 1 } @@ -3316,6 +3722,9 @@ "@typescript-eslint/no-unused-vars": { "count": 8 }, + "no-restricted-syntax": { + "count": 8 + }, "react-hooks/exhaustive-deps": { "count": 2 } @@ -3323,6 +3732,9 @@ "src/pages/ModelPage/manage/ScopeBar.tsx": { "no-restricted-imports": { "count": 1 + }, + "no-restricted-syntax": { + "count": 9 } }, "src/pages/ModelPage/manage/SystemConfigBanners.tsx": { @@ -3342,6 +3754,9 @@ "no-restricted-imports": { "count": 1 }, + "no-restricted-syntax": { + "count": 1 + }, "react-hooks/exhaustive-deps": { "count": 1 } @@ -3377,6 +3792,9 @@ }, "@typescript-eslint/no-unused-vars": { "count": 3 + }, + "no-restricted-syntax": { + "count": 5 } }, "src/pages/ModelPage/manage/tabs/WorkbenchModel.tsx": { @@ -3392,6 +3810,9 @@ "no-restricted-imports": { "count": 1 }, + "no-restricted-syntax": { + "count": 4 + }, "react-hooks/exhaustive-deps": { "count": 1 } @@ -3409,6 +3830,11 @@ "count": 1 } }, + "src/pages/Page403.tsx": { + "no-restricted-syntax": { + "count": 3 + } + }, "src/pages/Page404.tsx": { "@typescript-eslint/no-unused-vars": { "count": 2 @@ -3432,6 +3858,11 @@ "count": 1 } }, + "src/pages/SystemPage/components/Departments.tsx": { + "no-restricted-syntax": { + "count": 2 + } + }, "src/pages/SystemPage/components/EditRole.tsx": { "@typescript-eslint/no-explicit-any": { "count": 34 @@ -3465,6 +3896,11 @@ "count": 1 } }, + "src/pages/SystemPage/components/RolesAndPermissions.tsx": { + "no-restricted-syntax": { + "count": 25 + } + }, "src/pages/SystemPage/components/UserGroup.tsx": { "@typescript-eslint/no-explicit-any": { "count": 1 @@ -3501,6 +3937,9 @@ } }, "src/pages/SystemPage/index.tsx": { + "no-restricted-syntax": { + "count": 1 + }, "react-hooks/rules-of-hooks": { "count": 2 } @@ -3520,6 +3959,11 @@ "count": 1 } }, + "src/pages/SystemPage/theme/brandTypes.ts": { + "no-restricted-syntax": { + "count": 1 + } + }, "src/pages/SystemPage/theme/index.tsx": { "@typescript-eslint/no-unused-vars": { "count": 1 @@ -3531,6 +3975,9 @@ }, "@typescript-eslint/no-unused-vars": { "count": 1 + }, + "no-restricted-syntax": { + "count": 3 } }, "src/pages/TenantPage/components/TenantQuotaDialog.tsx": { @@ -3541,6 +3988,9 @@ "src/pages/TenantPage/components/TenantUserDialog.tsx": { "@typescript-eslint/no-explicit-any": { "count": 3 + }, + "no-restricted-syntax": { + "count": 5 } }, "src/pages/TenantPage/index.tsx": { @@ -3594,11 +4044,22 @@ "src/test/approvalPage.test.tsx": { "@typescript-eslint/no-explicit-any": { "count": 20 + }, + "no-restricted-syntax": { + "count": 51 + } + }, + "src/test/assistantChatErrorMessage.test.ts": { + "no-restricted-syntax": { + "count": 8 } }, "src/test/departmentKnowledgeSpaceDialogs.test.tsx": { "@typescript-eslint/no-explicit-any": { "count": 3 + }, + "no-restricted-syntax": { + "count": 21 } }, "src/test/departmentPageRefresh.test.tsx": { @@ -3617,6 +4078,9 @@ "src/test/departmentUsersSelectScope.test.tsx": { "@typescript-eslint/no-explicit-any": { "count": 3 + }, + "no-restricted-syntax": { + "count": 2 } }, "src/test/headerMenuChildAdmin.test.tsx": { @@ -3630,16 +4094,25 @@ }, "@typescript-eslint/no-unused-vars": { "count": 1 + }, + "no-restricted-syntax": { + "count": 3 } }, "src/test/knowledgeSpaceGrantSubjects.test.tsx": { "@typescript-eslint/no-explicit-any": { "count": 18 + }, + "no-restricted-syntax": { + "count": 26 } }, "src/test/mainLayoutSystemNavChildAdmin.test.tsx": { "@typescript-eslint/no-explicit-any": { "count": 4 + }, + "no-restricted-syntax": { + "count": 2 } }, "src/test/mainLayoutWorkspaceMenu.test.tsx": { @@ -3655,16 +4128,25 @@ "src/test/permissionGrantTab.test.tsx": { "@typescript-eslint/no-explicit-any": { "count": 7 + }, + "no-restricted-syntax": { + "count": 12 } }, "src/test/permissionListTab.test.tsx": { "@typescript-eslint/no-explicit-any": { "count": 20 + }, + "no-restricted-syntax": { + "count": 2 } }, "src/test/permissionRegressions.test.tsx": { "@typescript-eslint/no-explicit-any": { "count": 36 + }, + "no-restricted-syntax": { + "count": 95 } }, "src/test/resolveRoutePermissions.test.ts": { @@ -3680,6 +4162,9 @@ "src/test/subjectSearchUser.test.tsx": { "@typescript-eslint/no-explicit-any": { "count": 12 + }, + "no-restricted-syntax": { + "count": 3 } }, "src/test/systemDepartmentsArchivedDelete.test.tsx": { @@ -3778,6 +4263,11 @@ "count": 17 } }, + "src/util/flowCompatible.ts": { + "no-restricted-syntax": { + "count": 1 + } + }, "src/util/flowUtils.ts": { "@typescript-eslint/no-unused-expressions": { "count": 1 @@ -3785,6 +4275,9 @@ "no-console": { "count": 1 }, + "no-restricted-syntax": { + "count": 4 + }, "no-useless-escape": { "count": 6 }, @@ -3805,6 +4298,9 @@ "no-console": { "count": 4 }, + "no-restricted-syntax": { + "count": 1 + }, "react-hooks/exhaustive-deps": { "count": 7 } @@ -3852,6 +4348,9 @@ }, "no-prototype-builtins": { "count": 4 + }, + "no-restricted-syntax": { + "count": 20 } }, "src/workspace/markdown/Echarts.tsx": { @@ -3863,6 +4362,9 @@ }, "no-console": { "count": 1 + }, + "no-restricted-syntax": { + "count": 4 } }, "src/workspace/markdown/Mermaid.tsx": { @@ -3875,6 +4377,9 @@ "no-constant-binary-expression": { "count": 1 }, + "no-restricted-syntax": { + "count": 5 + }, "react-hooks/exhaustive-deps": { "count": 1 } diff --git a/src/frontend/platform/eslint.config.mjs b/src/frontend/platform/eslint.config.mjs index 412691ebf..6d36b85ce 100644 --- a/src/frontend/platform/eslint.config.mjs +++ b/src/frontend/platform/eslint.config.mjs @@ -53,6 +53,14 @@ export default tseslint.config( ], }, ], + // Ledger #28: user-facing copy must go through i18n. Hardcoded Chinese in + // source is frozen in eslint-suppressions.json; new code uses t(). + 'no-restricted-syntax': [ + 'error', + { selector: 'Literal[value=/[\\u4e00-\\u9fff]/]', message: 'Hardcoded Chinese string — route copy through i18n (useTranslation → t()). Ledger #28.' }, + { selector: 'TemplateElement[value.raw=/[\\u4e00-\\u9fff]/]', message: 'Hardcoded Chinese in template string — route copy through i18n (useTranslation → t()). Ledger #28.' }, + { selector: 'JSXText[value=/[\\u4e00-\\u9fff]/]', message: 'Hardcoded Chinese JSX text — route copy through i18n (useTranslation → t()). Ledger #28.' }, + ], }, }, {