跳转到内容

noUnwantedPolyfillio

此内容尚不支持你的语言。

Prevent duplicate polyfills from Polyfill.io.

You are using polyfills from Polyfill.io and including polyfills already shipped with Next.js. This unnecessarily increases page weight which can affect loading performance.

<script src='https://polyfill.io/v3/polyfill.min.js?features=AbortController,Object.fromEntries'></script>
code-block.jsx:1:13 lint/nursery/noUnwantedPolyfillio ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Prevent duplicate polyfills from Polyfill.io

> 1 │ <script src=‘https://polyfill.io/v3/polyfill.min.js?features=AbortController,Object.fromEntries’&gt;&lt;/script>
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 │

Object.fromEntries is already shipped with Next.js.

This unnecessarily increases page weight which can affect loading performance.

import NextScript from 'next/script';
export function MyApp({ Component, pageProps }) {
return <NextScript src='https://polyfill.io/v3/polyfill.min.js?features=Array.prototype.copyWithin' />
}
code-block.jsx:4:26 lint/nursery/noUnwantedPolyfillio ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Prevent duplicate polyfills from Polyfill.io

3 │ export function MyApp({ Component, pageProps }) {
> 4 │ return <NextScript src=‘https://polyfill.io/v3/polyfill.min.js?features=Array.prototype.copyWithin’ />
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5 │ }
6 │

Array.prototype.copyWithin is already shipped with Next.js.

This unnecessarily increases page weight which can affect loading performance.

<>
<script src='https://polyfill.io/v3/polyfill.min.js?features=AbortController'></script>
<script src='https://polyfill.io/v3/polyfill.min.js?features=IntersectionObserver'></script>
<Script src='https://polyfill.io/v3/polyfill.min.js?features=IntersectionObserver' />
<Script src='https://polyfill-fastly.io/v3/polyfill.min.js?features=IntersectionObserver' />
</>
biome.json
{
"linter": {
"rules": {
"nursery": {
"noUnwantedPolyfillio": "error"
}
}
}
}