mirror of
https://github.com/ant-design/ant-design.git
synced 2026-02-08 18:39:20 +08:00
chore(eslint): add fetch to polyfills configuration (#56697)
This commit is contained in:
@@ -7,7 +7,6 @@ const isNumber = (value: any): value is number => {
|
||||
};
|
||||
|
||||
const fetcher = async (url: string): Promise<number> => {
|
||||
// eslint-disable-next-line compat/compat
|
||||
const res = await fetch(url, { headers: { Accept: 'application/vnd.github+json' } });
|
||||
const data = await res.json();
|
||||
const totalCount = isNumber(data?.total_count) ? data.total_count : 0;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable compat/compat */
|
||||
import { css } from 'antd-style';
|
||||
import useSWR from 'swr';
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable compat/compat */
|
||||
import { useRef, useState } from 'react';
|
||||
import { XStream } from '@ant-design/x-sdk';
|
||||
|
||||
|
||||
@@ -159,7 +159,6 @@ interface VersionItem {
|
||||
}
|
||||
|
||||
const fetcher = (...args: Parameters<typeof fetch>) => {
|
||||
// eslint-disable-next-line compat/compat
|
||||
return fetch(...args).then((res) => res.json());
|
||||
};
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@ export default antfu(
|
||||
'react/no-use-context': 'warn',
|
||||
},
|
||||
settings: {
|
||||
polyfills: ['Promise', 'URL', 'URLSearchParams'],
|
||||
polyfills: ['Promise', 'URL', 'fetch', 'URLSearchParams'],
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user