Build(package.json): Upgrade dependencies

This commit is contained in:
2024-10-16 17:39:54 +08:00
parent 07f24333d9
commit b353ab07e2
33 changed files with 1574 additions and 4940 deletions

View File

@@ -1,40 +0,0 @@
/* eslint-env node */
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:react-hooks/recommended',
'plugin:prettier/recommended',
'./.eslintrc-auto-import.json'
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: './tsconfig*.json',
tsconfigRootDir: __dirname,
},
plugins: [
'react-refresh',
'prettier'],
rules: {
'no-cond-assign': 'error',
'eqeqeq': 'error',
'prettier/prettier': [
'error',
{
endOfLine: 'auto',
}
],
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true }
],
'@typescript-eslint/no-non-null-assertion': 'off',
'react-hooks/exhaustive-deps': 'off',
}
}

View File

@@ -5,4 +5,4 @@
"singleQuote": true, "singleQuote": true,
"printWidth": 100, "printWidth": 100,
"trailingComma": "none" "trailingComma": "none"
} }

30
eslint.config.mjs Normal file
View File

@@ -0,0 +1,30 @@
import globals from 'globals'
import eslintJs from '@eslint/js'
import tsEslint from 'typescript-eslint'
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'
const config = {
name: 'Global config',
files: ['**/*.{js,mjs,cjs,ts,jsx,tsx}'],
rules: {
'@typescript-eslint/no-unused-expressions': [
'error',
{
allowShortCircuit: true,
allowTernary: true,
allowTaggedTemplates: true
}
],
'@typescript-eslint/no-unused-vars': 'off'
}
}
export default [
{ files: ['**/*.{js,mjs,cjs,ts,jsx,tsx}'] },
{ languageOptions: { globals: globals.browser } },
eslintJs.configs.recommended,
eslintPluginPrettierRecommended,
...tsEslint.configs.recommended,
config
]

