chore(eslint): add fetch to polyfills configuration (#56697)

This commit is contained in:
thinkasany
2026-01-21 23:05:52 +08:00
committed by GitHub
parent 964eb9d9d5
commit acc11dfccb
5 changed files with 1 additions and 5 deletions

View File

@@ -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;

View File

@@ -1,4 +1,3 @@
/* eslint-disable compat/compat */
import { css } from 'antd-style';
import useSWR from 'swr';

View File

@@ -1,4 +1,3 @@
/* eslint-disable compat/compat */
import { useRef, useState } from 'react';
import { XStream } from '@ant-design/x-sdk';

View File

@@ -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());
};

View File

@@ -129,7 +129,7 @@ export default antfu(
'react/no-use-context': 'warn',
},
settings: {
polyfills: ['Promise', 'URL', 'URLSearchParams'],
polyfills: ['Promise', 'URL', 'fetch', 'URLSearchParams'],
},
},
{