mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
refactor: clean up api/error.ts (#4542)
This removes an eslint-disable lint and updates the `err` type to `unknown` instead of `any` which is more correct.
This commit is contained in:
@@ -23,8 +23,7 @@ export type ApiError = AxiosError<ApiErrorResponse> & {
|
||||
response: AxiosResponse<ApiErrorResponse>
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
||||
export const isApiError = (err: any): err is ApiError => {
|
||||
export const isApiError = (err: unknown): err is ApiError => {
|
||||
if (axios.isAxiosError(err)) {
|
||||
const response = err.response?.data
|
||||
if (!response) {
|
||||
|
||||
Reference in New Issue
Block a user