feat: comprehensive oxlint cleanup - remove unused code

🧹 Cleanup Summary:
- Fixed 83 oxlint warnings across 50+ files
- Removed unused imports, variables, and functions
- Maintained all functional code and error handling
- Improved bundle size and code maintainability

📝 Key Changes:
- Cleaned unused React hooks (useState, useEffect, useClashInfo)
- Removed unused Material-UI imports (useTheme, styled components)
- Deleted unused interfaces and type definitions
- Fixed spread operator usage and boolean casting
- Simplified catch parameters where appropriate

🎯 Files Modified:
- React components: home.tsx, settings, profiles, etc.
- Custom hooks: use-*.ts files
- Utility functions and type definitions
- Configuration files

 Result: 0 oxlint warnings (from 83 warnings)
🔧 All functionality preserved
📦 Reduced bundle size through dead code elimination
This commit is contained in:
Tunglies
2025-08-22 18:48:56 +08:00
parent 6a1fce69e0
commit 475a09bb54
53 changed files with 254 additions and 254 deletions

156
pnpm-lock.yaml generated
View File

@@ -198,6 +198,9 @@ importers:
cross-env:
specifier: ^10.0.0
version: 10.0.0
eslint-plugin-oxlint:
specifier: ^1.12.0
version: 1.12.0
https-proxy-agent:
specifier: ^7.0.6
version: 7.0.6
@@ -207,6 +210,9 @@ importers:
node-fetch:
specifier: ^3.3.2
version: 3.3.2
oxlint:
specifier: ^1.12.0
version: 1.12.0
prettier:
specifier: ^3.6.2
version: 3.6.2
@@ -1211,6 +1217,76 @@ packages:
'@octokit/types@13.10.0':
resolution: {integrity: sha512-ifLaO34EbbPj0Xgro4G5lP5asESjwHracYJvVaPIyXMuiuXLlhic3S47cBdTb+jfODkTE5YtGCLt3Ay3+J97sA==}
'@oxlint-tsgolint/darwin-arm64@0.0.4':
resolution: {integrity: sha512-qL0zqIYdYrXl6ghTIHnhJkvyYy1eKz0P8YIEp59MjY3/zNiyk/gtyp8LkwZdqb9ezbcX9UDQhSuSO1wURJsq8g==}
cpu: [arm64]
os: [darwin]
'@oxlint-tsgolint/darwin-x64@0.0.4':
resolution: {integrity: sha512-c3nSjqmDSKzemChAEUv/zy2e9cwgkkO/7rz4Y447+8pSbeZNHi3RrNpVHdrKL/Qep4pt6nFZE+6PoczZxHNQjg==}
cpu: [x64]
os: [darwin]
'@oxlint-tsgolint/linux-arm64@0.0.4':
resolution: {integrity: sha512-P2BA54c/Ej5AGkChH1/7zMd6PwZfa+jnw8juB/JWops+BX+lbhbbBHz0cYduDBgWYjRo4e3OVJOTskqcpuMfNw==}
cpu: [arm64]
os: [linux]
'@oxlint-tsgolint/linux-x64@0.0.4':
resolution: {integrity: sha512-hbgLpnDNicPrbHOAQ9nNfLOSrUrdWANP/umR7P/cwCc1sv66eEs7bm4G3mrhRU8aXFBJmbhdNqiDSUkYYvHWJQ==}
cpu: [x64]
os: [linux]
'@oxlint-tsgolint/win32-arm64@0.0.4':
resolution: {integrity: sha512-ozKEppmwZhC5LMedClBEat6cXgBGUvxGOgsKK2ZZNE6zSScX7QbvJAOt3nWMGs8GQshHy/6ndMB33+uRloglQA==}
cpu: [arm64]
os: [win32]
'@oxlint-tsgolint/win32-x64@0.0.4':
resolution: {integrity: sha512-gLfx+qogW21QcaRKFg6ARgra7tSPqyn+Ems3FgTUyxV4OpJYn7KsQroygxOWElqv6JUobtvHBrxdB6YhlvERbQ==}
cpu: [x64]
os: [win32]
'@oxlint/darwin-arm64@1.12.0':
resolution: {integrity: sha512-Pv+Ho1uq2ny8g2P6JgQpaIUF1FHPL32DfOlZhKqmzDT3PydtFvZp/7zNyJE3BIXeTOOOG1Eg12hjZHMLsWxyNw==}
cpu: [arm64]
os: [darwin]
'@oxlint/darwin-x64@1.12.0':
resolution: {integrity: sha512-kNXPH/7jXjX4pawrEWXQHOasOdOsrYKhskA1qYwLYcv/COVSoxOSElkQtQa+KxN5zzt3F02kBdWDndLpgJLbLQ==}
cpu: [x64]
os: [darwin]
'@oxlint/linux-arm64-gnu@1.12.0':
resolution: {integrity: sha512-U7NETs02K55ZyDlgdhx4lWeFYbkUKcL+YcG+Ak70EyEt/BKIIVt4B84VdV1JzC71FErUipDYAwPJmxMREXr4Sg==}
cpu: [arm64]
os: [linux]
'@oxlint/linux-arm64-musl@1.12.0':
resolution: {integrity: sha512-e4Pb2eZu3V2BsiX4t4gyv9iJ8+KRT6bkoWM5uC9BLX7edsVchwLwL6LB2vPYusYdPPrxdjlFCg6ni+9wlw7FbQ==}
cpu: [arm64]
os: [linux]
'@oxlint/linux-x64-gnu@1.12.0':
resolution: {integrity: sha512-qJK98Dj/z7Nbm0xoz0nCCMFGy0W/kLewPzOK5QENxuUoQQ6ymt7/75rXOuTwAZJ6JFTarqfSuMAA0pka6Tmytw==}
cpu: [x64]
os: [linux]
'@oxlint/linux-x64-musl@1.12.0':
resolution: {integrity: sha512-jNeltpHc1eonSev/bWKipJ7FI6+Rc7EXh6Y7E0pm8e95sc1klFA29FFVs3FjMA6CCa+SRT0u0nnNTTAtf2QOiQ==}
cpu: [x64]
os: [linux]
'@oxlint/win32-arm64@1.12.0':
resolution: {integrity: sha512-T3fpNZJ3Q9YGgJTKc1YyvGoomSXnrV5mREz0QACE06zUzfS8EWyaYc/GN17FhHvQ4uQk/1xLgnM6FPsuLMeRhw==}
cpu: [arm64]
os: [win32]
'@oxlint/win32-x64@1.12.0':
resolution: {integrity: sha512-2eC4XQ1SMM2z7bCDG+Ifrn5GrvP6fkL0FGi4ZwDCrx6fwb1byFrXgSUNIPiqiiqBBrFRMKlXzU9zD6IjuFlUOg==}
cpu: [x64]
os: [win32]
'@parcel/watcher-android-arm64@2.5.1':
resolution: {integrity: sha512-KF8+j9nNbUN8vzOFDpRMsaKBHZ/mcjEjMToVMJOhTozkDonQFFrRcfdLWn6yWKCmJKmdVxSgHiYvTCef4/qcBA==}
engines: {node: '>= 10.0.0'}
@@ -1992,6 +2068,9 @@ packages:
resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==}
engines: {node: '>=10'}
eslint-plugin-oxlint@1.12.0:
resolution: {integrity: sha512-4rVg1CgiiA3bKkjVSh4nhZE46K0ZznkTbDqVCAhKSnM2PPu8I1lBXy1k5APg68QBXzOIVlZiNsNCPTh2Rl/lZA==}
esniff@2.0.1:
resolution: {integrity: sha512-kTUIGKQ/mDPFoJ0oVfcmyJn4iBDRptjNVIzwIFR7tqWXdVI9xfA2RMwY/gbSpJG3lkdWNEjLap/NqVHZiJsdfg==}
engines: {node: '>=0.10'}
@@ -2462,6 +2541,15 @@ packages:
once@1.4.0:
resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==}
oxlint-tsgolint@0.0.4:
resolution: {integrity: sha512-KFWVP+VU3ymgK/Dtuf6iRkqjo+aN42lS1YThY6JWlNi1GQqm7wtio/kAwssqDhm8kP+CVXbgZAtu1wgsK4XeTg==}
hasBin: true
oxlint@1.12.0:
resolution: {integrity: sha512-tBQ9aB00aYLlGXE21WJHnKQAI8xoi2V6Eiz/WvGV7FwU9YLYuNOurEEVbfoS5u0ODX8GLvGWj1fdHh5Rb74Kkw==}
engines: {node: '>=8.*'}
hasBin: true
package-json-from-dist@1.0.1:
resolution: {integrity: sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==}
@@ -4163,6 +4251,48 @@ snapshots:
dependencies:
'@octokit/openapi-types': 24.2.0
'@oxlint-tsgolint/darwin-arm64@0.0.4':
optional: true
'@oxlint-tsgolint/darwin-x64@0.0.4':
optional: true
'@oxlint-tsgolint/linux-arm64@0.0.4':
optional: true
'@oxlint-tsgolint/linux-x64@0.0.4':
optional: true
'@oxlint-tsgolint/win32-arm64@0.0.4':
optional: true
'@oxlint-tsgolint/win32-x64@0.0.4':
optional: true
'@oxlint/darwin-arm64@1.12.0':
optional: true
'@oxlint/darwin-x64@1.12.0':
optional: true
'@oxlint/linux-arm64-gnu@1.12.0':
optional: true
'@oxlint/linux-arm64-musl@1.12.0':
optional: true
'@oxlint/linux-x64-gnu@1.12.0':
optional: true
'@oxlint/linux-x64-musl@1.12.0':
optional: true
'@oxlint/win32-arm64@1.12.0':
optional: true
'@oxlint/win32-x64@1.12.0':
optional: true
'@parcel/watcher-android-arm64@2.5.1':
optional: true
@@ -4903,6 +5033,10 @@ snapshots:
escape-string-regexp@4.0.0: {}
eslint-plugin-oxlint@1.12.0:
dependencies:
jsonc-parser: 3.3.1
esniff@2.0.1:
dependencies:
d: 1.0.2
@@ -5495,6 +5629,28 @@ snapshots:
dependencies:
wrappy: 1.0.2
oxlint-tsgolint@0.0.4:
optionalDependencies:
'@oxlint-tsgolint/darwin-arm64': 0.0.4
'@oxlint-tsgolint/darwin-x64': 0.0.4
'@oxlint-tsgolint/linux-arm64': 0.0.4
'@oxlint-tsgolint/linux-x64': 0.0.4
'@oxlint-tsgolint/win32-arm64': 0.0.4
'@oxlint-tsgolint/win32-x64': 0.0.4
optional: true
oxlint@1.12.0:
optionalDependencies:
'@oxlint/darwin-arm64': 1.12.0
'@oxlint/darwin-x64': 1.12.0
'@oxlint/linux-arm64-gnu': 1.12.0
'@oxlint/linux-arm64-musl': 1.12.0
'@oxlint/linux-x64-gnu': 1.12.0
'@oxlint/linux-x64-musl': 1.12.0
'@oxlint/win32-arm64': 1.12.0
'@oxlint/win32-x64': 1.12.0
oxlint-tsgolint: 0.0.4
package-json-from-dist@1.0.1: {}
parent-module@1.0.1: