chore(deps): update dependency @eslint-react/eslint-plugin to v3 (#6522)

* chore(deps): update dependency @eslint-react/eslint-plugin to v3

* chore: remove deprecated rules

* chore: remove eslint from pre-push

* chore: update lint-staged config

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Slinetrac <realakayuki@gmail.com>
This commit is contained in:
renovate[bot]
2026-03-16 05:40:15 +00:00
committed by GitHub
co-authored by renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Slinetrac
parent 5ab02e2ef5
commit 13538914be
9 changed files with 254 additions and 258 deletions
@@ -1,36 +0,0 @@
import React from 'react'
import type { ErrorInfo } from 'react'
import {
TrafficErrorBoundary,
LightweightTrafficErrorBoundary,
} from './traffic-error-boundary'
interface WithTrafficErrorBoundaryOptions {
lightweight?: boolean
onError?: (error: Error, errorInfo: ErrorInfo) => void
}
/**
* HOC:为任何组件添加流量错误边界
*/
export function withTrafficErrorBoundary<P extends object>(
WrappedComponent: React.ComponentType<P>,
options?: WithTrafficErrorBoundaryOptions,
) {
const WithErrorBoundaryComponent = (props: P) => {
const ErrorBoundaryComponent = options?.lightweight
? LightweightTrafficErrorBoundary
: TrafficErrorBoundary
return (
<ErrorBoundaryComponent onError={options?.onError}>
<WrappedComponent {...props} />
</ErrorBoundaryComponent>
)
}
WithErrorBoundaryComponent.displayName = `withTrafficErrorBoundary(${WrappedComponent.displayName || WrappedComponent.name})`
return WithErrorBoundaryComponent
}