mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-06-05 12:44:22 +00:00
refactor(frontend): drop .js extensions from TS-resolved imports
Cleanup after the JS→TS migration:
- All consumers that imported @/models/{inbound,outbound,dbinbound}.js
now drop the .js extension (TS module resolution lands on the .ts
file automatically)
- eslint.config.js: remove the **/*.js block since the only remaining
JS file under src/ is endpoints.js (build-script consumed only) and
js.configs.recommended already covers it correctly
This commit is contained in:
parent
91ade9dfec
commit
0217270262
10 changed files with 9 additions and 39 deletions
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
|
|
|||
Loading…
Reference in a new issue