6127
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -23,18 +23,18 @@
"preview": "vite preview" "preview": "vite preview"
}, },
"dependencies": { "dependencies": {
"@ant-design/icons": "^5.3.7", "@ant-design/icons": "^5.5.1",
"@dnd-kit/core": "^6.1.0", "@dnd-kit/core": "^6.1.0",
"@dnd-kit/sortable": "^8.0.0", "@dnd-kit/sortable": "^8.0.0",
"@dnd-kit/utilities": "^3.2.2", "@dnd-kit/utilities": "^3.2.2",
"@marsidev/react-turnstile": "^0.7.1", "@marsidev/react-turnstile": "^1.0.2",
"@monaco-editor/react": "^4.6.0", "@monaco-editor/react": "^4.6.0",
"antd": "^5.18.1", "antd": "^5.21.4",
"axios": "^1.7.2", "axios": "1.7.4",
"custom-protocol-check": "^1.4.0", "custom-protocol-check": "^1.4.0",
"dayjs": "^1.11.11", "dayjs": "^1.11.13",
"echarts": "^5.5.0", "echarts": "^5.5.1",
"esbuild-wasm": "^0.21.5", "esbuild-wasm": "^0.24.0",
"fast-deep-equal": "^3.1.3", "fast-deep-equal": "^3.1.3",
"fflate": "^0.8.2", "fflate": "^0.8.2",
"jwt-decode": "^4.0.0", "jwt-decode": "^4.0.0",
@@ -42,43 +42,38 @@
"lodash": "^4.17.21", "lodash": "^4.17.21",
"match-sorter": "^6.3.4", "match-sorter": "^6.3.4",
"moment": "^2.30.1", "moment": "^2.30.1",
"monaco-editor": "^0.49.0", "monaco-editor": "^0.52.0",
"monaco-jsx-syntax-highlight": "^1.2.0", "monaco-jsx-syntax-highlight": "^1.2.0",
"react": "^18.3.1", "react": "^18.3.1",
"react-dom": "^18.3.1", "react-dom": "^18.3.1",
"react-draggable": "^4.4.6", "react-draggable": "^4.4.6",
"react-router": "^6.23.1", "react-router": "^6.27.0",
"react-router-dom": "^6.23.1", "react-router-dom": "^6.27.0",
"size-sensor": "^1.0.2", "size-sensor": "^1.0.2",
"vanilla-tilt": "^1.8.1" "vanilla-tilt": "^1.8.1"
}, },
"devDependencies": { "devDependencies": {
"@eslint/js": "^9.12.0",
"@svgr/core": "^8.1.0", "@svgr/core": "^8.1.0",
"@svgr/plugin-jsx": "^8.1.0", "@svgr/plugin-jsx": "^8.1.0",
"@types/jsdom": "^21.1.7", "@types/jsdom": "^21.1.7",
"@types/lodash": "^4.17.5", "@types/lodash": "^4.17.10",
"@types/node": "^20.14.2", "@types/node": "^20.16.11",
"@types/react": "^18.3.3", "@types/react": "^18.3.11",
"@types/react-dom": "^18.3.0", "@types/react-dom": "^18.3.1",
"@typescript-eslint/eslint-plugin": "^7.13.0", "@typescript/ata": "^0.9.7",
"@typescript-eslint/parser": "^7.13.0", "@vitejs/plugin-react": "^4.3.2",
"@typescript/ata": "^0.9.6", "eslint": "^9.12.0",
"@vitejs/plugin-react": "^4.3.1", "eslint-plugin-prettier": "^5.2.1",
"eslint": "^8.57.0", "eslint-plugin-react-refresh": "^0.4.12",
"eslint-config-love": "^52.0.0", "globals": "^15.11.0",
"eslint-config-prettier": "^9.1.0", "jsdom": "^24.1.3",
"eslint-plugin-import": "^2.29.1", "prettier": "^3.3.3",
"eslint-plugin-prettier": "^5.1.3", "sass": "^1.79.5",
"eslint-plugin-promise": "^6.2.0", "typescript": "^5.6.3",
"eslint-plugin-react-hooks": "^4.6.2", "typescript-eslint": "^8.9.0",
"eslint-plugin-react-refresh": "^0.4.7", "unplugin-auto-import": "^0.18.3",
"jsdom": "^24.1.0", "unplugin-icons": "^0.19.3",
"prettier": "^3.3.2", "vite": "5.4.6"
"sass": "^1.77.5",
"stylelint-config-prettier": "^9.0.5",
"typescript": "^5.4.5",
"unplugin-auto-import": "^0.17.6",
"unplugin-icons": "^0.19.0",
"vite": "^5.2.13"
} }
} }

View File

