diff --git a/frontend/eslint.config.js b/frontend/eslint.config.js index 1b66c511..27a23fbc 100644 --- a/frontend/eslint.config.js +++ b/frontend/eslint.config.js @@ -6,26 +6,6 @@ import globals from 'globals'; export default [ { ignores: ['node_modules/**', '../web/dist/**'] }, js.configs.recommended, - { - files: ['**/*.js'], - languageOptions: { - ecmaVersion: 2022, - sourceType: 'module', - globals: { - ...globals.browser, - ...globals.node, - }, - }, - rules: { - 'no-unused-vars': ['warn', { - argsIgnorePattern: '^_', - varsIgnorePattern: '^_', - caughtErrorsIgnorePattern: '^_', - }], - 'no-empty': ['error', { allowEmptyCatch: true }], - 'no-case-declarations': 'off', - }, - }, ...tseslint.configs.recommended.map((config) => ({ ...config, files: ['**/*.{ts,tsx}'], @@ -50,16 +30,6 @@ export default [ caughtErrorsIgnorePattern: '^_', }], 'no-empty': ['error', { allowEmptyCatch: true }], - - // react-hooks v7 introduces several new rules driven by the React - // Compiler. The migration uses several legitimate patterns those - // rules flag (initial-fetch in useEffect, dirty-check derived - // state, `Date.now()` inside derive helpers, inline arrow event - // handlers, in-place mutation of imported Outbound class - // instances in the OutboundFormModal). We're not running the - // compiler, so the memoization-preservation warnings have no - // effect on runtime — turning them off until the codebase - // stabilises. 'react-hooks/set-state-in-effect': 'off', 'react-hooks/purity': 'off', 'react-hooks/react-compiler': 'off', diff --git a/frontend/src/components/FinalMaskForm.tsx b/frontend/src/components/FinalMaskForm.tsx index 07039cca..e55c5a17 100644 --- a/frontend/src/components/FinalMaskForm.tsx +++ b/frontend/src/components/FinalMaskForm.tsx @@ -3,7 +3,7 @@ import { Button, Divider, Form, Input, InputNumber, Select, Switch } from 'antd' import { DeleteOutlined, PlusOutlined, ReloadOutlined } from '@ant-design/icons'; import { RandomUtil } from '@/utils'; -import { Protocols } from '@/models/outbound.js'; +import { Protocols } from '@/models/outbound'; interface StreamShape { network?: string; diff --git a/frontend/src/pages/inbounds/InboundFormModal.tsx b/frontend/src/pages/inbounds/InboundFormModal.tsx index 06375465..2d29df6b 100644 --- a/frontend/src/pages/inbounds/InboundFormModal.tsx +++ b/frontend/src/pages/inbounds/InboundFormModal.tsx @@ -55,7 +55,7 @@ import { DOMAIN_STRATEGY_OPTION, TCP_CONGESTION_OPTION, MODE_OPTION, -} from '@/models/inbound.js'; +} from '@/models/inbound'; import { DBInbound } from '@/models/dbinbound'; import FinalMaskForm from '@/components/FinalMaskForm'; import DateTimePicker from '@/components/DateTimePicker'; diff --git a/frontend/src/pages/inbounds/InboundInfoModal.tsx b/frontend/src/pages/inbounds/InboundInfoModal.tsx index f8d8f059..6f3a0599 100644 --- a/frontend/src/pages/inbounds/InboundInfoModal.tsx +++ b/frontend/src/pages/inbounds/InboundInfoModal.tsx @@ -12,7 +12,7 @@ import { ClipboardManager, FileManager, } from '@/utils'; -import { Protocols } from '@/models/inbound.js'; +import { Protocols } from '@/models/inbound'; import InfinityIcon from '@/components/InfinityIcon'; import { useDatepicker } from '@/hooks/useDatepicker'; import type { SubSettings } from './useInbounds'; diff --git a/frontend/src/pages/inbounds/InboundsPage.tsx b/frontend/src/pages/inbounds/InboundsPage.tsx index fc4f0ab5..90f478f5 100644 --- a/frontend/src/pages/inbounds/InboundsPage.tsx +++ b/frontend/src/pages/inbounds/InboundsPage.tsx @@ -20,7 +20,7 @@ import { } from '@ant-design/icons'; import { HttpUtil, SizeFormatter, RandomUtil } from '@/utils'; -import { Inbound } from '@/models/inbound.js'; +import { Inbound } from '@/models/inbound'; import { coerceInboundJsonField } from '@/models/dbinbound'; import { useTheme } from '@/hooks/useTheme'; import { useMediaQuery } from '@/hooks/useMediaQuery'; diff --git a/frontend/src/pages/inbounds/QrCodeModal.tsx b/frontend/src/pages/inbounds/QrCodeModal.tsx index f4fae390..720944e5 100644 --- a/frontend/src/pages/inbounds/QrCodeModal.tsx +++ b/frontend/src/pages/inbounds/QrCodeModal.tsx @@ -3,7 +3,7 @@ import { useTranslation } from 'react-i18next'; import { Collapse, Modal } from 'antd'; import type { CollapseProps } from 'antd'; -import { Protocols } from '@/models/inbound.js'; +import { Protocols } from '@/models/inbound'; import QrPanel from './QrPanel'; import type { SubSettings } from './useInbounds'; diff --git a/frontend/src/pages/inbounds/useInbounds.ts b/frontend/src/pages/inbounds/useInbounds.ts index 1bcdda01..37e18088 100644 --- a/frontend/src/pages/inbounds/useInbounds.ts +++ b/frontend/src/pages/inbounds/useInbounds.ts @@ -3,7 +3,7 @@ import { useQuery, useQueryClient } from '@tanstack/react-query'; import { HttpUtil } from '@/utils'; import { DBInbound } from '@/models/dbinbound'; -import { Protocols } from '@/models/inbound.js'; +import { Protocols } from '@/models/inbound'; import { setDatepicker } from '@/hooks/useDatepicker'; import { keys } from '@/api/queryKeys'; diff --git a/frontend/src/pages/xray/BasicsTab.tsx b/frontend/src/pages/xray/BasicsTab.tsx index 7acd84d7..e8808145 100644 --- a/frontend/src/pages/xray/BasicsTab.tsx +++ b/frontend/src/pages/xray/BasicsTab.tsx @@ -3,7 +3,7 @@ import { useTranslation } from 'react-i18next'; import { Alert, Button, Collapse, Input, Modal, Select, Space, Switch } from 'antd'; import { ExclamationCircleFilled, CloudOutlined, ApiOutlined } from '@ant-design/icons'; -import { OutboundDomainStrategies } from '@/models/outbound.js'; +import { OutboundDomainStrategies } from '@/models/outbound'; import SettingListItem from '@/components/SettingListItem'; import type { XraySettingsValue, SetTemplate } from '@/hooks/useXraySetting'; import './BasicsTab.css'; diff --git a/frontend/src/pages/xray/OutboundFormModal.tsx b/frontend/src/pages/xray/OutboundFormModal.tsx index 6ffb1703..0a4c5d56 100644 --- a/frontend/src/pages/xray/OutboundFormModal.tsx +++ b/frontend/src/pages/xray/OutboundFormModal.tsx @@ -32,7 +32,7 @@ import { Address_Port_Strategy, MODE_OPTION, DNSRuleActions, -} from '@/models/outbound.js'; +} from '@/models/outbound'; import FinalMaskForm from '@/components/FinalMaskForm'; import JsonEditor from '@/components/JsonEditor'; import './OutboundFormModal.css'; diff --git a/frontend/src/pages/xray/OutboundsTab.tsx b/frontend/src/pages/xray/OutboundsTab.tsx index bdd48796..a0e1e1ed 100644 --- a/frontend/src/pages/xray/OutboundsTab.tsx +++ b/frontend/src/pages/xray/OutboundsTab.tsx @@ -34,7 +34,7 @@ import { import type { ColumnsType } from 'antd/es/table'; import { SizeFormatter } from '@/utils'; -import { Protocols } from '@/models/outbound.js'; +import { Protocols } from '@/models/outbound'; import OutboundFormModal from './OutboundFormModal'; import type { XraySettingsValue, SetTemplate, OutboundTestState, OutboundTrafficRow } from '@/hooks/useXraySetting'; import './OutboundsTab.css';