oxlint-plugin-react-doctor 0.7.6-dev.47beb25 → 0.7.6-dev.543ebfe
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -21401,7 +21401,6 @@ const nextjsNoNativeScript = defineRule({
|
|
|
21401
21401
|
});
|
|
21402
21402
|
//#endregion
|
|
21403
21403
|
//#region src/plugin/rules/nextjs/nextjs-no-polyfill-script.ts
|
|
21404
|
-
const ABSOLUTE_URL_SCHEME_PATTERN = /^[a-z][a-z\d+.-]*:/i;
|
|
21405
21404
|
const nextjsNoPolyfillScript = defineRule({
|
|
21406
21405
|
id: "nextjs-no-polyfill-script",
|
|
21407
21406
|
title: "Redundant polyfill script",
|
|
@@ -21415,9 +21414,7 @@ const nextjsNoPolyfillScript = defineRule({
|
|
|
21415
21414
|
const srcAttribute = findJsxAttribute(node.attributes ?? [], "src");
|
|
21416
21415
|
if (!srcAttribute?.value) return;
|
|
21417
21416
|
const srcValue = isNodeOfType(srcAttribute.value, "Literal") ? srcAttribute.value.value : null;
|
|
21418
|
-
|
|
21419
|
-
const requestScheme = requestUrl?.trimStart().match(ABSOLUTE_URL_SCHEME_PATTERN)?.[0].toLowerCase();
|
|
21420
|
-
if (requestUrl && (!requestScheme || requestScheme === "http:" || requestScheme === "https:") && POLYFILL_SCRIPT_PATTERN.test(requestUrl)) context.report({
|
|
21417
|
+
if (typeof srcValue === "string" && POLYFILL_SCRIPT_PATTERN.test(srcValue)) context.report({
|
|
21421
21418
|
node,
|
|
21422
21419
|
message: "This polyfill CDN script makes your users download polyfills Next.js already includes."
|
|
21423
21420
|
});
|