@@ -34,8 +34,7 @@ export interface TypeHelper {
export const createATA = async (): Promise<TypeHelper> => { export const createATA = async (): Promise<TypeHelper> => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error // @ts-expect-error
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment const ts = await import('https://esm.sh/typescript@5.6.3')
const ts = await import('https://esm.sh/typescript@5.3.3')
const maxConcurrentRequests = 50 const maxConcurrentRequests = 50
let activeRequests = 0 let activeRequests = 0
@@ -63,7 +62,6 @@ export const createATA = async (): Promise<TypeHelper> => {
const ata = setupTypeAcquisition({ const ata = setupTypeAcquisition({
projectName: 'monaco-ts', projectName: 'monaco-ts',
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
typescript: ts, typescript: ts,
logger: console, logger: console,
fetcher: (input, init) => { fetcher: (input, init) => {
@@ -117,7 +115,6 @@ export const createATA = async (): Promise<TypeHelper> => {
} }
return { return {
// eslint-disable-next-line @typescript-eslint/no-misused-promises
acquireType, acquireType,
addListener, addListener,
removeListener, removeListener,

View File

@@ -73,7 +73,6 @@ const Editor = ({
// eslint-disable-next-line @typescript-eslint/ban-ts-comment // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error // @ts-expect-error
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
editor['_codeEditorService'].doOpenEditor = function ( editor['_codeEditorService'].doOpenEditor = function (
editor: editor.IStandaloneCodeEditor, editor: editor.IStandaloneCodeEditor,
input: { options: { selection: Selection }; resource: { path: string } } input: { options: { selection: Selection }; resource: { path: string } }

View File

@@ -2,6 +2,6 @@ import { loader } from '@monaco-editor/react'
loader.config({ loader.config({
paths: { paths: {
vs: 'https://unpkg.com/monaco-editor@0.49.0/min/vs' vs: 'https://unpkg.com/monaco-editor@0.52.0/min/vs'
} }
}) })

View File

@@ -2,4 +2,4 @@
position: relative; position: relative;
width: 100%; width: 100%;
height: 100%; height: 100%;
} }

View File

@@ -186,15 +186,15 @@ const Render = ({ iframeKey, compiledCode, mobileMode = false }: RenderProps) =>
className={`device-content${isRotate ? ' rotate' : ''}`} className={`device-content${isRotate ? ' rotate' : ''}`}
style={{ style={{
width: isRotate width: isRotate
? devices.find((value) => value.name === selectedDevice) ? (devices.find((value) => value.name === selectedDevice)
?.height ?? 915 ?.height ?? 915)
: devices.find((value) => value.name === selectedDevice) : (devices.find((value) => value.name === selectedDevice)
?.width ?? 412, ?.width ?? 412),
height: isRotate height: isRotate
? devices.find((value) => value.name === selectedDevice) ? (devices.find((value) => value.name === selectedDevice)
?.width ?? 412 ?.width ?? 412)
: devices.find((value) => value.name === selectedDevice) : (devices.find((value) => value.name === selectedDevice)
?.height ?? 915 ?.height ?? 915)
}} }}
> >
<iframe <iframe

View File

@@ -38,7 +38,7 @@
} }
if (data?.type === "SCALE") { if (data?.type === "SCALE") {
document.getElementById("root").style.zoom = data.data.zoom document.getElementById("root").style.zoom = data.data.zoom;
} }
}); });
</script> </script>

View File

@@ -1,3 +1,3 @@
[data-component=playground-transform] { [data-component=playground-transform] {
position: relative; position: relative;
} }

View File

@@ -30,7 +30,7 @@ class Compiler {
void esbuild void esbuild
.initialize({ .initialize({
worker: true, worker: true,
wasmURL: 'https://esm.sh/esbuild-wasm@0.21.5/esbuild.wasm' wasmURL: 'https://esm.sh/esbuild-wasm@0.24.0/esbuild.wasm'
}) })
.finally(() => { .finally(() => {
this.init = true this.init = true

View File

@@ -1,4 +1,4 @@
{ {
"type": "object", "type": "object",
"additionalProperties": {"type": "string"} "additionalProperties": {"type": "string"}
} }

View File

@@ -5,4 +5,4 @@
> * { > * {
width: 0 !important; width: 0 !important;
} }
} }

View File

@@ -864,4 +864,4 @@
} }
} }
} }
} }

View File

@@ -1,7 +1,7 @@
import { DetailedHTMLProps, HTMLAttributes } from 'react' import { DetailedHTMLProps, HTMLAttributes } from 'react'
import '@/assets/css/components/common/card.scss' import '@/assets/css/components/common/card.scss'
interface CardProps extends DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> {} type CardProps = DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>
const Card = forwardRef<HTMLDivElement, CardProps>(({ className, ...props }, ref) => { const Card = forwardRef<HTMLDivElement, CardProps>(({ className, ...props }, ref) => {
return <div className={`card-box${className ? ` ${className}` : ''}`} {...props} ref={ref} /> return <div className={`card-box${className ? ` ${className}` : ''}`} {...props} ref={ref} />

View File

@@ -82,94 +82,90 @@ const HideScrollbar = forwardRef<HideScrollbarElement, HideScrollbarProps>(
}, },
ref ref
) => { ) => {
useImperativeHandle<HideScrollbarElement, HideScrollbarElement>( useImperativeHandle<HideScrollbarElement, HideScrollbarElement>(ref, () => {
ref, return {
() => { scrollTo(x, y, smooth?: boolean) {
return { rootRef.current?.scrollTo({
scrollTo(x, y, smooth?: boolean) { left: x,
rootRef.current?.scrollTo({ top: y,
left: x, behavior: smooth === false ? 'instant' : 'smooth'
top: y, })
behavior: smooth === false ? 'instant' : 'smooth' },
}) scrollX(x, smooth?: boolean) {
}, rootRef.current?.scrollTo({
scrollX(x, smooth?: boolean) { left: x,
rootRef.current?.scrollTo({ behavior: smooth === false ? 'instant' : 'smooth'
left: x, })
behavior: smooth === false ? 'instant' : 'smooth' },
}) scrollY(y, smooth?: boolean) {
}, rootRef.current?.scrollTo({
scrollY(y, smooth?: boolean) { top: y,
rootRef.current?.scrollTo({ behavior: smooth === false ? 'instant' : 'smooth'
top: y, })
behavior: smooth === false ? 'instant' : 'smooth' },
}) scrollLeft(length, smooth?: boolean) {
}, rootRef.current?.scrollTo({
scrollLeft(length, smooth?: boolean) { left: rootRef.current?.scrollLeft - length,
rootRef.current?.scrollTo({ behavior: smooth === false ? 'instant' : 'smooth'
left: rootRef.current?.scrollLeft - length, })
behavior: smooth === false ? 'instant' : 'smooth' },
}) scrollRight(length, smooth?: boolean) {
}, rootRef.current?.scrollTo({
scrollRight(length, smooth?: boolean) { left: rootRef.current?.scrollLeft + length,
rootRef.current?.scrollTo({ behavior: smooth === false ? 'instant' : 'smooth'
left: rootRef.current?.scrollLeft + length, })
behavior: smooth === false ? 'instant' : 'smooth' },
}) scrollUp(length, smooth?: boolean) {
}, rootRef.current?.scrollTo({
scrollUp(length, smooth?: boolean) { top: rootRef.current?.scrollTop - length,
rootRef.current?.scrollTo({ behavior: smooth === false ? 'instant' : 'smooth'
top: rootRef.current?.scrollTop - length, })
behavior: smooth === false ? 'instant' : 'smooth' },
}) scrollDown(length, smooth?: boolean) {
}, rootRef.current?.scrollTo({
scrollDown(length, smooth?: boolean) { top: rootRef.current?.scrollTop + length,
rootRef.current?.scrollTo({ behavior: smooth === false ? 'instant' : 'smooth'
top: rootRef.current?.scrollTop + length, })
behavior: smooth === false ? 'instant' : 'smooth' },
}) getX() {
}, return rootRef.current?.scrollLeft ?? 0
getX() { },
return rootRef.current?.scrollLeft ?? 0 getY() {
}, return rootRef.current?.scrollTop ?? 0
getY() { },
return rootRef.current?.scrollTop ?? 0 addEventListenerWithType<K extends keyof HTMLElementEventMap>(
}, type: K,
addEventListenerWithType<K extends keyof HTMLElementEventMap>( listener: (this: HTMLDivElement, ev: HTMLElementEventMap[K]) => never,
type: K, options?: boolean | AddEventListenerOptions
listener: (this: HTMLDivElement, ev: HTMLElementEventMap[K]) => never, ): void {
options?: boolean | AddEventListenerOptions rootRef.current?.addEventListener<K>(type, listener, options)
): void { },
rootRef.current?.addEventListener<K>(type, listener, options) addEventListener(
}, type: string,
addEventListener( listener: EventListenerOrEventListenerObject,
type: string, options?: boolean | AddEventListenerOptions
listener: EventListenerOrEventListenerObject, ): void {
options?: boolean | AddEventListenerOptions rootRef.current?.addEventListener(type, listener, options)
): void { },
rootRef.current?.addEventListener(type, listener, options) removeEventListenerWithType<K extends keyof HTMLElementEventMap>(
}, type: K,
removeEventListenerWithType<K extends keyof HTMLElementEventMap>( listener: (this: HTMLDivElement, ev: HTMLElementEventMap[K]) => never,
type: K, options?: boolean | EventListenerOptions
listener: (this: HTMLDivElement, ev: HTMLElementEventMap[K]) => never, ): void {
options?: boolean | EventListenerOptions rootRef.current?.removeEventListener<K>(type, listener, options)
): void { },
rootRef.current?.removeEventListener<K>(type, listener, options) removeEventListener(
}, type: string,
removeEventListener( listener: EventListenerOrEventListenerObject,
type: string, options?: boolean | EventListenerOptions
listener: EventListenerOrEventListenerObject, ): void {
options?: boolean | EventListenerOptions rootRef.current?.removeEventListener(type, listener, options)
): void { },
rootRef.current?.removeEventListener(type, listener, options) refreshLayout(): void {
}, refreshLayout()
refreshLayout(): void {
refreshLayout()
}
} }
}, }
[] }, [])
)
const maskRef = useRef<HTMLDivElement>(null) const maskRef = useRef<HTMLDivElement>(null)
const rootRef = useRef<HTMLDivElement>(null) const rootRef = useRef<HTMLDivElement>(null)

View File

@@ -7,7 +7,6 @@ interface DragHandleProps {
} }
const DragHandle = ({ padding }: DragHandleProps) => { const DragHandle = ({ padding }: DragHandleProps) => {
// eslint-disable-next-line @typescript-eslint/unbound-method
const { attributes, listeners, ref } = useContext(HandleContextInst) const { attributes, listeners, ref } = useContext(HandleContextInst)
return ( return (

View File

@@ -1,6 +1,7 @@
import { DraggableSyntheticListeners } from '@dnd-kit/core' import { DraggableSyntheticListeners } from '@dnd-kit/core'
export interface HandleContext { export interface HandleContext {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
attributes: Record<string, any> attributes: Record<string, any>
listeners: DraggableSyntheticListeners listeners: DraggableSyntheticListeners
ref(node: HTMLElement | null): void ref(node: HTMLElement | null): void

View File

@@ -126,10 +126,8 @@ const SignIn = () => {
form={twoFactorForm} form={twoFactorForm}
ref={() => { ref={() => {
setTimeout(() => { setTimeout(() => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
twoFactorForm twoFactorForm
.getFieldInstance('twoFactorCode') .getFieldInstance('twoFactorCode')
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
.focus() .focus()
}, 50) }, 50)
}} }}

View File

@@ -31,7 +31,6 @@ const Mail = () => {
form={mailSendForm} form={mailSendForm}
ref={() => { ref={() => {
setTimeout(() => { setTimeout(() => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access
mailSendForm?.getFieldInstance('to').focus() mailSendForm?.getFieldInstance('to').focus()
}, 50) }, 50)
}} }}

View File

@@ -14,8 +14,6 @@ import {
import { BarChart, BarSeriesOption, LineChart, LineSeriesOption } from 'echarts/charts' import { BarChart, BarSeriesOption, LineChart, LineSeriesOption } from 'echarts/charts'
import { SVGRenderer } from 'echarts/renderers' import { SVGRenderer } from 'echarts/renderers'
import { UniversalTransition } from 'echarts/features' import { UniversalTransition } from 'echarts/features'
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
import { CallbackDataParams } from 'echarts/types/dist/shared' import { CallbackDataParams } from 'echarts/types/dist/shared'
import { utcToLocalTime } from '@/util/datetime' import { utcToLocalTime } from '@/util/datetime'
@@ -83,11 +81,13 @@ export const barEChartsBaseOption: EChartsOption = {
export const getTooltipTimeFormatter = (format: string = 'yyyy-MM-DD HH:mm:ss') => { export const getTooltipTimeFormatter = (format: string = 'yyyy-MM-DD HH:mm:ss') => {
return (params: CallbackDataParams[]) => return (params: CallbackDataParams[]) =>
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument,@typescript-eslint/no-unsafe-member-access // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
`${utcToLocalTime(params[0].data[0], format)}<br>${params `${utcToLocalTime(params[0].data[0], format)}<br>${params
.map( .map(
(param) => (param) =>
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
`<span style="display: flex; justify-content: space-between;"><span>${param.marker}${param.seriesName}</span><span style="font-weight: bold; margin-left: 16px;">${param.data[1]}</span></span>` `<span style="display: flex; justify-content: space-between;"><span>${param.marker}${param.seriesName}</span><span style="font-weight: bold; margin-left: 16px;">${param.data[1]}</span></span>`
) )
.join('')}` .join('')}`

View File

@@ -628,7 +628,6 @@ const Base = () => {
form={addFileForm} form={addFileForm}
ref={() => { ref={() => {
setTimeout(() => { setTimeout(() => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access
addFileForm?.getFieldInstance('fileName').focus() addFileForm?.getFieldInstance('fileName').focus()
}, 50) }, 50)
}} }}
@@ -822,7 +821,6 @@ const Base = () => {
form={renameFileForm} form={renameFileForm}
ref={() => { ref={() => {
setTimeout(() => { setTimeout(() => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access
renameFileForm?.getFieldInstance('fileName').focus() renameFileForm?.getFieldInstance('fileName').focus()
}, 50) }, 50)
}} }}

View File

@@ -479,7 +479,6 @@ const Template = () => {
form={addFileForm} form={addFileForm}
ref={() => { ref={() => {
setTimeout(() => { setTimeout(() => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access
addFileForm?.getFieldInstance('fileName').focus() addFileForm?.getFieldInstance('fileName').focus()
}, 50) }, 50)
}} }}
@@ -674,7 +673,6 @@ const Template = () => {
form={renameFileForm} form={renameFileForm}
ref={() => { ref={() => {
setTimeout(() => { setTimeout(() => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access
renameFileForm?.getFieldInstance('fileName').focus() renameFileForm?.getFieldInstance('fileName').focus()
}, 50) }, 50)
}} }}

View File

@@ -353,7 +353,6 @@ const User = () => {
wrapperCol={{ span: 18 }} wrapperCol={{ span: 18 }}
ref={() => { ref={() => {
setTimeout(() => { setTimeout(() => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access
changePasswordForm?.getFieldInstance('password').focus() changePasswordForm?.getFieldInstance('password').focus()
}, 50) }, 50)
}} }}

View File

@@ -74,7 +74,6 @@ const Create = () => {
const reader = new FileReader() const reader = new FileReader()
reader.addEventListener('load', () => { reader.addEventListener('load', () => {
// eslint-disable-next-line @typescript-eslint/no-base-to-string
form.setFieldValue('icon', reader.result!.toString().split(',')[1]) form.setFieldValue('icon', reader.result!.toString().split(',')[1])
void form.validateFields(['icon']) void form.validateFields(['icon'])
}) })
@@ -163,7 +162,7 @@ const Create = () => {
temp.push(item) temp.push(item)
} }
}) })
form.setFieldValue('keyword', temp) form.setFieldValue('keywords', temp)
}, [form, formValues?.keywords]) }, [form, formValues?.keywords])
useEffect(() => { useEffect(() => {

View File

@@ -151,7 +151,6 @@ const Edit = () => {
const reader = new FileReader() const reader = new FileReader()
reader.addEventListener('load', () => { reader.addEventListener('load', () => {
// eslint-disable-next-line @typescript-eslint/no-base-to-string
form.setFieldValue('icon', reader.result!.toString().split(',')[1]) form.setFieldValue('icon', reader.result!.toString().split(',')[1])
void form.validateFields(['icon']) void form.validateFields(['icon'])
}) })

View File

@@ -266,7 +266,6 @@ const Tools = () => {
form={upgradeForm} form={upgradeForm}
ref={() => { ref={() => {
setTimeout(() => { setTimeout(() => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access
upgradeForm?.getFieldInstance('toolId').focus() upgradeForm?.getFieldInstance('toolId').focus()
}, 50) }, 50)
}} }}

View File

@@ -22,10 +22,6 @@ import Card from '@/components/common/Card'
import FlexBox from '@/components/common/FlexBox' import FlexBox from '@/components/common/FlexBox'
import HideScrollbar from '@/components/common/HideScrollbar' import HideScrollbar from '@/components/common/HideScrollbar'
interface ChangePasswordFields extends UserUpdatePasswordParam {
newPasswordConfirm: string
}
const User = () => { const User = () => {
const [modal, contextHolder] = AntdModal.useModal() const [modal, contextHolder] = AntdModal.useModal()
const [form] = AntdForm.useForm<UserInfoUpdateParam>() const [form] = AntdForm.useForm<UserInfoUpdateParam>()
@@ -37,7 +33,7 @@ const User = () => {
const [isGettingAvatar, setIsGettingAvatar] = useState(false) const [isGettingAvatar, setIsGettingAvatar] = useState(false)
const [avatar, setAvatar] = useState('') const [avatar, setAvatar] = useState('')
const [userWithPowerInfoVo, setUserWithPowerInfoVo] = useState<UserWithPowerInfoVo>() const [userWithPowerInfoVo, setUserWithPowerInfoVo] = useState<UserWithPowerInfoVo>()
const [changePasswordForm] = AntdForm.useForm<ChangePasswordFields>() const [changePasswordForm] = AntdForm.useForm<UserChangePasswordParam>()
const handleOnCopyToClipboard = (username?: string) => { const handleOnCopyToClipboard = (username?: string) => {
return username return username
@@ -127,7 +123,6 @@ const User = () => {
wrapperCol={{ span: 18 }} wrapperCol={{ span: 18 }}
ref={() => { ref={() => {
setTimeout(() => { setTimeout(() => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access
changePasswordForm?.getFieldInstance('originalPassword').focus() changePasswordForm?.getFieldInstance('originalPassword').focus()
}, 50) }, 50)
}} }}
@@ -260,10 +255,8 @@ const User = () => {
form={twoFactorForm} form={twoFactorForm}
ref={() => { ref={() => {
setTimeout(() => { setTimeout(() => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
twoFactorForm twoFactorForm
?.getFieldInstance('twoFactorCode') ?.getFieldInstance('twoFactorCode')
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
.focus() .focus()
}, 50) }, 50)
}} }}
@@ -352,10 +345,8 @@ const User = () => {
form={twoFactorForm} form={twoFactorForm}
ref={() => { ref={() => {
setTimeout(() => { setTimeout(() => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
twoFactorForm twoFactorForm
?.getFieldInstance('twoFactorCode') ?.getFieldInstance('twoFactorCode')
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
.focus() .focus()
}, 50) }, 50)
}} }}

View File

@@ -12,7 +12,7 @@ export const useUpdatedEffect = (effect: EffectCallback, dependencies: Dependenc
}, dependencies) }, dependencies)
} }
export const usePrevious = <T,>(value: T): T | undefined => { export const usePrevious = <T>(value: T): T | undefined => {
const ref = useRef<T>() const ref = useRef<T>()
useEffect(() => { useEffect(() => {
ref.current = value ref.current = value

View File

@@ -12,14 +12,12 @@ import { AntDesignResolver } from './build/resolvers/antd'
export default defineConfig({ export default defineConfig({
plugins: [ plugins: [
react(), react(),
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
AutoImport({ AutoImport({
// targets to transform // targets to transform
include: [ include: [
/\.[tj]sx?$/, // .ts, .tsx, .js, .jsx /\.[tj]sx?$/, // .ts, .tsx, .js, .jsx
/\.md$/ // .md /\.md$/ // .md
], ],
// global imports to register // global imports to register
imports: [ imports: [
'react', 'react',
@@ -42,7 +40,6 @@ export default defineConfig({
// Defaults to './auto-imports.d.ts' when `typescript` is installed locally. // Defaults to './auto-imports.d.ts' when `typescript` is installed locally.
// Set `false` to disable. // Set `false` to disable.
dts: './auto-imports.d.ts', dts: './auto-imports.d.ts',
// Custom resolvers, compatible with `unplugin-vue-components` // Custom resolvers, compatible with `unplugin-vue-components`
// see https://github.com/antfu/unplugin-auto-import/pull/23/ // see https://github.com/antfu/unplugin-auto-import/pull/23/
resolvers: [ resolvers: [
@@ -55,7 +52,6 @@ export default defineConfig({
resolveIcons: true resolveIcons: true
}) })
], ],
// Generate corresponding .eslintrc-auto-import.json file. // Generate corresponding .eslintrc-auto-import.json file.
// eslint globals Docs - https://eslint.org/docs/user-guide/configuring/language-options#specifying-globals // eslint globals Docs - https://eslint.org/docs/user-guide/configuring/language-options#specifying-globals
eslintrc: { eslintrc: {