diff --git a/examples/script-component/pages/polyfill.tsx b/examples/script-component/pages/polyfill.tsx index bee31995b55d6..add9af5200053 100644 --- a/examples/script-component/pages/polyfill.tsx +++ b/examples/script-component/pages/polyfill.tsx @@ -32,7 +32,7 @@ export default function Polyfill() { <> {/* We ensure that intersection observer is available by polyfilling it */} diff --git a/packages/eslint-plugin-next/src/rules/no-unwanted-polyfillio.ts b/packages/eslint-plugin-next/src/rules/no-unwanted-polyfillio.ts index 35ebf0acf1107..fc575e9919292 100644 --- a/packages/eslint-plugin-next/src/rules/no-unwanted-polyfillio.ts +++ b/packages/eslint-plugin-next/src/rules/no-unwanted-polyfillio.ts @@ -115,7 +115,12 @@ export = defineRule({ const src = srcNode.value.value if ( src.startsWith('https://cdn.polyfill.io/v2/') || - src.startsWith('https://polyfill.io/v3/') + src.startsWith('https://polyfill.io/v3/') || + // https://community.fastly.com/t/new-options-for-polyfill-io-users/2540 + src.startsWith('https://polyfill-fastly.net/') || + src.startsWith('https://polyfill-fastly.io/') || + // https://blog.cloudflare.com/polyfill-io-now-available-on-cdnjs-reduce-your-supply-chain-risk + src.startsWith('https://cdnjs.cloudflare.com/polyfill/') ) { const featureQueryString = new URL(src).searchParams.get('features') const featuresRequested = (featureQueryString || '').split(',') diff --git a/test/unit/eslint-plugin-next/no-unwanted-polyfillio.test.ts b/test/unit/eslint-plugin-next/no-unwanted-polyfillio.test.ts index f1383c2f67d9c..4871505b4f3c7 100644 --- a/test/unit/eslint-plugin-next/no-unwanted-polyfillio.test.ts +++ b/test/unit/eslint-plugin-next/no-unwanted-polyfillio.test.ts @@ -48,6 +48,16 @@ ruleTester.run('unwanted-polyfillsio', rule, { ); }`, + `import Script from 'next/script'; + + export function MyApp({ Component, pageProps }) { + return ( +