eslint-plugin-nextjs 0.1.1 → 1.0.0
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/README.md +13 -13
- package/dist/index.d.ts +4 -39
- package/dist/index.js +403 -274
- package/dist/index.js.map +1 -1
- package/package.json +15 -10
- package/dist/index.cjs +0 -1494
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -43
- package/dist/rules/google-font-display.cjs +0 -119
- package/dist/rules/google-font-display.cjs.map +0 -1
- package/dist/rules/google-font-display.d.cts +0 -8
- package/dist/rules/google-font-display.d.ts +0 -8
- package/dist/rules/google-font-display.js +0 -92
- package/dist/rules/google-font-display.js.map +0 -1
- package/dist/rules/google-font-preconnect.cjs +0 -109
- package/dist/rules/google-font-preconnect.cjs.map +0 -1
- package/dist/rules/google-font-preconnect.d.cts +0 -5
- package/dist/rules/google-font-preconnect.d.ts +0 -5
- package/dist/rules/google-font-preconnect.js +0 -82
- package/dist/rules/google-font-preconnect.js.map +0 -1
- package/dist/rules/inline-script-id.cjs +0 -94
- package/dist/rules/inline-script-id.cjs.map +0 -1
- package/dist/rules/inline-script-id.d.cts +0 -5
- package/dist/rules/inline-script-id.d.ts +0 -5
- package/dist/rules/inline-script-id.js +0 -67
- package/dist/rules/inline-script-id.js.map +0 -1
- package/dist/rules/next-script-for-ga.cjs +0 -129
- package/dist/rules/next-script-for-ga.cjs.map +0 -1
- package/dist/rules/next-script-for-ga.d.cts +0 -5
- package/dist/rules/next-script-for-ga.d.ts +0 -5
- package/dist/rules/next-script-for-ga.js +0 -102
- package/dist/rules/next-script-for-ga.js.map +0 -1
- package/dist/rules/no-assign-module-variable.cjs +0 -64
- package/dist/rules/no-assign-module-variable.cjs.map +0 -1
- package/dist/rules/no-assign-module-variable.d.cts +0 -5
- package/dist/rules/no-assign-module-variable.d.ts +0 -5
- package/dist/rules/no-assign-module-variable.js +0 -37
- package/dist/rules/no-assign-module-variable.js.map +0 -1
- package/dist/rules/no-async-client-component.cjs +0 -99
- package/dist/rules/no-async-client-component.cjs.map +0 -1
- package/dist/rules/no-async-client-component.d.cts +0 -5
- package/dist/rules/no-async-client-component.d.ts +0 -5
- package/dist/rules/no-async-client-component.js +0 -72
- package/dist/rules/no-async-client-component.js.map +0 -1
- package/dist/rules/no-before-interactive-script-outside-document.cjs +0 -94
- package/dist/rules/no-before-interactive-script-outside-document.cjs.map +0 -1
- package/dist/rules/no-before-interactive-script-outside-document.d.cts +0 -5
- package/dist/rules/no-before-interactive-script-outside-document.d.ts +0 -5
- package/dist/rules/no-before-interactive-script-outside-document.js +0 -59
- package/dist/rules/no-before-interactive-script-outside-document.js.map +0 -1
- package/dist/rules/no-css-tags.cjs +0 -70
- package/dist/rules/no-css-tags.cjs.map +0 -1
- package/dist/rules/no-css-tags.d.cts +0 -5
- package/dist/rules/no-css-tags.d.ts +0 -5
- package/dist/rules/no-css-tags.js +0 -43
- package/dist/rules/no-css-tags.js.map +0 -1
- package/dist/rules/no-document-import-in-page.cjs +0 -74
- package/dist/rules/no-document-import-in-page.cjs.map +0 -1
- package/dist/rules/no-document-import-in-page.d.cts +0 -5
- package/dist/rules/no-document-import-in-page.d.ts +0 -5
- package/dist/rules/no-document-import-in-page.js +0 -39
- package/dist/rules/no-document-import-in-page.js.map +0 -1
- package/dist/rules/no-duplicate-head.cjs +0 -87
- package/dist/rules/no-duplicate-head.cjs.map +0 -1
- package/dist/rules/no-duplicate-head.d.cts +0 -5
- package/dist/rules/no-duplicate-head.d.ts +0 -5
- package/dist/rules/no-duplicate-head.js +0 -60
- package/dist/rules/no-duplicate-head.js.map +0 -1
- package/dist/rules/no-head-element.cjs +0 -76
- package/dist/rules/no-head-element.cjs.map +0 -1
- package/dist/rules/no-head-element.d.cts +0 -5
- package/dist/rules/no-head-element.d.ts +0 -5
- package/dist/rules/no-head-element.js +0 -41
- package/dist/rules/no-head-element.js.map +0 -1
- package/dist/rules/no-head-import-in-document.cjs +0 -76
- package/dist/rules/no-head-import-in-document.cjs.map +0 -1
- package/dist/rules/no-head-import-in-document.d.cts +0 -5
- package/dist/rules/no-head-import-in-document.d.ts +0 -5
- package/dist/rules/no-head-import-in-document.js +0 -41
- package/dist/rules/no-head-import-in-document.js.map +0 -1
- package/dist/rules/no-html-link-for-pages.cjs +0 -302
- package/dist/rules/no-html-link-for-pages.cjs.map +0 -1
- package/dist/rules/no-html-link-for-pages.d.cts +0 -5
- package/dist/rules/no-html-link-for-pages.d.ts +0 -5
- package/dist/rules/no-html-link-for-pages.js +0 -267
- package/dist/rules/no-html-link-for-pages.js.map +0 -1
- package/dist/rules/no-img-element.cjs +0 -83
- package/dist/rules/no-img-element.cjs.map +0 -1
- package/dist/rules/no-img-element.d.cts +0 -5
- package/dist/rules/no-img-element.d.ts +0 -5
- package/dist/rules/no-img-element.js +0 -48
- package/dist/rules/no-img-element.js.map +0 -1
- package/dist/rules/no-page-custom-font.cjs +0 -184
- package/dist/rules/no-page-custom-font.cjs.map +0 -1
- package/dist/rules/no-page-custom-font.d.cts +0 -5
- package/dist/rules/no-page-custom-font.d.ts +0 -5
- package/dist/rules/no-page-custom-font.js +0 -159
- package/dist/rules/no-page-custom-font.js.map +0 -1
- package/dist/rules/no-script-component-in-head.cjs +0 -74
- package/dist/rules/no-script-component-in-head.cjs.map +0 -1
- package/dist/rules/no-script-component-in-head.d.cts +0 -5
- package/dist/rules/no-script-component-in-head.d.ts +0 -5
- package/dist/rules/no-script-component-in-head.js +0 -47
- package/dist/rules/no-script-component-in-head.js.map +0 -1
- package/dist/rules/no-styled-jsx-in-document.cjs +0 -78
- package/dist/rules/no-styled-jsx-in-document.cjs.map +0 -1
- package/dist/rules/no-styled-jsx-in-document.d.cts +0 -5
- package/dist/rules/no-styled-jsx-in-document.d.ts +0 -5
- package/dist/rules/no-styled-jsx-in-document.js +0 -43
- package/dist/rules/no-styled-jsx-in-document.js.map +0 -1
- package/dist/rules/no-sync-scripts.cjs +0 -64
- package/dist/rules/no-sync-scripts.cjs.map +0 -1
- package/dist/rules/no-sync-scripts.d.cts +0 -5
- package/dist/rules/no-sync-scripts.d.ts +0 -5
- package/dist/rules/no-sync-scripts.js +0 -37
- package/dist/rules/no-sync-scripts.js.map +0 -1
- package/dist/rules/no-title-in-document-head.cjs +0 -78
- package/dist/rules/no-title-in-document-head.cjs.map +0 -1
- package/dist/rules/no-title-in-document-head.d.cts +0 -5
- package/dist/rules/no-title-in-document-head.d.ts +0 -5
- package/dist/rules/no-title-in-document-head.js +0 -51
- package/dist/rules/no-title-in-document-head.js.map +0 -1
- package/dist/rules/no-typos.cjs +0 -133
- package/dist/rules/no-typos.cjs.map +0 -1
- package/dist/rules/no-typos.d.cts +0 -5
- package/dist/rules/no-typos.d.ts +0 -5
- package/dist/rules/no-typos.js +0 -98
- package/dist/rules/no-typos.js.map +0 -1
- package/dist/rules/no-unwanted-polyfillio.cjs +0 -164
- package/dist/rules/no-unwanted-polyfillio.cjs.map +0 -1
- package/dist/rules/no-unwanted-polyfillio.d.cts +0 -5
- package/dist/rules/no-unwanted-polyfillio.d.ts +0 -5
- package/dist/rules/no-unwanted-polyfillio.js +0 -137
- package/dist/rules/no-unwanted-polyfillio.js.map +0 -1
- package/dist/utils/define-rule.cjs +0 -31
- package/dist/utils/define-rule.cjs.map +0 -1
- package/dist/utils/define-rule.d.cts +0 -5
- package/dist/utils/define-rule.d.ts +0 -5
- package/dist/utils/define-rule.js +0 -6
- package/dist/utils/define-rule.js.map +0 -1
- package/dist/utils/get-root-dirs.cjs +0 -60
- package/dist/utils/get-root-dirs.cjs.map +0 -1
- package/dist/utils/get-root-dirs.d.cts +0 -8
- package/dist/utils/get-root-dirs.d.ts +0 -8
- package/dist/utils/get-root-dirs.js +0 -25
- package/dist/utils/get-root-dirs.js.map +0 -1
- package/dist/utils/node-attributes.cjs +0 -67
- package/dist/utils/node-attributes.cjs.map +0 -1
- package/dist/utils/node-attributes.d.cts +0 -15
- package/dist/utils/node-attributes.d.ts +0 -15
- package/dist/utils/node-attributes.js +0 -46
- package/dist/utils/node-attributes.js.map +0 -1
- package/dist/utils/url.cjs +0 -167
- package/dist/utils/url.cjs.map +0 -1
- package/dist/utils/url.d.cts +0 -35
- package/dist/utils/url.d.ts +0 -35
- package/dist/utils/url.js +0 -128
- package/dist/utils/url.js.map +0 -1
package/dist/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/utils/define-rule.ts","../src/utils/node-attributes.ts","../src/rules/google-font-display.ts","../src/rules/google-font-preconnect.ts","../src/rules/inline-script-id.ts","../src/rules/next-script-for-ga.ts","../src/rules/no-assign-module-variable.ts","../src/rules/no-async-client-component.ts","../src/rules/no-before-interactive-script-outside-document.ts","../src/rules/no-css-tags.ts","../src/rules/no-document-import-in-page.ts","../src/rules/no-duplicate-head.ts","../src/rules/no-head-element.ts","../src/rules/no-head-import-in-document.ts","../src/rules/no-html-link-for-pages.ts","../src/utils/get-root-dirs.ts","../src/utils/url.ts","../src/rules/no-img-element.ts","../src/rules/no-page-custom-font.ts","../src/rules/no-script-component-in-head.ts","../src/rules/no-styled-jsx-in-document.ts","../src/rules/no-sync-scripts.ts","../src/rules/no-title-in-document-head.ts","../src/rules/no-typos.ts","../src/rules/no-unwanted-polyfillio.ts","../src/index.ts"],"sourcesContent":["import type { Rule } from \"eslint\";\n\nexport const defineRule = (rule: Rule.RuleModule): Rule.RuleModule => rule;\n","// Return attributes and values of a node in a convenient way:\n/* example: \n <ExampleElement attr1=\"15\" attr2>\n { attr1: {\n hasValue: true,\n value: 15\n },\n attr2: {\n hasValue: false\n }\nInclusion of hasValue is in case an eslint rule cares about boolean values\nexplicitly assigned to attribute vs the attribute being used as a flag\n*/\nexport default class NodeAttributes {\n attributes: Record<\n string,\n | {\n hasValue: true;\n value: any;\n }\n | {\n hasValue?: false;\n }\n >;\n\n constructor(ASTnode: any) {\n this.attributes = {};\n ASTnode.attributes.forEach((attribute: any) => {\n if (!attribute.type || attribute.type !== \"JSXAttribute\") {\n return;\n }\n\n if (attribute.value) {\n // hasValue\n const value =\n typeof attribute.value.value === \"string\" ? attribute.value.value\n : typeof attribute.value.expression?.value !== \"undefined\" ?\n attribute.value.expression.value\n : attribute.value.expression?.properties;\n\n this.attributes[attribute.name.name] = {\n hasValue: true,\n value,\n };\n } else {\n this.attributes[attribute.name.name] = {\n hasValue: false,\n };\n }\n });\n }\n\n has(attrName: string): boolean {\n return Boolean(this.attributes[attrName]);\n }\n\n hasAny(): boolean {\n return Boolean(Object.keys(this.attributes).length);\n }\n\n hasValue(attrName: string): boolean {\n return Boolean(this.attributes[attrName]?.hasValue);\n }\n\n value(attrName: string): any {\n const attr = this.attributes[attrName];\n\n if (!attr) {\n return true;\n }\n\n if (\"hasValue\" in attr && attr.hasValue) {\n return attr.value;\n }\n\n return undefined;\n }\n}\n","import type { Rule } from \"eslint\";\n\nimport { defineRule } from \"../utils/define-rule.js\";\nimport NodeAttributes from \"../utils/node-attributes.js\";\n\nconst url = \"https://nextjs.org/docs/messages/google-font-display\";\n\n/**\n * Rule to enforce font-display behavior with Google Fonts\n */\nexport const googleFontDisplay = defineRule({\n create: (context: Rule.RuleContext) => ({\n JSXOpeningElement: (node: any) => {\n let message: string | undefined;\n\n if (node.name.name !== \"link\") {\n return;\n }\n\n const attributes = new NodeAttributes(node);\n if (!attributes.has(\"href\") || !attributes.hasValue(\"href\")) {\n return;\n }\n\n const hrefValue = attributes.value(\"href\");\n const isGoogleFont =\n typeof hrefValue === \"string\" &&\n hrefValue.startsWith(\"https://fonts.googleapis.com/css\");\n\n if (isGoogleFont) {\n // @ts-expect-error initial override, TODO: fix\n const params = new URLSearchParams(hrefValue.split(\"?\", 2)[1]);\n const displayValue = params.get(\"display\");\n\n if (!params.has(\"display\")) {\n message =\n \"A font-display parameter is missing (adding `&display=optional` is recommended).\";\n } else if (\n displayValue === \"auto\" ||\n displayValue === \"block\" ||\n displayValue === \"fallback\"\n ) {\n message = `${\n displayValue[0]?.toUpperCase() + displayValue.slice(1)\n } is not recommended.`;\n }\n }\n\n if (message) {\n context.report({\n message: `${message} See: ${url}`,\n node,\n });\n }\n },\n }),\n meta: {\n docs: {\n description: \"Enforce font-display behavior with Google Fonts.\",\n recommended: true,\n url,\n },\n schema: [],\n type: \"problem\",\n },\n});\n","import { defineRule } from \"../utils/define-rule.js\";\nimport NodeAttributes from \"../utils/node-attributes.js\";\n\nconst url = \"https://nextjs.org/docs/messages/google-font-preconnect\";\n\nexport const googleFontPreconnect = defineRule({\n create: (context: any) => ({\n JSXOpeningElement: (node: any) => {\n if (node.name.name !== \"link\") {\n return;\n }\n\n const attributes = new NodeAttributes(node);\n if (!attributes.has(\"href\") || !attributes.hasValue(\"href\")) {\n return;\n }\n\n const hrefValue = attributes.value(\"href\");\n const preconnectMissing =\n !attributes.has(\"rel\") ||\n !attributes.hasValue(\"rel\") ||\n attributes.value(\"rel\") !== \"preconnect\";\n\n if (\n typeof hrefValue === \"string\" &&\n hrefValue.startsWith(\"https://fonts.gstatic.com\") &&\n preconnectMissing\n ) {\n context.report({\n message: `\\`rel=\"preconnect\"\\` is missing from Google Font. See: ${url}`,\n node,\n });\n }\n },\n }),\n meta: {\n docs: {\n description: \"Ensure `preconnect` is used with Google Fonts.\",\n recommended: true,\n url,\n },\n schema: [],\n type: \"problem\",\n },\n});\n","import { defineRule } from \"../utils/define-rule.js\";\n\nconst url = \"https://nextjs.org/docs/messages/inline-script-id\";\n\nexport const inlineScriptId = defineRule({\n create: (context) => {\n let nextScriptImportName: null | string = null;\n\n return {\n ImportDeclaration: (node: any) => {\n if (node.source.value === \"next/script\") {\n nextScriptImportName = node.specifiers[0].local.name;\n }\n },\n JSXElement: (node: any) => {\n if (nextScriptImportName === null) {\n return;\n }\n\n if (\n node.openingElement?.name &&\n node.openingElement.name.name !== nextScriptImportName\n ) {\n return;\n }\n\n const attributeNames = new Set();\n\n let hasNonCheckableSpreadAttribute = false;\n node.openingElement.attributes.forEach((attribute: any) => {\n // Early return if we already have a non-checkable spread attribute, for better performance\n if (hasNonCheckableSpreadAttribute) {\n return;\n }\n\n if (attribute.type === \"JSXAttribute\") {\n attributeNames.add(attribute.name.name);\n } else if (attribute.type === \"JSXSpreadAttribute\") {\n if (attribute.argument?.properties) {\n attribute.argument.properties.forEach((property: any) => {\n attributeNames.add(property.key.name);\n });\n } else {\n // JSXSpreadAttribute without properties is not checkable\n hasNonCheckableSpreadAttribute = true;\n }\n }\n });\n\n // https://github.com/vercel/next.js/issues/34030\n // If there is a non-checkable spread attribute, we simply ignore them\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (hasNonCheckableSpreadAttribute) {\n return;\n }\n\n if (\n node.children.length > 0 ||\n attributeNames.has(\"dangerouslySetInnerHTML\")\n ) {\n if (!attributeNames.has(\"id\")) {\n context.report({\n message: `\\`next/script\\` components with inline content must specify an \\`id\\` attribute. See: ${url}`,\n node,\n });\n }\n }\n },\n };\n },\n meta: {\n docs: {\n description:\n \"Enforce `id` attribute on `next/script` components with inline content.\",\n recommended: true,\n url,\n },\n schema: [],\n type: \"problem\",\n },\n});\n","import { defineRule } from \"../utils/define-rule.js\";\nimport NodeAttributes from \"../utils/node-attributes.js\";\n\nconst SUPPORTED_SRCS = [\n \"www.google-analytics.com/analytics.js\",\n \"www.googletagmanager.com/gtag/js\",\n];\nconst SUPPORTED_HTML_CONTENT_URLS = [\n \"www.google-analytics.com/analytics.js\",\n \"www.googletagmanager.com/gtm.js\",\n];\nconst description =\n \"Prefer `next/script` component when using the inline script for Google Analytics.\";\nconst url = \"https://nextjs.org/docs/messages/next-script-for-ga\";\nconst ERROR_MSG = `${description} See: ${url}`;\n\n// Check if one of the items in the list is a substring of the passed string\nconst containsStr = (str: string, strList: string[]) => {\n return strList.some((s) => str.includes(s));\n};\n\nexport const nextScriptForGa = defineRule({\n create: (context: any) => ({\n JSXOpeningElement: (node: any) => {\n if (node.name.name !== \"script\") {\n return;\n }\n if (node.attributes.length === 0) {\n return;\n }\n const attributes = new NodeAttributes(node);\n\n // Check if the Alternative async tag is being used to add GA.\n // https://developers.google.com/analytics/devguides/collection/analyticsjs#alternative_async_tag\n // https://developers.google.com/analytics/devguides/collection/gtagjs\n if (\n typeof attributes.value(\"src\") === \"string\" &&\n containsStr(attributes.value(\"src\"), SUPPORTED_SRCS)\n ) {\n return context.report({\n message: ERROR_MSG,\n node,\n });\n }\n\n // Check if inline script is being used to add GA.\n // https://developers.google.com/analytics/devguides/collection/analyticsjs#the_google_analytics_tag\n // https://developers.google.com/tag-manager/quickstart\n if (\n attributes.value(\"dangerouslySetInnerHTML\") &&\n attributes.value(\"dangerouslySetInnerHTML\").length > 0\n ) {\n const htmlContent = attributes.value(\"dangerouslySetInnerHTML\")[0].value\n .quasis?.[0].value.raw;\n if (\n htmlContent &&\n containsStr(htmlContent, SUPPORTED_HTML_CONTENT_URLS)\n ) {\n context.report({\n message: ERROR_MSG,\n node,\n });\n }\n }\n },\n }),\n meta: {\n docs: {\n description,\n recommended: true,\n url,\n },\n schema: [],\n type: \"problem\",\n },\n});\n","import { defineRule } from \"../utils/define-rule.js\";\nconst url = \"https://nextjs.org/docs/messages/no-assign-module-variable\";\n\nexport const noAssignModuleVariable = defineRule({\n create: (context: any) => ({\n VariableDeclaration: (node: any) => {\n // Checks node.declarations array for variable with id.name of `module`\n const moduleVariableFound = node.declarations.some((declaration: any) => {\n if (\"name\" in declaration.id) {\n return declaration.id.name === \"module\";\n }\n return false;\n });\n\n // Return early if no `module` variable is found\n if (!moduleVariableFound) {\n return;\n }\n\n context.report({\n message: `Do not assign to the variable \\`module\\`. See: ${url}`,\n node,\n });\n },\n }),\n\n meta: {\n docs: {\n description: \"Prevent assignment to the `module` variable.\",\n recommended: true,\n url,\n },\n schema: [],\n type: \"problem\",\n },\n});\n","import { defineRule } from \"../utils/define-rule.js\";\n\nconst url = \"https://nextjs.org/docs/messages/no-async-client-component\";\nconst description = \"Prevent client components from being async functions.\";\nconst message = `${description} See: ${url}`;\n\nconst isCapitalized = (str: string): boolean => /[A-Z]/.test(str[0] ?? \"\");\n\nexport const noAsyncClientComponent = defineRule({\n create: (context: any) => ({\n Program: (node: any) => {\n let isClientComponent = false;\n\n for (const block of node.body) {\n if (\n block.type === \"ExpressionStatement\" &&\n block.expression.type === \"Literal\" &&\n block.expression.value === \"use client\"\n ) {\n isClientComponent = true;\n }\n\n if (block.type === \"ExportDefaultDeclaration\" && isClientComponent) {\n // export default async function MyComponent() {...}\n if (\n block.declaration?.type === \"FunctionDeclaration\" &&\n block.declaration.async &&\n isCapitalized(block.declaration.id.name)\n ) {\n context.report({\n message,\n node: block,\n });\n }\n\n // async function MyComponent() {...}; export default MyComponent;\n if (\n block.declaration.type === \"Identifier\" &&\n isCapitalized(block.declaration.name)\n ) {\n const targetName = block.declaration.name;\n\n const functionDeclaration = node.body.find((localBlock: any) => {\n if (\n localBlock.type === \"FunctionDeclaration\" &&\n localBlock.id.name === targetName\n ) {\n return true;\n }\n\n if (\n localBlock.type === \"VariableDeclaration\" &&\n localBlock.declarations.find(\n (declaration: any) =>\n declaration.id?.type === \"Identifier\" &&\n declaration.id.name === targetName,\n )\n ) {\n return true;\n }\n\n return false;\n });\n\n if (\n functionDeclaration?.type === \"FunctionDeclaration\" &&\n functionDeclaration.async\n ) {\n context.report({\n message,\n node: functionDeclaration,\n });\n }\n\n if (functionDeclaration?.type === \"VariableDeclaration\") {\n const varDeclarator = functionDeclaration.declarations.find(\n (declaration: any) =>\n declaration.id?.type === \"Identifier\" &&\n declaration.id.name === targetName,\n );\n\n if (\n varDeclarator?.init?.type === \"ArrowFunctionExpression\" &&\n varDeclarator.init.async\n ) {\n context.report({\n message,\n node: functionDeclaration,\n });\n }\n }\n }\n }\n }\n },\n }),\n\n meta: {\n docs: {\n description,\n recommended: true,\n url,\n },\n schema: [],\n type: \"problem\",\n },\n});\n","import * as path from \"node:path\";\n\nimport { defineRule } from \"../utils/define-rule.js\";\n\nconst url =\n \"https://nextjs.org/docs/messages/no-before-interactive-script-outside-document\";\n\nconst convertToCorrectSeparator = (str: string) =>\n str.replaceAll(/[/\\\\]/g, path.sep);\n\nexport const noBeforeInteractiveScriptOutsideDocument = defineRule({\n create: (context: any) => {\n let scriptImportName: null | string = null;\n\n return {\n 'ImportDeclaration[source.value=\"next/script\"] > ImportDefaultSpecifier'(\n node: any,\n ) {\n scriptImportName = node.local.name;\n },\n JSXOpeningElement: (node: any) => {\n const pathname = convertToCorrectSeparator(context.filename);\n\n const isInAppDir = pathname.includes(`${path.sep}app${path.sep}`);\n\n // This rule shouldn't fire in `app/`\n if (isInAppDir) {\n return;\n }\n\n if (!scriptImportName) {\n return;\n }\n\n if (node.name && node.name.name !== scriptImportName) {\n return;\n }\n\n const strategy = node.attributes.find(\n (child: any) => child.name && child.name.name === \"strategy\",\n );\n\n if (!strategy?.value || strategy.value.value !== \"beforeInteractive\") {\n return;\n }\n\n const document = context.filename.split(\"pages\", 2)[1];\n if (document && path.parse(document).name.startsWith(\"_document\")) {\n return;\n }\n\n context.report({\n message: `\\`next/script\\`'s \\`beforeInteractive\\` strategy should not be used outside of \\`pages/_document.js\\`. See: ${url}`,\n node,\n });\n },\n };\n },\n meta: {\n docs: {\n description:\n \"Prevent usage of `next/script`'s `beforeInteractive` strategy outside of `pages/_document.js`.\",\n recommended: true,\n url,\n },\n schema: [],\n type: \"problem\",\n },\n});\n","import { defineRule } from \"../utils/define-rule.js\";\nconst url = \"https://nextjs.org/docs/messages/no-css-tags\";\n\nexport const noCssTags = defineRule({\n create: (context: any) => ({\n JSXOpeningElement: (node: any) => {\n if (node.name.name !== \"link\") {\n return;\n }\n if (node.attributes.length === 0) {\n return;\n }\n\n const attributes = node.attributes.filter(\n (attr: any) => attr.type === \"JSXAttribute\",\n );\n if (\n attributes.find(\n (attr: any) =>\n attr.name.name === \"rel\" && attr.value.value === \"stylesheet\",\n ) &&\n attributes.find(\n (attr: any) =>\n attr.name.name === \"href\" &&\n attr.value.type === \"Literal\" &&\n !/^https?/.test(attr.value.value),\n )\n ) {\n context.report({\n message: `Do not include stylesheets manually. See: ${url}`,\n node,\n });\n }\n },\n }),\n meta: {\n docs: {\n description: \"Prevent manual stylesheet tags.\",\n recommended: true,\n url,\n },\n schema: [],\n type: \"problem\",\n },\n});\n","import * as path from \"node:path\";\n\nimport { defineRule } from \"../utils/define-rule.js\";\n\nconst url = \"https://nextjs.org/docs/messages/no-document-import-in-page\";\n\nexport const noDocumentImportInPage = defineRule({\n create: (context) => ({\n ImportDeclaration: (node) => {\n if (node.source.value !== \"next/document\") {\n return;\n }\n\n const paths = context.filename.split(\"pages\");\n const page = paths[paths.length - 1];\n\n if (\n !page ||\n page.startsWith(`${path.sep}_document`) ||\n page.startsWith(`${path.posix.sep}_document`)\n ) {\n return;\n }\n\n context.report({\n message: `\\`<Document />\\` from \\`next/document\\` should not be imported outside of \\`pages/_document.js\\`. See: ${url}`,\n node,\n });\n },\n }),\n meta: {\n docs: {\n description:\n \"Prevent importing `next/document` outside of `pages/_document.js`.\",\n recommended: true,\n url,\n },\n schema: [],\n type: \"problem\",\n },\n});\n","import { defineRule } from \"../utils/define-rule.js\";\nconst url = \"https://nextjs.org/docs/messages/no-duplicate-head\";\n\nexport const noDuplicateHead = defineRule({\n create: (context) => {\n const { sourceCode } = context;\n let documentImportName: null | string = null;\n return {\n ImportDeclaration: (node) => {\n if (node.source.value === \"next/document\") {\n const documentImport = node.specifiers.find(\n ({ type }) => type === \"ImportDefaultSpecifier\",\n );\n if (documentImport?.local) {\n documentImportName = documentImport.local.name;\n }\n }\n },\n ReturnStatement: (node) => {\n const ancestors = sourceCode.getAncestors(node);\n const documentClass = ancestors.find(\n (ancestorNode) =>\n ancestorNode.type === \"ClassDeclaration\" &&\n ancestorNode.superClass &&\n \"name\" in ancestorNode.superClass &&\n ancestorNode.superClass.name === documentImportName,\n );\n\n if (!documentClass) {\n return;\n }\n\n if (\n node.argument &&\n \"children\" in node.argument &&\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n node.argument.children\n ) {\n const headComponents = node.argument.children.filter(\n (childrenNode: any) =>\n childrenNode.openingElement?.name &&\n childrenNode.openingElement.name.name === \"Head\",\n );\n\n if (headComponents.length > 1) {\n for (let i = 1; i < headComponents.length; i++) {\n context.report({\n message: `Do not include multiple instances of \\`<Head/>\\`. See: ${url}`,\n // @ts-expect-error initial override, TODO: fix\n node: headComponents[i],\n });\n }\n }\n }\n },\n };\n },\n meta: {\n docs: {\n description:\n \"Prevent duplicate usage of `<Head>` in `pages/_document.js`.\",\n recommended: true,\n url,\n },\n schema: [],\n type: \"problem\",\n },\n});\n","import path from \"node:path\";\n\nimport { defineRule } from \"../utils/define-rule.js\";\n\nconst url = \"https://nextjs.org/docs/messages/no-head-element\";\n\nexport const noHeadElement = defineRule({\n create: (context: any) => ({\n JSXOpeningElement: (node: any) => {\n const paths = context.filename;\n\n const isInAppDir = () =>\n // TODO: fix\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n paths.includes(`app${path.sep}`) ||\n paths.includes(`app${path.posix.sep}`);\n // Only lint the <head> element in pages directory\n if (node.name.name !== \"head\" || isInAppDir()) {\n return;\n }\n\n context.report({\n message: `Do not use \\`<head>\\` element. Use \\`<Head />\\` from \\`next/head\\` instead. See: ${url}`,\n node,\n });\n },\n }),\n meta: {\n docs: {\n category: \"HTML\",\n description: \"Prevent usage of `<head>` element.\",\n recommended: true,\n url,\n },\n schema: [],\n type: \"problem\",\n },\n});\n","import * as path from \"node:path\";\n\nimport { defineRule } from \"../utils/define-rule.js\";\n\nconst url = \"https://nextjs.org/docs/messages/no-head-import-in-document\";\n\nexport const noHeadImportInDocument = defineRule({\n create: (context: any) => ({\n ImportDeclaration: (node: any) => {\n if (node.source.value !== \"next/head\") {\n return;\n }\n\n const document = context.filename.split(\"pages\", 2)[1];\n if (!document) {\n return;\n }\n\n const { dir, name } = path.parse(document);\n\n if (\n name.startsWith(\"_document\") ||\n (dir === \"/_document\" && name === \"index\")\n ) {\n context.report({\n message: `\\`next/head\\` should not be imported in \\`pages${document}\\`. Use \\`<Head />\\` from \\`next/document\\` instead. See: ${url}`,\n node,\n });\n }\n },\n }),\n meta: {\n docs: {\n description: \"Prevent usage of `next/head` in `pages/_document.js`.\",\n recommended: true,\n url,\n },\n schema: [],\n type: \"problem\",\n },\n});\n","import * as fs from \"node:fs\";\nimport * as path from \"node:path\";\n\nimport { defineRule } from \"../utils/define-rule.js\";\nimport { getRootDirs } from \"../utils/get-root-dirs.js\";\nimport {\n execOnce,\n getUrlFromAppDirectory,\n getUrlFromPagesDirectories,\n normalizeURL,\n} from \"../utils/url.js\";\n\nconst pagesDirWarning = execOnce((pagesDirs) => {\n console.warn(\n `Pages directory cannot be found at ${pagesDirs.join(\" or \")}. ` +\n \"If using a custom path, please configure with the `no-html-link-for-pages` rule in your eslint config file.\",\n );\n});\n\n// Cache for fs.existsSync lookup.\n// Prevent multiple blocking IO requests that have already been calculated.\nconst fsExistsSyncCache: Record<string, boolean> = {};\n\nconst memoize = <T = any>(fn: (...args: any[]) => T) => {\n const cache: Record<string, T> = {};\n return (...args: any[]): T => {\n const key = JSON.stringify(args);\n cache[key] ??= fn(...args);\n return cache[key];\n };\n};\n\nconst cachedGetUrlFromPagesDirectories = memoize(getUrlFromPagesDirectories);\nconst cachedGetUrlFromAppDirectory = memoize(getUrlFromAppDirectory);\n\nconst url = \"https://nextjs.org/docs/messages/no-html-link-for-pages\";\n\nexport const noHtmlLinkForPages = defineRule({\n /**\n * Creates an ESLint rule listener.\n */\n create: (context) => {\n // @ts-expect-error initial override, TODO: fix\n const ruleOptions: (string | string[])[] = context.options;\n const [customPagesDirectory] = ruleOptions;\n\n const rootDirs = getRootDirs(context);\n\n const pagesDirs = (\n customPagesDirectory ?\n [customPagesDirectory]\n : rootDirs.map((dir) => [\n path.join(dir, \"pages\"),\n path.join(dir, \"src\", \"pages\"),\n ])).flat();\n\n const foundPagesDirs = pagesDirs.filter((dir) => {\n fsExistsSyncCache[dir] ??= fs.existsSync(dir);\n return fsExistsSyncCache[dir];\n });\n\n const appDirs = rootDirs\n .map((dir) => [path.join(dir, \"app\"), path.join(dir, \"src\", \"app\")])\n .flat();\n\n const foundAppDirs = appDirs.filter((dir) => {\n fsExistsSyncCache[dir] ??= fs.existsSync(dir);\n return fsExistsSyncCache[dir];\n });\n\n // warn if there are no pages and app directories\n if (foundPagesDirs.length === 0 && foundAppDirs.length === 0) {\n pagesDirWarning(pagesDirs);\n return {};\n }\n\n const pageUrls = cachedGetUrlFromPagesDirectories(\"/\", foundPagesDirs);\n const appDirUrls = cachedGetUrlFromAppDirectory(\"/\", foundAppDirs);\n const allUrlRegex = [...pageUrls, ...appDirUrls];\n\n return {\n JSXOpeningElement: (node: any) => {\n if (node.name.name !== \"a\") {\n return;\n }\n\n if (node.attributes.length === 0) {\n return;\n }\n\n const target = node.attributes.find(\n (attr: any) =>\n attr.type === \"JSXAttribute\" && attr.name.name === \"target\",\n );\n\n if (target && target.value.value === \"_blank\") {\n return;\n }\n\n const href = node.attributes.find(\n (attr: any) =>\n attr.type === \"JSXAttribute\" && attr.name.name === \"href\",\n );\n\n if (!href || (href.value && href.value.type !== \"Literal\")) {\n return;\n }\n\n const hasDownloadAttr = node.attributes.find(\n (attr: any) =>\n attr.type === \"JSXAttribute\" && attr.name.name === \"download\",\n );\n\n if (hasDownloadAttr) {\n return;\n }\n\n const hrefPath = normalizeURL(href.value.value);\n // Outgoing links are ignored\n\n if (/^(?<temp1>https?:\\/\\/|\\/\\/)/.test(hrefPath as string)) {\n return;\n }\n\n allUrlRegex.forEach((foundUrl) => {\n if (hrefPath && foundUrl.test(normalizeURL(hrefPath) as string)) {\n context.report({\n message: `Do not use an \\`<a>\\` element to navigate to \\`${hrefPath}\\`. Use \\`<Link />\\` from \\`next/link\\` instead. See: ${url}`,\n node,\n });\n }\n });\n },\n };\n },\n\n meta: {\n docs: {\n category: \"HTML\",\n description:\n \"Prevent usage of `<a>` elements to navigate to internal Next.js pages.\",\n recommended: true,\n url,\n },\n schema: [\n {\n oneOf: [\n {\n type: \"string\",\n },\n {\n items: {\n type: \"string\",\n },\n type: \"array\",\n uniqueItems: true,\n },\n ],\n },\n ],\n type: \"problem\",\n },\n});\n","import type { Rule } from \"eslint\";\n\nimport fastGlob from \"fast-glob\";\n\n/**\n * Process a Next.js root directory glob.\n */\nconst processRootDir = (rootDir: string): string[] => {\n return fastGlob.globSync(rootDir.replaceAll(\"\\\\\", \"/\"), {\n onlyDirectories: true,\n });\n};\n\n/**\n * Gets one or more Root, returns an array of root directories.\n */\nexport const getRootDirs = (context: Rule.RuleContext) => {\n let rootDirs = [context.cwd];\n\n const nextSettings: { rootDir?: string | string[] } =\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n context.settings.next || {};\n const rootDir = nextSettings.rootDir;\n\n if (typeof rootDir === \"string\") {\n rootDirs = processRootDir(rootDir);\n } else if (Array.isArray(rootDir)) {\n rootDirs = rootDir\n .map((dir) => (typeof dir === \"string\" ? processRootDir(dir) : []))\n .flat();\n }\n\n return rootDirs;\n};\n","import * as fs from \"node:fs\";\nimport * as path from \"node:path\";\n\n// Cache for fs.readdirSync lookup.\n// Prevent multiple blocking IO requests that have already been calculated.\nconst fsReadDirSyncCache: Record<string, fs.Dirent[]> = {};\n\n/**\n * Recursively parse directory for page URLs.\n */\nconst parseUrlForPages = (urlprefix: string, directory: string) => {\n fsReadDirSyncCache[directory] ??= fs.readdirSync(directory, {\n withFileTypes: true,\n });\n const res: string[] = [];\n fsReadDirSyncCache[directory].forEach((dirent) => {\n // TODO: this should account for all page extensions\n // not just js(x) and ts(x)\n if (/(?<temp2>\\.(?<temp1>j|t)sx?)$/.test(dirent.name)) {\n if (/^index(?<temp2>\\.(?<temp1>j|t)sx?)$/.test(dirent.name)) {\n res.push(\n `${urlprefix}${dirent.name.replace(/^index(?<temp2>\\.(?<temp1>j|t)sx?)$/, \"\")}`,\n );\n }\n res.push(\n `${urlprefix}${dirent.name.replace(/(?<temp2>\\.(?<temp1>j|t)sx?)$/, \"\")}`,\n );\n } else {\n const dirPath = path.join(directory, dirent.name);\n if (dirent.isDirectory() && !dirent.isSymbolicLink()) {\n res.push(...parseUrlForPages(`${urlprefix + dirent.name}/`, dirPath));\n }\n }\n });\n return res;\n};\n\n/**\n * Recursively parse app directory for URLs.\n */\nconst parseUrlForAppDir = (urlprefix: string, directory: string) => {\n fsReadDirSyncCache[directory] ??= fs.readdirSync(directory, {\n withFileTypes: true,\n });\n const res: string[] = [];\n fsReadDirSyncCache[directory].forEach((dirent) => {\n // TODO: this should account for all page extensions\n // not just js(x) and ts(x)\n if (/(?<temp2>\\.(?<temp1>j|t)sx?)$/.test(dirent.name)) {\n if (/^page(?<temp2>\\.(?<temp1>j|t)sx?)$/.test(dirent.name)) {\n res.push(\n `${urlprefix}${dirent.name.replace(/^page(?<temp2>\\.(?<temp1>j|t)sx?)$/, \"\")}`,\n );\n } else if (!/^layout(?<temp2>\\.(?<temp1>j|t)sx?)$/.test(dirent.name)) {\n res.push(\n `${urlprefix}${dirent.name.replace(/(?<temp2>\\.(?<temp1>j|t)sx?)$/, \"\")}`,\n );\n }\n } else {\n const dirPath = path.join(directory, dirent.name);\n // @ts-expect-error - types suggest this shouldn't take an arg, but I don't want to change anything\n if (dirent.isDirectory(dirPath) && !dirent.isSymbolicLink()) {\n res.push(...parseUrlForPages(`${urlprefix + dirent.name}/`, dirPath));\n }\n }\n });\n return res;\n};\n\n/**\n * Takes a URL and does the following things.\n * - Replaces `index.html` with `/`\n * - Makes sure all URLs are have a trailing `/`\n * - Removes query string\n */\nexport const normalizeURL = (url: string) => {\n if (!url) {\n return;\n }\n url = url.split(\"?\", 1)[0] as string;\n url = url.split(\"#\", 1)[0] as string;\n url = url.replace(/(?<temp1>\\/index\\.html)$/, \"/\");\n // Empty URLs should not be trailed with `/`, e.g. `#heading`\n if (url === \"\") {\n return url;\n }\n url = url.endsWith(\"/\") ? url : `${url}/`;\n return url;\n};\n\n/**\n * Normalizes an app route so it represents the actual request path. Essentially\n * performing the following transformations:\n *\n * - `/(dashboard)/user/[id]/page` to `/user/[id]`\n * - `/(dashboard)/account/page` to `/account`\n * - `/user/[id]/page` to `/user/[id]`\n * - `/account/page` to `/account`\n * - `/page` to `/`\n * - `/(dashboard)/user/[id]/route` to `/user/[id]`\n * - `/(dashboard)/account/route` to `/account`\n * - `/user/[id]/route` to `/user/[id]`\n * - `/account/route` to `/account`\n * - `/route` to `/`\n * - `/` to `/`\n *\n * @param route the app route to normalize\n * @returns the normalized pathname\n */\nexport const normalizeAppPath = (route: string) =>\n ensureLeadingSlash(\n route.split(\"/\").reduce((pathname, segment, index, segments) => {\n // Empty segments are ignored.\n if (!segment) {\n return pathname;\n }\n\n // Groups are ignored.\n if (isGroupSegment(segment)) {\n return pathname;\n }\n\n // Parallel segments are ignored.\n if (segment.startsWith(\"@\")) {\n return pathname;\n }\n\n // The last segment (if it's a leaf) should be ignored.\n if (\n (segment === \"page\" || segment === \"route\") &&\n index === segments.length - 1\n ) {\n return pathname;\n }\n\n return `${pathname}/${segment}`;\n }, \"\"),\n );\n\n/**\n * Gets the possible URLs from a directory.\n */\nexport const getUrlFromPagesDirectories = (\n urlPrefix: string,\n directories: string[],\n) =>\n Array.from(\n // De-duplicate similar pages across multiple directories.\n new Set(\n directories\n .flatMap((directory) => parseUrlForPages(urlPrefix, directory))\n .map(\n // Since the URLs are normalized we add `^` and `$` to the RegExp to make sure they match exactly.\n (url) => `^${normalizeURL(url)}$`,\n ),\n ),\n ).map((urlReg) => {\n urlReg = urlReg.replaceAll(/\\[.*]/g, \"((?!.+?\\\\..+?).*?)\");\n return new RegExp(urlReg);\n });\n\nexport const getUrlFromAppDirectory = (\n urlPrefix: string,\n directories: string[],\n) =>\n Array.from(\n // De-duplicate similar pages across multiple directories.\n new Set(\n directories\n .map((directory) => parseUrlForAppDir(urlPrefix, directory))\n .flat()\n .map(\n // Since the URLs are normalized we add `^` and `$` to the RegExp to make sure they match exactly.\n (url) => `^${normalizeAppPath(url)}$`,\n ),\n ),\n ).map((urlReg) => {\n urlReg = urlReg.replaceAll(/\\[.*]/g, \"((?!.+?\\\\..+?).*?)\");\n return new RegExp(urlReg);\n });\n\nexport const execOnce = <TArgs extends any[], TResult>(\n fn: (...args: TArgs) => TResult,\n): ((...args: TArgs) => TResult) => {\n let used = false;\n let result: TResult;\n\n return (...args: TArgs) => {\n if (!used) {\n used = true;\n result = fn(...args);\n }\n return result;\n };\n};\n\nconst ensureLeadingSlash = (route: string) =>\n route.startsWith(\"/\") ? route : `/${route}`;\n\nconst isGroupSegment = (segment: string) =>\n segment.startsWith(\"(\") && segment.endsWith(\")\");\n","import path from \"node:path\";\n\nimport { defineRule } from \"../utils/define-rule.js\";\n\nconst url = \"https://nextjs.org/docs/messages/no-img-element\";\n\nexport const noImgElement = defineRule({\n create: (context: any) => {\n // Get relative path of the file\n const relativePath = context.filename\n .replace(path.sep, \"/\")\n .replace(context.cwd, \"\")\n .replace(/^\\//, \"\");\n\n const isAppDir = /^(?<temp1>src\\/)?app\\//.test(relativePath);\n\n return {\n JSXOpeningElement: (node: any) => {\n if (node.name.name !== \"img\") {\n return;\n }\n\n if (node.attributes.length === 0) {\n return;\n }\n\n if (node.parent?.parent?.openingElement?.name?.name === \"picture\") {\n return;\n }\n\n // If is metadata route files, ignore\n // e.g. opengraph-image.js, twitter-image.js, icon.js\n if (\n isAppDir &&\n /\\/opengraph-image|twitter-image|icon\\.\\w+$/.test(relativePath)\n ) {\n return;\n }\n\n context.report({\n message: `Using \\`<img>\\` could result in slower LCP and higher bandwidth. Consider using \\`<Image />\\` from \\`next/image\\` or a custom image loader to automatically optimize images. This may incur additional usage or cost from your provider. See: ${url}`,\n node,\n });\n },\n };\n },\n meta: {\n docs: {\n category: \"HTML\",\n description:\n \"Prevent usage of `<img>` element due to slower LCP and higher bandwidth.\",\n recommended: true,\n url,\n },\n schema: [],\n type: \"problem\",\n },\n});\n","import type { AST } from \"eslint\";\n\nimport { posix, sep } from \"node:path\";\n\nimport { defineRule } from \"../utils/define-rule.js\";\nimport NodeAttributes from \"../utils/node-attributes.js\";\n\nconst url = \"https://nextjs.org/docs/messages/no-page-custom-font\";\n\nconst isIdentifierMatch = (id1: any, id2: any): boolean =>\n (id1 === null && id2 === null) || (id1 && id2 && id1.name === id2.name);\n\nexport const noPageCustomFont = defineRule({\n create: (context: any): any => {\n const { sourceCode } = context;\n const paths = context.filename.split(\"pages\");\n const page = paths[paths.length - 1];\n\n // outside of a file within `pages`, bail\n if (!page) {\n return {};\n }\n\n const isDocument =\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n page.startsWith(`${sep}_document`) ||\n page.startsWith(`${posix.sep}_document`);\n\n let documentImportName: string | undefined;\n let localDefaultExportId: any;\n let exportDeclarationType: string | undefined;\n\n return {\n ExportDefaultDeclaration: (node: any): void => {\n exportDeclarationType = node.declaration.type;\n\n if (node.declaration.type === \"FunctionDeclaration\") {\n localDefaultExportId = node.declaration.id;\n return;\n }\n\n if (\n node.declaration.type === \"ClassDeclaration\" &&\n node.declaration.superClass &&\n \"name\" in node.declaration.superClass &&\n node.declaration.superClass.name === documentImportName\n ) {\n localDefaultExportId = node.declaration.id;\n }\n },\n\n ImportDeclaration: (node: any): void => {\n if (node.source.value === \"next/document\") {\n const documentImport = node.specifiers.find(\n ({ type }: { type: string }) => type === \"ImportDefaultSpecifier\",\n );\n if (documentImport?.local) {\n documentImportName = documentImport.local.name;\n }\n }\n },\n\n JSXOpeningElement: (node: any): void => {\n if (node.name.name !== \"link\") {\n return;\n }\n\n const ancestors = sourceCode.getAncestors(node);\n\n // if `export default <n>` is further down within the file after the\n // currently traversed component, then `localDefaultExportName` will\n // still be undefined\n if (!localDefaultExportId) {\n // find the top level of the module\n const program = ancestors.find(\n (ancestor: any) => ancestor.type === \"Program\",\n ) as AST.Program;\n\n // go over each token to find the combination of `export default <n>`\n for (let i = 0; i <= program.tokens.length - 1; i++) {\n if (localDefaultExportId) {\n break;\n }\n\n const token = program.tokens[i];\n\n if (token?.type === \"Keyword\" && token.value === \"export\") {\n const nextToken = program.tokens[i + 1];\n\n if (\n nextToken &&\n nextToken.type === \"Keyword\" &&\n nextToken.value === \"default\"\n ) {\n const maybeIdentifier = program.tokens[i + 2];\n\n if (maybeIdentifier && maybeIdentifier.type === \"Identifier\") {\n localDefaultExportId = { name: maybeIdentifier.value };\n }\n }\n }\n }\n }\n\n const parentComponent = ancestors.find((ancestor: any) => {\n // export default class ... extends ...\n if (exportDeclarationType === \"ClassDeclaration\") {\n return (\n ancestor.type === exportDeclarationType &&\n \"superClass\" in ancestor &&\n ancestor.superClass &&\n \"name\" in ancestor.superClass &&\n ancestor.superClass.name === documentImportName\n );\n }\n\n if (\"id\" in ancestor) {\n // export default function ...\n if (exportDeclarationType === \"FunctionDeclaration\") {\n return (\n ancestor.type === exportDeclarationType &&\n isIdentifierMatch(ancestor.id, localDefaultExportId)\n );\n }\n\n // function ...() {} export default ...\n // class ... extends ...; export default ...\n return isIdentifierMatch(ancestor.id, localDefaultExportId);\n }\n\n return false;\n });\n\n // file starts with _document and this <link /> is within the default export\n if (isDocument && parentComponent) {\n return;\n }\n\n const attributes = new NodeAttributes(node);\n if (!attributes.has(\"href\") || !attributes.hasValue(\"href\")) {\n return;\n }\n\n const hrefValue = attributes.value(\"href\");\n const isGoogleFont =\n typeof hrefValue === \"string\" &&\n hrefValue.startsWith(\"https://fonts.googleapis.com/css\");\n\n if (isGoogleFont) {\n const end = `This is discouraged. See: ${url}`;\n\n const message =\n isDocument ?\n `Using \\`<link />\\` outside of \\`<Head>\\` will disable automatic font optimization. ${end}`\n : `Custom fonts not added in \\`pages/_document.js\\` will only load for a single page. ${end}`;\n\n context.report({\n message,\n node,\n });\n }\n },\n };\n },\n meta: {\n docs: {\n description: \"Prevent page-only custom fonts.\",\n recommended: true,\n url,\n },\n schema: [],\n type: \"problem\",\n },\n});\n","import { defineRule } from \"../utils/define-rule.js\";\nconst url = \"https://nextjs.org/docs/messages/no-script-component-in-head\";\n\nexport const noScriptComponentInHead = defineRule({\n create: (context: any) => {\n let isNextHead: null | string = null;\n\n return {\n ImportDeclaration: (node: any) => {\n if (node.source.value === \"next/head\") {\n isNextHead = node.source.value;\n }\n },\n JSXElement: (node: any) => {\n if (!isNextHead) {\n return;\n }\n\n if (\n node.openingElement?.name &&\n node.openingElement.name.name !== \"Head\"\n ) {\n return;\n }\n\n const scriptTag = node.children.find(\n (child: any) =>\n child.openingElement?.name &&\n child.openingElement.name.name === \"Script\",\n );\n\n if (scriptTag) {\n context.report({\n message: `\\`next/script\\` should not be used in \\`next/head\\` component. Move \\`<Script />\\` outside of \\`<Head>\\` instead. See: ${url}`,\n node,\n });\n }\n },\n };\n },\n meta: {\n docs: {\n description: \"Prevent usage of `next/script` in `next/head` component.\",\n recommended: true,\n url,\n },\n schema: [],\n type: \"problem\",\n },\n});\n","import * as path from \"node:path\";\n\nimport { defineRule } from \"../utils/define-rule.js\";\n\nconst url = \"https://nextjs.org/docs/messages/no-styled-jsx-in-document\";\n\nexport const noStyledJsxInDocument = defineRule({\n create: (context: any) => ({\n JSXOpeningElement: (node: any) => {\n const document = context.filename.split(\"pages\", 2)[1];\n if (!document) {\n return;\n }\n const { dir, name } = path.parse(document);\n\n if (\n !(\n name.startsWith(\"_document\") ||\n (dir === \"/_document\" && name === \"index\")\n )\n ) {\n return;\n }\n\n if (\n node.name.name === \"style\" &&\n node.attributes.find(\n (attr: any) =>\n attr.type === \"JSXAttribute\" && attr.name.name === \"jsx\",\n )\n ) {\n context.report({\n message: `\\`styled-jsx\\` should not be used in \\`pages/_document.js\\`. See: ${url}`,\n node,\n });\n }\n },\n }),\n meta: {\n docs: {\n description: \"Prevent usage of `styled-jsx` in `pages/_document.js`.\",\n recommended: true,\n url,\n },\n schema: [],\n type: \"problem\",\n },\n});\n","import { defineRule } from \"../utils/define-rule.js\";\n\nconst url = \"https://nextjs.org/docs/messages/no-sync-scripts\";\n\nexport const noSyncScripts = defineRule({\n create: (context: any) => ({\n JSXOpeningElement: (node: any) => {\n if (node.name.name !== \"script\") {\n return;\n }\n if (node.attributes.length === 0) {\n return;\n }\n const attributeNames = node.attributes\n .filter((attr: any) => attr.type === \"JSXAttribute\")\n .map((attr: any) => attr.name.name);\n if (\n attributeNames.includes(\"src\") &&\n !attributeNames.includes(\"async\") &&\n !attributeNames.includes(\"defer\")\n ) {\n context.report({\n message: `Synchronous scripts should not be used. See: ${url}`,\n node,\n });\n }\n },\n }),\n meta: {\n docs: {\n description: \"Prevent synchronous scripts.\",\n recommended: true,\n url,\n },\n schema: [],\n type: \"problem\",\n },\n});\n","import { defineRule } from \"../utils/define-rule.js\";\nconst url = \"https://nextjs.org/docs/messages/no-title-in-document-head\";\n\nexport const noTitleInDocumentHead = defineRule({\n create: (context: any) => {\n let headFromNextDocument = false;\n return {\n ImportDeclaration: (node: any) => {\n if (node.source.value === \"next/document\") {\n if (\n node.specifiers.some(\n ({ local }: { local: any }) => local.name === \"Head\",\n )\n ) {\n headFromNextDocument = true;\n }\n }\n },\n JSXElement: (node: any) => {\n if (!headFromNextDocument) {\n return;\n }\n\n if (\n node.openingElement?.name &&\n node.openingElement.name.name !== \"Head\"\n ) {\n return;\n }\n\n const titleTag = node.children.find(\n (child: any) =>\n child.openingElement?.name &&\n child.openingElement.name.type === \"JSXIdentifier\" &&\n child.openingElement.name.name === \"title\",\n );\n\n if (titleTag) {\n context.report({\n message: `Do not use \\`<title>\\` element with \\`<Head />\\` component from \\`next/document\\`. Titles should defined at the page-level using \\`<Head />\\` from \\`next/head\\` instead. See: ${url}`,\n node: titleTag,\n });\n }\n },\n };\n },\n meta: {\n docs: {\n description:\n \"Prevent usage of `<title>` with `Head` component from `next/document`.\",\n recommended: true,\n url,\n },\n schema: [],\n type: \"problem\",\n },\n});\n","import * as path from \"node:path\";\n\nimport { defineRule } from \"../utils/define-rule.js\";\n\nconst NEXT_EXPORT_FUNCTIONS = [\n \"getStaticProps\",\n \"getStaticPaths\",\n \"getServerSideProps\",\n];\n\n// 0 is the exact match\nconst THRESHOLD = 1;\n\n// the minimum number of operations required to convert string a to string b.\nconst minDistance = (a: string, b: string): number | undefined => {\n const m = a.length;\n const n = b.length;\n\n if (m < n) {\n return minDistance(b, a);\n }\n\n if (n === 0) {\n return m;\n }\n\n let previousRow = Array.from({ length: n + 1 }, (_, i) => i);\n\n for (let i = 0; i < m; i++) {\n const s1 = a[i];\n const currentRow = [i + 1];\n for (let j = 0; j < n; j++) {\n const s2 = b[j];\n const insertions = (previousRow[j + 1] as any) + 1;\n const deletions = (currentRow[j] as any) + 1;\n const substitutions = (previousRow[j] as any) + Number(s1 !== s2);\n currentRow.push(Math.min(insertions, deletions, substitutions));\n }\n previousRow = currentRow;\n }\n return previousRow[previousRow.length - 1];\n};\n\nexport const noTypos = defineRule({\n create: (context: any) => {\n const checkTypos = (node: any, name: string) => {\n if (NEXT_EXPORT_FUNCTIONS.includes(name)) {\n return;\n }\n\n const potentialTypos = NEXT_EXPORT_FUNCTIONS.map((o) => ({\n distance: minDistance(o, name) ?? Infinity,\n option: o,\n }))\n .filter(({ distance }) => distance <= THRESHOLD && distance > 0)\n .sort((a, b) => a.distance - b.distance);\n\n if (potentialTypos.length) {\n context.report({\n message: `${name} may be a typo. Did you mean ${potentialTypos[0]?.option}?`,\n node,\n });\n }\n };\n return {\n ExportNamedDeclaration: (node: any) => {\n const page = context.filename.split(\"pages\", 2)[1];\n if (!page || path.parse(page).dir.startsWith(\"/api\")) {\n return;\n }\n\n const decl = node.declaration;\n\n if (!decl) {\n return;\n }\n\n switch (decl.type) {\n case \"FunctionDeclaration\": {\n checkTypos(node, decl.id.name);\n break;\n }\n case \"VariableDeclaration\": {\n decl.declarations.forEach((d: any) => {\n if (d.id.type !== \"Identifier\") {\n return;\n }\n checkTypos(node, d.id.name);\n });\n break;\n }\n default: {\n break;\n }\n }\n },\n };\n },\n\n meta: {\n docs: {\n description: \"Prevent common typos in Next.js data fetching functions.\",\n recommended: true,\n },\n schema: [],\n type: \"problem\",\n },\n});\n","import { defineRule } from \"../utils/define-rule.js\";\n\n// Keep in sync with next.js polyfills file : https://github.com/vercel/next.js/blob/master/packages/next-polyfill-nomodule/src/index.js\nconst NEXT_POLYFILLED_FEATURES = [\n \"Array.prototype.@@iterator\",\n \"Array.prototype.at\",\n \"Array.prototype.copyWithin\",\n \"Array.prototype.fill\",\n \"Array.prototype.find\",\n \"Array.prototype.findIndex\",\n \"Array.prototype.flatMap\",\n \"Array.prototype.flat\",\n \"Array.from\",\n \"Array.prototype.includes\",\n \"Array.of\",\n \"Function.prototype.name\",\n \"fetch\",\n \"Map\",\n \"Number.EPSILON\",\n \"Number.Epsilon\",\n \"Number.isFinite\",\n \"Number.isNaN\",\n \"Number.isInteger\",\n \"Number.isSafeInteger\",\n \"Number.MAX_SAFE_INTEGER\",\n \"Number.MIN_SAFE_INTEGER\",\n \"Number.parseFloat\",\n \"Number.parseInt\",\n \"Object.assign\",\n \"Object.entries\",\n \"Object.fromEntries\",\n \"Object.getOwnPropertyDescriptor\",\n \"Object.getOwnPropertyDescriptors\",\n \"Object.hasOwn\",\n \"Object.is\",\n \"Object.keys\",\n \"Object.values\",\n \"Reflect\",\n \"Set\",\n \"Symbol\",\n \"Symbol.asyncIterator\",\n \"String.prototype.codePointAt\",\n \"String.prototype.endsWith\",\n \"String.fromCodePoint\",\n \"String.prototype.includes\",\n \"String.prototype.@@iterator\",\n \"String.prototype.padEnd\",\n \"String.prototype.padStart\",\n \"String.prototype.repeat\",\n \"String.raw\",\n \"String.prototype.startsWith\",\n \"String.prototype.trimEnd\",\n \"String.prototype.trimStart\",\n \"URL\",\n \"URL.prototype.toJSON\",\n \"URLSearchParams\",\n \"WeakMap\",\n \"WeakSet\",\n \"Promise\",\n \"Promise.prototype.finally\",\n \"es2015\", // Should be covered by babel-preset-env instead.\n \"es2016\", // contains polyfilled 'Array.prototype.includes', 'String.prototype.padEnd' and 'String.prototype.padStart'\n \"es2017\", // contains polyfilled 'Object.entries', 'Object.getOwnPropertyDescriptors', 'Object.values', 'String.prototype.padEnd' and 'String.prototype.padStart'\n \"es2018\", // contains polyfilled 'Promise.prototype.finally' and ''Symbol.asyncIterator'\n \"es2019\", // Contains polyfilled 'Object.fromEntries' and polyfilled 'Array.prototype.flat', 'Array.prototype.flatMap', 'String.prototype.trimEnd' and 'String.prototype.trimStart'\n \"es5\", // Should be covered by babel-preset-env instead.\n \"es6\", // Should be covered by babel-preset-env instead.\n \"es7\", // contains polyfilled 'Array.prototype.includes', 'String.prototype.padEnd' and 'String.prototype.padStart'\n];\n\nconst url = \"https://nextjs.org/docs/messages/no-unwanted-polyfillio\";\n\n//------------------------------------------------------------------------------\n// Rule Definition\n//------------------------------------------------------------------------------\nexport const noUnwantedPolyfillio = defineRule({\n create: (context: any) => {\n let scriptImport: null | string = null;\n\n return {\n ImportDeclaration: (node: any) => {\n if (node.source && node.source.value === \"next/script\") {\n scriptImport = node.specifiers[0].local.name;\n }\n },\n JSXOpeningElement: (node: any) => {\n if (\n node.name &&\n node.name.name !== \"script\" &&\n node.name.name !== scriptImport\n ) {\n return;\n }\n if (node.attributes.length === 0) {\n return;\n }\n\n const srcNode = node.attributes.find(\n (attr: any) =>\n attr.type === \"JSXAttribute\" && attr.name.name === \"src\",\n );\n if (!srcNode || srcNode.value.type !== \"Literal\") {\n return;\n }\n const src = srcNode.value.value;\n if (\n src.startsWith(\"https://cdn.polyfill.io/v2/\") ||\n src.startsWith(\"https://polyfill.io/v3/\") ||\n // https://community.fastly.com/t/new-options-for-polyfill-io-users/2540\n src.startsWith(\"https://polyfill-fastly.net/\") ||\n src.startsWith(\"https://polyfill-fastly.io/\") ||\n // https://blog.cloudflare.com/polyfill-io-now-available-on-cdnjs-reduce-your-supply-chain-risk\n src.startsWith(\"https://cdnjs.cloudflare.com/polyfill/\")\n ) {\n const featureQueryString = new URL(src).searchParams.get(\"features\");\n const featuresRequested = (featureQueryString ?? \"\").split(\",\");\n const unwantedFeatures = featuresRequested.filter((feature) =>\n NEXT_POLYFILLED_FEATURES.includes(feature),\n );\n if (unwantedFeatures.length > 0) {\n context.report({\n message: `No duplicate polyfills from Polyfill.io are allowed. ${unwantedFeatures.join(\n \", \",\n )} ${\n unwantedFeatures.length > 1 ? \"are\" : \"is\"\n } already shipped with Next.js. See: ${url}`,\n node,\n });\n }\n }\n },\n };\n },\n\n meta: {\n docs: {\n category: \"HTML\",\n description: \"Prevent duplicate polyfills from Polyfill.io.\",\n recommended: true,\n url,\n },\n schema: [],\n type: \"problem\",\n },\n});\n","import type { ESLint, Linter, Rule } from \"eslint\";\n\nimport { googleFontDisplay } from \"./rules/google-font-display.js\";\nimport { googleFontPreconnect } from \"./rules/google-font-preconnect.js\";\nimport { inlineScriptId } from \"./rules/inline-script-id.js\";\nimport { nextScriptForGa } from \"./rules/next-script-for-ga.js\";\nimport { noAssignModuleVariable } from \"./rules/no-assign-module-variable.js\";\nimport { noAsyncClientComponent } from \"./rules/no-async-client-component.js\";\nimport { noBeforeInteractiveScriptOutsideDocument } from \"./rules/no-before-interactive-script-outside-document.js\";\nimport { noCssTags } from \"./rules/no-css-tags.js\";\nimport { noDocumentImportInPage } from \"./rules/no-document-import-in-page.js\";\nimport { noDuplicateHead } from \"./rules/no-duplicate-head.js\";\nimport { noHeadElement } from \"./rules/no-head-element.js\";\nimport { noHeadImportInDocument } from \"./rules/no-head-import-in-document.js\";\nimport { noHtmlLinkForPages } from \"./rules/no-html-link-for-pages.js\";\nimport { noImgElement } from \"./rules/no-img-element.js\";\nimport { noPageCustomFont } from \"./rules/no-page-custom-font.js\";\nimport { noScriptComponentInHead } from \"./rules/no-script-component-in-head.js\";\nimport { noStyledJsxInDocument } from \"./rules/no-styled-jsx-in-document.js\";\nimport { noSyncScripts } from \"./rules/no-sync-scripts.js\";\nimport { noTitleInDocumentHead } from \"./rules/no-title-in-document-head.js\";\nimport { noTypos } from \"./rules/no-typos.js\";\nimport { noUnwantedPolyfillio } from \"./rules/no-unwanted-polyfillio.js\";\n\n/**\n * The namespace prefix for all rules in this plugin\n */\nconst name = \"nextjs\";\n\ninterface PluginConfig extends ESLint.Plugin {\n configs: {\n \"core-web-vitals\": Linter.LegacyConfig;\n \"core-web-vitals/flat\": Linter.Config;\n recommended: Linter.LegacyConfig;\n \"recommended/flat\": Linter.Config;\n };\n name: string;\n rules: {\n \"nextjs/google-font-display\": Rule.RuleModule;\n \"nextjs/google-font-preconnect\": Rule.RuleModule;\n \"nextjs/inline-script-id\": Rule.RuleModule;\n \"nextjs/next-script-for-ga\": Rule.RuleModule;\n \"nextjs/no-assign-module-variable\": Rule.RuleModule;\n \"nextjs/no-async-client-component\": Rule.RuleModule;\n \"nextjs/no-before-interactive-script-outside-document\": Rule.RuleModule;\n \"nextjs/no-css-tags\": Rule.RuleModule;\n \"nextjs/no-document-import-in-page\": Rule.RuleModule;\n \"nextjs/no-duplicate-head\": Rule.RuleModule;\n \"nextjs/no-head-element\": Rule.RuleModule;\n \"nextjs/no-head-import-in-document\": Rule.RuleModule;\n \"nextjs/no-html-link-for-pages\": Rule.RuleModule;\n \"nextjs/no-img-element\": Rule.RuleModule;\n \"nextjs/no-page-custom-font\": Rule.RuleModule;\n \"nextjs/no-script-component-in-head\": Rule.RuleModule;\n \"nextjs/no-styled-jsx-in-document\": Rule.RuleModule;\n \"nextjs/no-sync-scripts\": Rule.RuleModule;\n \"nextjs/no-title-in-document-head\": Rule.RuleModule;\n \"nextjs/no-typos\": Rule.RuleModule;\n \"nextjs/no-unwanted-polyfillio\": Rule.RuleModule;\n };\n}\n\nconst plugin: ESLint.Plugin = {\n name,\n rules: {\n [`${name}/google-font-display`]: googleFontDisplay,\n [`${name}/google-font-preconnect`]: googleFontPreconnect,\n [`${name}/inline-script-id`]: inlineScriptId,\n [`${name}/next-script-for-ga`]: nextScriptForGa,\n [`${name}/no-assign-module-variable`]: noAssignModuleVariable,\n [`${name}/no-async-client-component`]: noAsyncClientComponent,\n [`${name}/no-before-interactive-script-outside-document`]:\n noBeforeInteractiveScriptOutsideDocument,\n [`${name}/no-css-tags`]: noCssTags,\n [`${name}/no-document-import-in-page`]: noDocumentImportInPage,\n [`${name}/no-duplicate-head`]: noDuplicateHead,\n [`${name}/no-head-element`]: noHeadElement,\n [`${name}/no-head-import-in-document`]: noHeadImportInDocument,\n [`${name}/no-html-link-for-pages`]: noHtmlLinkForPages,\n [`${name}/no-img-element`]: noImgElement,\n [`${name}/no-page-custom-font`]: noPageCustomFont,\n [`${name}/no-script-component-in-head`]: noScriptComponentInHead,\n [`${name}/no-styled-jsx-in-document`]: noStyledJsxInDocument,\n [`${name}/no-sync-scripts`]: noSyncScripts,\n [`${name}/no-title-in-document-head`]: noTitleInDocumentHead,\n [`${name}/no-typos`]: noTypos,\n [`${name}/no-unwanted-polyfillio`]: noUnwantedPolyfillio,\n },\n};\n\nconst recommendedRules: Linter.RulesRecord = {\n // warnings\n \"nextjs/google-font-display\": \"warn\",\n \"nextjs/google-font-preconnect\": \"warn\",\n // errors\n \"nextjs/inline-script-id\": \"error\",\n \"nextjs/next-script-for-ga\": \"warn\",\n \"nextjs/no-assign-module-variable\": \"error\",\n \"nextjs/no-async-client-component\": \"warn\",\n \"nextjs/no-before-interactive-script-outside-document\": \"warn\",\n \"nextjs/no-css-tags\": \"warn\",\n \"nextjs/no-document-import-in-page\": \"error\",\n \"nextjs/no-duplicate-head\": \"error\",\n \"nextjs/no-head-element\": \"warn\",\n \"nextjs/no-head-import-in-document\": \"error\",\n \"nextjs/no-html-link-for-pages\": \"warn\",\n \"nextjs/no-img-element\": \"warn\",\n \"nextjs/no-page-custom-font\": \"warn\",\n \"nextjs/no-script-component-in-head\": \"error\",\n \"nextjs/no-styled-jsx-in-document\": \"warn\",\n \"nextjs/no-sync-scripts\": \"warn\",\n \"nextjs/no-title-in-document-head\": \"warn\",\n \"nextjs/no-typos\": \"warn\",\n \"nextjs/no-unwanted-polyfillio\": \"warn\",\n};\n\nconst coreWebVitalsRules: Linter.RulesRecord = {\n ...recommendedRules,\n \"nextjs/no-html-link-for-pages\": \"error\",\n \"nextjs/no-sync-scripts\": \"error\",\n};\n\nconst createRuleConfig = (\n pluginName: string,\n rules: Linter.RulesRecord,\n isFlat = false,\n) => {\n return {\n plugins: isFlat ? { [pluginName]: plugin } : [pluginName],\n rules,\n };\n};\n\nconst recommendedFlatConfig = createRuleConfig(name, recommendedRules, true);\nconst recommendedLegacyConfig = createRuleConfig(name, recommendedRules, false);\nconst coreWebVitalsFlatConfig = createRuleConfig(\n name,\n coreWebVitalsRules,\n true,\n);\nconst coreWebVitalsLegacyConfig = createRuleConfig(\n name,\n coreWebVitalsRules,\n false,\n);\n\n/**\n * ESLint plugin for Next.js projects\n */\nexport default {\n ...plugin,\n configs: {\n /**\n * Legacy config (ESLint < v9) with Core Web Vitals rules (recommended with some warnings upgrade to errors)\n */\n \"core-web-vitals\": coreWebVitalsLegacyConfig,\n /**\n * Flat config (ESLint v9+) with Core Web Vitals rules (recommended with some warnings upgrade to errors)\n */\n \"core-web-vitals/flat\": coreWebVitalsFlatConfig,\n /**\n * Legacy config (ESLint < v9) with recommended rules\n */\n recommended: recommendedLegacyConfig,\n /**\n * Flat config (ESLint v9+) with recommended rules\n */\n \"recommended/flat\": recommendedFlatConfig,\n },\n} as PluginConfig;\n\nexport const rules = plugin.rules;\n"],"mappings":";AAEO,IAAM,aAAa,CAAC,SAA2C;;;ACWtE,IAAqB,iBAArB,MAAoC;AAAA,EAClC;AAAA,EAWA,YAAY,SAAc;AACxB,SAAK,aAAa,CAAC;AACnB,YAAQ,WAAW,QAAQ,CAAC,cAAmB;AAC7C,UAAI,CAAC,UAAU,QAAQ,UAAU,SAAS,gBAAgB;AACxD;AAAA,MACF;AAEA,UAAI,UAAU,OAAO;AAEnB,cAAM,QACJ,OAAO,UAAU,MAAM,UAAU,WAAW,UAAU,MAAM,QAC1D,OAAO,UAAU,MAAM,YAAY,UAAU,cAC7C,UAAU,MAAM,WAAW,QAC3B,UAAU,MAAM,YAAY;AAEhC,aAAK,WAAW,UAAU,KAAK,IAAI,IAAI;AAAA,UACrC,UAAU;AAAA,UACV;AAAA,QACF;AAAA,MACF,OA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kB,KAAK;AAC9E,IAAM,0BAA0B;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AACF;AACA,IAAM,4BAA4B;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AACF;AAKA,IAAO,gBAAQ;AAAA,EACb,GAAG;AAAA,EACH,SAAS;AAAA;AAAA;AAAA;AAAA,IAIP,mBAAmB;AAAA;AAAA;AAAA;AAAA,IAInB,wBAAwB;AAAA;AAAA;AAAA;AAAA,IAIxB,aAAa;AAAA;AAAA;AAAA;AAAA,IAIb,oBAAoB;AAAA,EACtB;AACF;AAEO,IAAM,QAAQ,OAAO;","names":["message","url","url","url","url","url","description","url","url","path","url","url","path","url","path","path","url","name","fs","path","path","url","url","path","url","path","posix","sep","url","sep","posix","message","url","path","url","name","url","url","path","name","url","rules"]}
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/rules/google-font-display.ts","../src/utils/node-attributes.ts","../src/rules/google-font-preconnect.ts","../src/rules/inline-script-id.ts","../src/rules/next-script-for-ga.ts","../src/rules/no-assign-module-variable.ts","../src/rules/no-async-client-component.ts","../src/rules/no-before-interactive-script-outside-document.ts","../src/rules/no-css-tags.ts","../src/rules/no-document-import-in-page.ts","../src/rules/no-duplicate-head.ts","../src/rules/no-head-element.ts","../src/rules/no-head-import-in-document.ts","../src/rules/no-html-link-for-pages.ts","../src/utils/get-root-dirs.ts","../src/utils/url.ts","../src/rules/no-img-element.ts","../src/rules/no-page-custom-font.ts","../src/rules/no-script-component-in-head.ts","../src/rules/no-styled-jsx-in-document.ts","../src/rules/no-sync-scripts.ts","../src/rules/no-title-in-document-head.ts","../src/rules/no-typos.ts","../src/rules/no-unwanted-polyfillio.ts"],"sourcesContent":["import type { ESLint, Linter } from \"eslint\";\n\nimport fs from \"node:fs\";\n\nimport { googleFontDisplay } from \"./rules/google-font-display.js\";\nimport { googleFontPreconnect } from \"./rules/google-font-preconnect.js\";\nimport { inlineScriptId } from \"./rules/inline-script-id.js\";\nimport { nextScriptForGa } from \"./rules/next-script-for-ga.js\";\nimport { noAssignModuleVariable } from \"./rules/no-assign-module-variable.js\";\nimport { noAsyncClientComponent } from \"./rules/no-async-client-component.js\";\nimport { noBeforeInteractiveScriptOutsideDocument } from \"./rules/no-before-interactive-script-outside-document.js\";\nimport { noCssTags } from \"./rules/no-css-tags.js\";\nimport { noDocumentImportInPage } from \"./rules/no-document-import-in-page.js\";\nimport { noDuplicateHead } from \"./rules/no-duplicate-head.js\";\nimport { noHeadElement } from \"./rules/no-head-element.js\";\nimport { noHeadImportInDocument } from \"./rules/no-head-import-in-document.js\";\nimport { noHtmlLinkForPages } from \"./rules/no-html-link-for-pages.js\";\nimport { noImgElement } from \"./rules/no-img-element.js\";\nimport { noPageCustomFont } from \"./rules/no-page-custom-font.js\";\nimport { noScriptComponentInHead } from \"./rules/no-script-component-in-head.js\";\nimport { noStyledJsxInDocument } from \"./rules/no-styled-jsx-in-document.js\";\nimport { noSyncScripts } from \"./rules/no-sync-scripts.js\";\nimport { noTitleInDocumentHead } from \"./rules/no-title-in-document-head.js\";\nimport { noTypos } from \"./rules/no-typos.js\";\nimport { noUnwantedPolyfillio } from \"./rules/no-unwanted-polyfillio.js\";\n\nconst pkg = JSON.parse(\n fs.readFileSync(new URL(\"../package.json\", import.meta.url), \"utf8\"),\n);\n\n// initialize plugin so it can be referenced in config\nconst plugin: ESLint.Plugin = {\n meta: {\n name: pkg.name,\n version: pkg.version,\n },\n // rule definitions\n rules: {\n \"google-font-display\": googleFontDisplay,\n \"google-font-preconnect\": googleFontPreconnect,\n \"inline-script-id\": inlineScriptId,\n \"next-script-for-ga\": nextScriptForGa,\n \"no-assign-module-variable\": noAssignModuleVariable,\n \"no-async-client-component\": noAsyncClientComponent,\n \"no-before-interactive-script-outside-document\":\n noBeforeInteractiveScriptOutsideDocument,\n \"no-css-tags\": noCssTags,\n \"no-document-import-in-page\": noDocumentImportInPage,\n \"no-duplicate-head\": noDuplicateHead,\n \"no-head-element\": noHeadElement,\n \"no-head-import-in-document\": noHeadImportInDocument,\n \"no-html-link-for-pages\": noHtmlLinkForPages,\n \"no-img-element\": noImgElement,\n \"no-page-custom-font\": noPageCustomFont,\n \"no-script-component-in-head\": noScriptComponentInHead,\n \"no-styled-jsx-in-document\": noStyledJsxInDocument,\n \"no-sync-scripts\": noSyncScripts,\n \"no-title-in-document-head\": noTitleInDocumentHead,\n \"no-typos\": noTypos,\n \"no-unwanted-polyfillio\": noUnwantedPolyfillio,\n },\n};\n\n/**\n * Same as `@next/eslint-plugin-next` but only warnings.\n */\nconst recommendedRules: Linter.RulesRecord = {\n \"nextjs/google-font-display\": \"warn\",\n \"nextjs/google-font-preconnect\": \"warn\",\n \"nextjs/inline-script-id\": \"warn\",\n \"nextjs/next-script-for-ga\": \"warn\",\n \"nextjs/no-assign-module-variable\": \"warn\",\n \"nextjs/no-async-client-component\": \"warn\",\n \"nextjs/no-before-interactive-script-outside-document\": \"warn\",\n \"nextjs/no-css-tags\": \"warn\",\n \"nextjs/no-document-import-in-page\": \"warn\",\n \"nextjs/no-duplicate-head\": \"warn\",\n \"nextjs/no-head-element\": \"warn\",\n \"nextjs/no-head-import-in-document\": \"warn\",\n \"nextjs/no-html-link-for-pages\": \"warn\",\n \"nextjs/no-img-element\": \"warn\",\n \"nextjs/no-page-custom-font\": \"warn\",\n \"nextjs/no-script-component-in-head\": \"warn\",\n \"nextjs/no-styled-jsx-in-document\": \"warn\",\n \"nextjs/no-sync-scripts\": \"warn\",\n \"nextjs/no-title-in-document-head\": \"warn\",\n \"nextjs/no-typos\": \"warn\",\n \"nextjs/no-unwanted-polyfillio\": \"warn\",\n};\n\n/**\n * The only config we need because we're only using warnings.\n */\nconst recommendedConfig: Linter.Config = {\n files: [\"**/*.{js,jsx,ts,tsx}\"],\n plugins: {\n nextjs: plugin,\n },\n rules: recommendedRules,\n};\n\n/**\n * ESLint V9 plugin for Next.js projects\n */\nconst nextjsPlugin: ESLint.Plugin = {\n ...plugin,\n configs: {\n recommended: recommendedConfig,\n },\n};\n\nexport default nextjsPlugin;\n","import type { RuleDefinition } from \"@eslint/core\";\n\nimport { URLSearchParams } from \"node:url\";\n\nimport NodeAttributes from \"../utils/node-attributes.js\";\n\nconst name = \"google-font-display\";\nconst url = `https://nextjs.org/docs/messages/${name}`;\n\ntype MessageId = \"missingFontDisplay\" | \"notRecommendedFontDisplay\";\n\n/**\n * Rule to enforce font-display behavior with Google Fonts\n */\nexport const googleFontDisplay: RuleDefinition = {\n create: (context) => ({\n JSXOpeningElement: (node) => {\n let messageId: MessageId | undefined;\n let data: Record<string, string> | undefined;\n\n if (node.name.type !== \"JSXIdentifier\" || node.name.name !== \"link\") {\n return;\n }\n\n const attributes = new NodeAttributes(node);\n if (!attributes.has(\"href\") || !attributes.hasValue(\"href\")) {\n return;\n }\n\n const hrefValue = attributes.value(\"href\");\n const isGoogleFont =\n typeof hrefValue === \"string\" &&\n hrefValue.startsWith(\"https://fonts.googleapis.com/css\");\n\n if (isGoogleFont) {\n const queryPart =\n hrefValue.includes(\"?\") ?\n hrefValue.substring(hrefValue.indexOf(\"?\") + 1)\n : \"\";\n const params = new URLSearchParams(queryPart);\n const displayValue = params.get(\"display\");\n\n if (!params.has(\"display\")) {\n messageId = \"missingFontDisplay\";\n data = { url };\n } else if (\n displayValue === \"auto\" ||\n displayValue === \"block\" ||\n displayValue === \"fallback\"\n ) {\n messageId = \"notRecommendedFontDisplay\";\n data = {\n display: displayValue[0]?.toUpperCase() + displayValue.slice(1),\n url,\n };\n }\n }\n\n if (messageId) {\n context.report({\n data,\n messageId,\n node,\n });\n }\n },\n }),\n meta: {\n docs: {\n description: \"Enforce font-display behavior with Google Fonts.\",\n recommended: true,\n url,\n },\n messages: {\n missingFontDisplay:\n \"A font-display parameter is missing (adding `&display=optional` is recommended). See: {{url}}\",\n notRecommendedFontDisplay: \"{{display}} is not recommended. See: {{url}}\",\n } satisfies Record<MessageId, string>,\n schema: [],\n type: \"problem\",\n },\n};\n","/**\n * Returns attributes and values of a node in a convenient way.\n *\n * @example\n * // Given the following JSX element:\n * // <ExampleElement attr1=\"15\" attr2 />\n * //\n * // The attributes would be represented as:\n * // {\n * // attr1: {\n * // hasValue: true,\n * // value: '15' // Note: attribute values are typically strings\n * // },\n * // attr2: {\n * // hasValue: false,\n * // value: undefined\n * // }\n * // }\n * //\n * // The `hasValue` property distinguishes between attributes with explicit\n * // values (even empty ones like `attr=\"\"`) and boolean attributes (flags)\n * // without assigned values. This distinction can be important for ESLint rules.\n */\nexport default class NodeAttributes {\n attributes: Record<\n string,\n | {\n hasValue: true;\n value: any;\n }\n | {\n hasValue?: false;\n }\n >;\n\n constructor(ASTnode: any) {\n this.attributes = {};\n ASTnode.attributes.forEach((attribute: any) => {\n if (!attribute.type || attribute.type !== \"JSXAttribute\") {\n return;\n }\n\n if (attribute.value) {\n // hasValue\n const value =\n typeof attribute.value.value === \"string\" ? attribute.value.value\n : typeof attribute.value.expression?.value !== \"undefined\" ?\n attribute.value.expression.value\n : attribute.value.expression?.properties;\n\n this.attributes[attribute.name.name] = {\n hasValue: true,\n value,\n };\n } else {\n this.attributes[attribute.name.name] = {\n hasValue: false,\n };\n }\n });\n }\n\n has(attrName: string): boolean {\n return Boolean(this.attributes[attrName]);\n }\n\n hasAny(): boolean {\n return Boolean(Object.keys(this.attributes).length);\n }\n\n hasValue(attrName: string): boolean {\n return Boolean(this.attributes[attrName]?.hasValue);\n }\n\n value(attrName: string): any {\n const attr = this.attributes[attrName];\n\n if (!attr) {\n return true;\n }\n\n if (\"hasValue\" in attr && attr.hasValue) {\n return attr.value;\n }\n\n return undefined;\n }\n}\n","import type { RuleDefinition } from \"@eslint/core\";\n\nimport NodeAttributes from \"../utils/node-attributes.js\";\n\nconst name = \"google-font-preconnect\";\nconst url = `https://nextjs.org/docs/messages/${name}`;\n\ntype MessageId = \"missingPreconnect\";\n\n/**\n * Rule to enforce preconnect usage with Google Fonts\n */\nexport const googleFontPreconnect: RuleDefinition = {\n create: (context) => ({\n JSXOpeningElement: (node) => {\n if (node.name.type !== \"JSXIdentifier\" || node.name.name !== \"link\") {\n return;\n }\n\n const attributes = new NodeAttributes(node);\n if (!attributes.has(\"href\") || !attributes.hasValue(\"href\")) {\n return;\n }\n\n const hrefValue = attributes.value(\"href\");\n const preconnectMissing =\n !attributes.has(\"rel\") ||\n !attributes.hasValue(\"rel\") ||\n attributes.value(\"rel\") !== \"preconnect\";\n\n if (\n typeof hrefValue === \"string\" &&\n hrefValue.startsWith(\"https://fonts.gstatic.com\") &&\n preconnectMissing\n ) {\n context.report({\n data: { url },\n messageId: \"missingPreconnect\",\n node,\n });\n }\n },\n }),\n meta: {\n docs: {\n description: \"Ensure `preconnect` is used with Google Fonts.\",\n recommended: true,\n url,\n },\n messages: {\n missingPreconnect:\n '`rel=\"preconnect\"` is missing from Google Font. See: {{url}}',\n } satisfies Record<MessageId, string>,\n schema: [],\n type: \"problem\",\n },\n};\n","import type { RuleDefinition } from \"@eslint/core\";\nconst name = \"inline-script-id\";\nconst url = `https://nextjs.org/docs/messages/${name}`;\n\ntype MessageId = \"missingId\";\n\n/**\n * Rule to enforce id attribute on next/script components with inline content\n */\nexport const inlineScriptId: RuleDefinition = {\n create: (context) => {\n let nextScriptImportName: null | string = null;\n\n return {\n ImportDeclaration: (node) => {\n if (node.source.value === \"next/script\" && node.specifiers.length > 0) {\n const specifier = node.specifiers[0];\n if (specifier && specifier.type === \"ImportDefaultSpecifier\") {\n nextScriptImportName = specifier.local.name;\n }\n }\n },\n JSXElement: (node) => {\n if (nextScriptImportName === null) {\n return;\n }\n\n if (\n node.openingElement.name.type === \"JSXIdentifier\" &&\n node.openingElement.name.name !== nextScriptImportName\n ) {\n return;\n }\n\n const attributeNames = new Set<string>();\n\n let hasNonCheckableSpreadAttribute = false;\n node.openingElement.attributes.forEach((attribute: any) => {\n // Early return if we already have a non-checkable spread attribute, for better performance\n if (hasNonCheckableSpreadAttribute) {\n return;\n }\n\n if (attribute.type === \"JSXAttribute\") {\n if (attribute.name.type === \"JSXIdentifier\") {\n attributeNames.add(attribute.name.name);\n }\n } else if (attribute.type === \"JSXSpreadAttribute\") {\n if (attribute.argument.type === \"ObjectExpression\") {\n attribute.argument.properties.forEach((property: any) => {\n if (\n property.type === \"Property\" &&\n property.key.type === \"Identifier\"\n ) {\n attributeNames.add(property.key.name);\n }\n });\n } else {\n // JSXSpreadAttribute without properties is not checkable\n hasNonCheckableSpreadAttribute = true;\n }\n }\n });\n\n // https://github.com/vercel/next.js/issues/34030\n // If there is a non-checkable spread attribute, we simply ignore them, TODO: fix\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (hasNonCheckableSpreadAttribute) {\n return;\n }\n\n if (\n node.children.length > 0 ||\n attributeNames.has(\"dangerouslySetInnerHTML\")\n ) {\n if (!attributeNames.has(\"id\")) {\n context.report({\n data: { url },\n messageId: \"missingId\",\n node,\n });\n }\n }\n },\n };\n },\n meta: {\n docs: {\n description:\n \"Enforce `id` attribute on `next/script` components with inline content.\",\n recommended: true,\n url,\n },\n messages: {\n missingId:\n \"`next/script` components with inline content must specify an `id` attribute. See: {{url}}\",\n } satisfies Record<MessageId, string>,\n schema: [],\n type: \"problem\",\n },\n};\n","import type { RuleDefinition } from \"@eslint/core\";\n\nimport NodeAttributes from \"../utils/node-attributes.js\";\n\nconst SUPPORTED_SRCS = [\n \"www.google-analytics.com/analytics.js\",\n \"www.googletagmanager.com/gtag/js\",\n];\nconst SUPPORTED_HTML_CONTENT_URLS = [\n \"www.google-analytics.com/analytics.js\",\n \"www.googletagmanager.com/gtm.js\",\n];\n\nconst name = \"next-script-for-ga\";\nconst url = `https://nextjs.org/docs/messages/${name}`;\nconst description =\n \"Prefer `next/script` component when using the inline script for Google Analytics.\";\n\n// Check if one of the items in the list is a substring of the passed string\nconst containsStr = (str: string, strList: string[]) => {\n return strList.some((s) => str.includes(s));\n};\n\ntype MessageId = \"useNextScript\";\n\n/**\n * Rule to enforce using next/script for Google Analytics\n */\nexport const nextScriptForGa: RuleDefinition = {\n create: (context) => ({\n JSXOpeningElement: (node) => {\n if (node.name.type !== \"JSXIdentifier\" || node.name.name !== \"script\") {\n return;\n }\n if (node.attributes.length === 0) {\n return;\n }\n const attributes = new NodeAttributes(node);\n\n // Check if the Alternative async tag is being used to add GA.\n // https://developers.google.com/analytics/devguides/collection/analyticsjs#alternative_async_tag\n // https://developers.google.com/analytics/devguides/collection/gtagjs\n if (\n typeof attributes.value(\"src\") === \"string\" &&\n containsStr(attributes.value(\"src\"), SUPPORTED_SRCS)\n ) {\n context.report({\n data: { url },\n messageId: \"useNextScript\",\n node,\n });\n return;\n }\n\n // Check if inline script is being used to add GA.\n // https://developers.google.com/analytics/devguides/collection/analyticsjs#the_google_analytics_tag\n // https://developers.google.com/tag-manager/quickstart\n if (\n attributes.value(\"dangerouslySetInnerHTML\") &&\n attributes.value(\"dangerouslySetInnerHTML\").length > 0\n ) {\n const htmlContent = attributes.value(\"dangerouslySetInnerHTML\")[0].value\n .quasis?.[0].value.raw;\n if (\n htmlContent &&\n containsStr(htmlContent, SUPPORTED_HTML_CONTENT_URLS)\n ) {\n context.report({\n data: { url },\n messageId: \"useNextScript\",\n node,\n });\n }\n }\n },\n }),\n meta: {\n docs: {\n description,\n recommended: true,\n url,\n },\n messages: {\n useNextScript:\n \"Prefer `next/script` component when using the inline script for Google Analytics. See: {{url}}\",\n } satisfies Record<MessageId, string>,\n schema: [],\n type: \"problem\",\n },\n};\n","import type { RuleDefinition } from \"@eslint/core\";\n\nconst name = \"no-assign-module-variable\";\nconst url = `https://nextjs.org/docs/messages/${name}`;\n\ntype MessageId = \"noAssignModule\";\n\n/**\n * Rule to prevent assignment to the module variable\n */\nexport const noAssignModuleVariable: RuleDefinition = {\n create: (context) => ({\n VariableDeclaration: (node) => {\n // Checks node.declarations array for variable with id.name of `module`\n const moduleVariableFound = node.declarations.some((declaration: any) => {\n if (\n declaration.id.type === \"Identifier\" &&\n declaration.id.name === \"module\"\n ) {\n return true;\n }\n return false;\n });\n\n // Return early if no `module` variable is found\n if (!moduleVariableFound) {\n return;\n }\n\n context.report({\n data: { url },\n messageId: \"noAssignModule\",\n node,\n });\n },\n }),\n\n meta: {\n docs: {\n description: \"Prevent assignment to the `module` variable.\",\n recommended: true,\n url,\n },\n messages: {\n noAssignModule: \"Do not assign to the variable `module`. See: {{url}}\",\n } satisfies Record<MessageId, string>,\n schema: [],\n type: \"problem\",\n },\n};\n","import type { RuleDefinition } from \"@eslint/core\";\n\nconst name = \"no-async-client-component\";\nconst url = `https://nextjs.org/docs/messages/${name}`;\nconst description = \"Prevent client components from being async functions.\";\n\nconst isCapitalized = (str: string): boolean => /[A-Z]/.test(str[0] ?? \"\");\n\ntype MessageId = \"noAsyncClientComponent\";\n\n/**\n * Rule to prevent client components from being async functions\n */\nexport const noAsyncClientComponent: RuleDefinition = {\n create: (context) => ({\n Program: (node) => {\n let isClientComponent = false;\n\n for (const block of node.body) {\n if (\n block.type === \"ExpressionStatement\" &&\n block.expression.type === \"Literal\" &&\n block.expression.value === \"use client\"\n ) {\n isClientComponent = true;\n }\n\n if (block.type === \"ExportDefaultDeclaration\" && isClientComponent) {\n // export default async function MyComponent() {...}\n if (\n block.declaration.type === \"FunctionDeclaration\" &&\n block.declaration.async &&\n block.declaration.id &&\n isCapitalized(block.declaration.id.name)\n ) {\n context.report({\n data: { url },\n messageId: \"noAsyncClientComponent\",\n node: block,\n });\n }\n\n // async function MyComponent() {...}; export default MyComponent;\n if (\n block.declaration.type === \"Identifier\" &&\n isCapitalized(block.declaration.name)\n ) {\n const targetName = block.declaration.name;\n\n const functionDeclaration = node.body.find((localBlock: any) => {\n if (\n localBlock.type === \"FunctionDeclaration\" &&\n localBlock.id.name === targetName\n ) {\n return true;\n }\n\n if (\n localBlock.type === \"VariableDeclaration\" &&\n localBlock.declarations.find(\n (declaration: any) =>\n declaration.id.type === \"Identifier\" &&\n declaration.id.name === targetName,\n )\n ) {\n return true;\n }\n\n return false;\n });\n\n if (\n functionDeclaration?.type === \"FunctionDeclaration\" &&\n functionDeclaration.async\n ) {\n context.report({\n data: { url },\n messageId: \"noAsyncClientComponent\",\n node: functionDeclaration,\n });\n }\n\n if (functionDeclaration?.type === \"VariableDeclaration\") {\n const varDeclarator = functionDeclaration.declarations.find(\n (declaration: any) =>\n declaration.id.type === \"Identifier\" &&\n declaration.id.name === targetName,\n );\n\n if (\n varDeclarator?.init?.type === \"ArrowFunctionExpression\" &&\n varDeclarator.init.async\n ) {\n context.report({\n data: { url },\n messageId: \"noAsyncClientComponent\",\n node: functionDeclaration,\n });\n }\n }\n }\n }\n }\n },\n }),\n meta: {\n docs: {\n description,\n recommended: true,\n url,\n },\n messages: {\n noAsyncClientComponent:\n \"Prevent client components from being async functions. See: {{url}}\",\n } satisfies Record<MessageId, string>,\n schema: [],\n type: \"problem\",\n },\n};\n","import type { RuleDefinition } from \"@eslint/core\";\n\nimport * as path from \"node:path\";\n\nconst name = \"no-before-interactive-script-outside-document\";\nconst url = `https://nextjs.org/docs/messages/${name}`;\n\nconst convertToCorrectSeparator = (str: string) =>\n str.replaceAll(/[/\\\\]/g, path.sep);\n\ntype MessageId = \"noBeforeInteractiveOutsideDocument\";\n\n/**\n * Rule to prevent usage of next/script's beforeInteractive strategy outside of pages/_document.js\n */\nexport const noBeforeInteractiveScriptOutsideDocument: RuleDefinition = {\n create: (context) => {\n let scriptImportName: null | string = null;\n\n return {\n 'ImportDeclaration[source.value=\"next/script\"] > ImportDefaultSpecifier'(\n node,\n ) {\n scriptImportName = node.local.name;\n },\n JSXOpeningElement: (node) => {\n const pathname = convertToCorrectSeparator(context.filename);\n\n const isInAppDir = pathname.includes(`${path.sep}app${path.sep}`);\n\n // This rule shouldn't fire in `app/`\n if (isInAppDir) {\n return;\n }\n\n if (!scriptImportName) {\n return;\n }\n\n if (\n node.name.type === \"JSXIdentifier\" &&\n node.name.name !== scriptImportName\n ) {\n return;\n }\n\n const strategy = node.attributes.find(\n (child: any) =>\n child.type === \"JSXAttribute\" &&\n child.name.type === \"JSXIdentifier\" &&\n child.name.name === \"strategy\",\n );\n\n if (\n !strategy?.value ||\n strategy.value.type !== \"Literal\" ||\n strategy.value.value !== \"beforeInteractive\"\n ) {\n return;\n }\n\n const document = context.filename.split(\"pages\", 2)[1];\n if (document && path.parse(document).name.startsWith(\"_document\")) {\n return;\n }\n\n context.report({\n data: { url },\n messageId: \"noBeforeInteractiveOutsideDocument\",\n node,\n });\n },\n };\n },\n meta: {\n docs: {\n description:\n \"Prevent usage of `next/script`'s `beforeInteractive` strategy outside of `pages/_document.js`.\",\n recommended: true,\n url,\n },\n messages: {\n noBeforeInteractiveOutsideDocument:\n \"`next/script`'s `beforeInteractive` strategy should not be used outside of `pages/_document.js`. See: {{url}}\",\n } satisfies Record<MessageId, string>,\n schema: [],\n type: \"problem\",\n },\n};\n","import type { RuleDefinition } from \"@eslint/core\";\n\nconst name = \"no-css-tags\";\nconst url = `https://nextjs.org/docs/messages/${name}`;\n\ntype MessageId = \"noCssTags\";\n\n/**\n * Rule to prevent manual stylesheet tags\n */\nexport const noCssTags: RuleDefinition = {\n create: (context) => ({\n JSXOpeningElement: (node) => {\n if (node.name.type !== \"JSXIdentifier\" || node.name.name !== \"link\") {\n return;\n }\n if (node.attributes.length === 0) {\n return;\n }\n\n const attributes = node.attributes.filter(\n (attr: any) => attr.type === \"JSXAttribute\",\n );\n if (\n attributes.find(\n (attr: any) =>\n attr.name.type === \"JSXIdentifier\" &&\n attr.name.name === \"rel\" &&\n attr.value &&\n attr.value.type === \"Literal\" &&\n attr.value.value === \"stylesheet\",\n ) &&\n attributes.find(\n (attr: any) =>\n attr.name.type === \"JSXIdentifier\" &&\n attr.name.name === \"href\" &&\n attr.value &&\n attr.value.type === \"Literal\" &&\n typeof attr.value.value === \"string\" &&\n !/^https?/.test(attr.value.value),\n )\n ) {\n context.report({\n data: { url },\n messageId: \"noCssTags\",\n node,\n });\n }\n },\n }),\n meta: {\n docs: {\n description: \"Prevent manual stylesheet tags.\",\n recommended: true,\n url,\n },\n messages: {\n noCssTags: \"Do not include stylesheets manually. See: {{url}}\",\n } satisfies Record<MessageId, string>,\n schema: [],\n type: \"problem\",\n },\n};\n","import type { RuleDefinition } from \"@eslint/core\";\n\nimport * as path from \"node:path\";\n\nconst name = \"no-document-import-in-page\";\nconst url = `https://nextjs.org/docs/messages/${name}`;\n\ntype MessageId = \"noDocumentImportInPage\";\n\n/**\n * Rule to prevent importing next/document outside of pages/_document.js\n */\nexport const noDocumentImportInPage: RuleDefinition = {\n create: (context) => ({\n ImportDeclaration: (node) => {\n if (node.source.value !== \"next/document\") {\n return;\n }\n\n const paths = context.filename.split(\"pages\");\n const page = paths[paths.length - 1];\n\n if (\n !page ||\n page.startsWith(`${path.sep}_document`) ||\n page.startsWith(`${path.posix.sep}_document`)\n ) {\n return;\n }\n\n context.report({\n data: { url },\n messageId: \"noDocumentImportInPage\",\n node,\n });\n },\n }),\n meta: {\n docs: {\n description:\n \"Prevent importing `next/document` outside of `pages/_document.js`.\",\n recommended: true,\n url,\n },\n messages: {\n noDocumentImportInPage:\n \"`<Document />` from `next/document` should not be imported outside of `pages/_document.js`. See: {{url}}\",\n } satisfies Record<MessageId, string>,\n schema: [],\n type: \"problem\",\n },\n};\n","import type { RuleDefinition } from \"@eslint/core\";\n\nconst name = \"no-duplicate-head\";\nconst url = `https://nextjs.org/docs/messages/${name}`;\n\ntype MessageId = \"noDuplicateHead\";\n\n/**\n * Rule to prevent duplicate usage of <Head> in pages/_document.js\n */\nexport const noDuplicateHead: RuleDefinition = {\n create: (context) => {\n const { sourceCode } = context;\n let documentImportName: null | string = null;\n return {\n ImportDeclaration: (node) => {\n if (node.source.value === \"next/document\") {\n const documentImport = node.specifiers.find(\n (specifier: any) => specifier.type === \"ImportDefaultSpecifier\",\n );\n if (documentImport?.local) {\n documentImportName = documentImport.local.name;\n }\n }\n },\n ReturnStatement: (node) => {\n const ancestors = (sourceCode as any).getAncestors(node);\n const documentClass = ancestors.find(\n (ancestorNode: any) =>\n ancestorNode.type === \"ClassDeclaration\" &&\n ancestorNode.superClass &&\n ancestorNode.superClass.type === \"Identifier\" &&\n ancestorNode.superClass.name === documentImportName,\n );\n\n if (!documentClass) {\n return;\n }\n\n if (node.argument && node.argument.type === \"JSXElement\") {\n const headComponents = node.argument.children\n .filter(\n (childrenNode: any) =>\n childrenNode.type === \"JSXElement\" &&\n childrenNode.openingElement.name.type === \"JSXIdentifier\" &&\n childrenNode.openingElement.name.name === \"Head\",\n )\n // Ensure we have valid nodes for reporting\n .filter(Boolean);\n\n if (headComponents.length > 1) {\n for (let i = 1; i < headComponents.length; i++) {\n context.report({\n data: { url },\n messageId: \"noDuplicateHead\",\n node: headComponents[i],\n });\n }\n }\n }\n },\n };\n },\n meta: {\n docs: {\n description:\n \"Prevent duplicate usage of `<Head>` in `pages/_document.js`.\",\n recommended: true,\n url,\n },\n messages: {\n noDuplicateHead:\n \"Do not include multiple instances of `<Head/>`. See: {{url}}\",\n } satisfies Record<MessageId, string>,\n schema: [],\n type: \"problem\",\n },\n};\n","import type { RuleDefinition } from \"@eslint/core\";\n\nimport path from \"node:path\";\n\nconst name = \"no-head-element\";\nconst url = `https://nextjs.org/docs/messages/${name}`;\n\ntype MessageId = \"noHeadElement\";\n\n/**\n * Rule to prevent usage of <head> element\n */\nexport const noHeadElement: RuleDefinition = {\n create: (context) => ({\n JSXOpeningElement: (node) => {\n const paths = context.filename;\n\n const isInAppDir = () =>\n // Check if we're in the app directory using either platform separator\n paths.includes(`app${path.sep}`) ||\n paths.includes(`app${path.posix.sep}`);\n // Only lint the <head> element in pages directory\n if (\n node.name.type !== \"JSXIdentifier\" ||\n node.name.name !== \"head\" ||\n isInAppDir()\n ) {\n return;\n }\n\n context.report({\n data: { url },\n messageId: \"noHeadElement\",\n node,\n });\n },\n }),\n meta: {\n docs: {\n category: \"HTML\",\n description: \"Prevent usage of `<head>` element.\",\n recommended: true,\n url,\n },\n messages: {\n noHeadElement:\n \"Do not use `<head>` element. Use `<Head />` from `next/head` instead. See: {{url}}\",\n } satisfies Record<MessageId, string>,\n schema: [],\n type: \"problem\",\n },\n};\n","import type { RuleDefinition } from \"@eslint/core\";\n\nimport * as path from \"node:path\";\n\nconst name = \"no-head-import-in-document\";\nconst url = `https://nextjs.org/docs/messages/${name}`;\n\ntype MessageId = \"noHeadImportInDocument\";\n\n/**\n * Rule to prevent usage of next/head in pages/_document.js\n */\nexport const noHeadImportInDocument: RuleDefinition = {\n create: (context) => ({\n ImportDeclaration: (node) => {\n if (node.source.value !== \"next/head\") {\n return;\n }\n\n const document = context.filename.split(\"pages\", 2)[1];\n if (!document) {\n return;\n }\n\n const { dir, name } = path.parse(document);\n\n if (\n name.startsWith(\"_document\") ||\n (dir === \"/_document\" && name === \"index\")\n ) {\n context.report({\n data: { document, url },\n messageId: \"noHeadImportInDocument\",\n node,\n });\n }\n },\n }),\n meta: {\n docs: {\n description: \"Prevent usage of `next/head` in `pages/_document.js`.\",\n recommended: true,\n url,\n },\n messages: {\n noHeadImportInDocument:\n \"`next/head` should not be imported in `pages{{document}}`. Use `<Head />` from `next/document` instead. See: {{url}}\",\n } satisfies Record<MessageId, string>,\n schema: [],\n type: \"problem\",\n },\n};\n","import type { RuleDefinition } from \"@eslint/core\";\n\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\n\nimport { getRootDirs } from \"../utils/get-root-dirs.js\";\nimport {\n execOnce,\n getUrlFromAppDirectory,\n getUrlFromPagesDirectories,\n normalizeURL,\n} from \"../utils/url.js\";\n\nconst pagesDirWarning = execOnce((pagesDirs) => {\n console.warn(\n `Pages directory cannot be found at ${pagesDirs.join(\" or \")}. ` +\n \"If using a custom path, please configure with the `no-html-link-for-pages` rule in your eslint config file.\",\n );\n});\n\n// Cache for fs.existsSync lookup.\n// Prevent multiple blocking IO requests that have already been calculated.\nconst fsExistsSyncCache: Record<string, boolean> = {};\n\n// Properly typed memoize function for the specific functions we use\ntype AnyFunction = (...args: any[]) => any;\n\nconst memoize = <F extends AnyFunction>(fn: F): F => {\n const cache = new Map<string, ReturnType<F>>();\n\n const memoized = (...args: Parameters<F>): ReturnType<F> => {\n const key = JSON.stringify(args);\n if (!cache.has(key)) {\n cache.set(key, fn(...args));\n }\n // We know the key exists because we just set it if it didn't\n const value = cache.get(key);\n // This cast is safe because we know the key exists\n return value as ReturnType<F>;\n };\n\n return memoized as F;\n};\n\nconst cachedGetUrlFromPagesDirectories = memoize(getUrlFromPagesDirectories);\nconst cachedGetUrlFromAppDirectory = memoize(getUrlFromAppDirectory);\n\nconst name = \"no-html-link-for-pages\";\nconst url = `https://nextjs.org/docs/messages/${name}`;\n\ntype MessageId = \"noHtmlLinkForPages\";\n\n/**\n * Rule to prevent usage of <a> elements to navigate to internal Next.js pages\n */\nexport const noHtmlLinkForPages: RuleDefinition = {\n /**\n * Creates an ESLint rule listener.\n */\n create: (context) => {\n const [customPagesDirectory] = context.options as [string | undefined];\n\n const rootDirs = getRootDirs(context as any);\n\n const pagesDirs = (\n customPagesDirectory ?\n [customPagesDirectory]\n : rootDirs.map((dir) => [\n path.join(dir, \"pages\"),\n path.join(dir, \"src\", \"pages\"),\n ])).flat();\n\n const foundPagesDirs = pagesDirs.filter((dir) => {\n fsExistsSyncCache[dir] ??= fs.existsSync(dir);\n return fsExistsSyncCache[dir];\n });\n\n const appDirs = rootDirs\n .map((dir) => [path.join(dir, \"app\"), path.join(dir, \"src\", \"app\")])\n .flat();\n\n const foundAppDirs = appDirs.filter((dir) => {\n fsExistsSyncCache[dir] ??= fs.existsSync(dir);\n return fsExistsSyncCache[dir];\n });\n\n // warn if there are no pages and app directories\n if (foundPagesDirs.length === 0 && foundAppDirs.length === 0) {\n pagesDirWarning(pagesDirs);\n return {};\n }\n\n const pageUrls = cachedGetUrlFromPagesDirectories(\"/\", foundPagesDirs);\n const appDirUrls = cachedGetUrlFromAppDirectory(\"/\", foundAppDirs);\n const allUrlRegex = [...pageUrls, ...appDirUrls];\n\n return {\n JSXOpeningElement: (node) => {\n if (node.name.type !== \"JSXIdentifier\" || node.name.name !== \"a\") {\n return;\n }\n\n if (node.attributes.length === 0) {\n return;\n }\n\n const target = node.attributes.find(\n (attr: any) =>\n attr.type === \"JSXAttribute\" &&\n attr.name.type === \"JSXIdentifier\" &&\n attr.name.name === \"target\",\n );\n\n if (\n target?.value?.type === \"Literal\" &&\n target.value.value === \"_blank\"\n ) {\n return;\n }\n\n const href = node.attributes.find(\n (attr: any) =>\n attr.type === \"JSXAttribute\" &&\n attr.name.type === \"JSXIdentifier\" &&\n attr.name.name === \"href\",\n );\n\n if (!href?.value || href.value.type !== \"Literal\") {\n return;\n }\n\n const hasDownloadAttr = node.attributes.find(\n (attr: any) =>\n attr.type === \"JSXAttribute\" &&\n attr.name.type === \"JSXIdentifier\" &&\n attr.name.name === \"download\",\n );\n\n if (hasDownloadAttr) {\n return;\n }\n\n // We've already checked that href.value exists and is a Literal\n const hrefPath = normalizeURL(href.value.value as string);\n // Outgoing links are ignored\n\n if (/^(?<temp1>https?:\\/\\/|\\/\\/)/.test(hrefPath as string)) {\n return;\n }\n\n allUrlRegex.forEach((foundUrl) => {\n if (hrefPath && foundUrl.test(normalizeURL(hrefPath) as string)) {\n context.report({\n data: { hrefPath, url },\n messageId: \"noHtmlLinkForPages\",\n node,\n });\n }\n });\n },\n };\n },\n\n meta: {\n docs: {\n category: \"HTML\",\n description:\n \"Prevent usage of `<a>` elements to navigate to internal Next.js pages.\",\n recommended: true,\n url,\n },\n messages: {\n noHtmlLinkForPages:\n \"Do not use an `<a>` element to navigate to `{{hrefPath}}`. Use `<Link />` from `next/link` instead. See: {{url}}\",\n } satisfies Record<MessageId, string>,\n schema: [\n {\n oneOf: [\n {\n type: \"string\",\n },\n {\n items: {\n type: \"string\",\n },\n type: \"array\",\n uniqueItems: true,\n },\n ],\n },\n ],\n type: \"problem\",\n },\n};\n","import type { Rule } from \"eslint\";\n\nimport fastGlob from \"fast-glob\";\n\n/**\n * Process a Next.js root directory glob.\n */\nconst processRootDir = (rootDir: string): string[] => {\n return fastGlob.globSync(rootDir.replaceAll(\"\\\\\", \"/\"), {\n onlyDirectories: true,\n });\n};\n\n/**\n * Gets one or more Root, returns an array of root directories.\n */\nexport const getRootDirs = (context: Rule.RuleContext) => {\n let rootDirs = [context.cwd];\n\n const nextSettings: { rootDir?: string | string[] } =\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n context.settings.next || {};\n const rootDir = nextSettings.rootDir;\n\n if (typeof rootDir === \"string\") {\n rootDirs = processRootDir(rootDir);\n } else if (Array.isArray(rootDir)) {\n rootDirs = rootDir\n .map((dir) => (typeof dir === \"string\" ? processRootDir(dir) : []))\n .flat();\n }\n\n return rootDirs;\n};\n","import * as fs from \"node:fs\";\nimport * as path from \"node:path\";\n\n// Cache for fs.readdirSync lookup.\n// Prevent multiple blocking IO requests that have already been calculated.\nconst fsReadDirSyncCache: Record<string, fs.Dirent[]> = {};\n\n/**\n * Recursively parse directory for page URLs.\n */\nconst parseUrlForPages = (urlprefix: string, directory: string) => {\n fsReadDirSyncCache[directory] ??= fs.readdirSync(directory, {\n withFileTypes: true,\n });\n const res: string[] = [];\n fsReadDirSyncCache[directory].forEach((dirent) => {\n // TODO: this should account for all page extensions\n // not just js(x) and ts(x)\n if (/(?<temp2>\\.(?<temp1>j|t)sx?)$/.test(dirent.name)) {\n if (/^index(?<temp2>\\.(?<temp1>j|t)sx?)$/.test(dirent.name)) {\n res.push(\n `${urlprefix}${dirent.name.replace(/^index(?<temp2>\\.(?<temp1>j|t)sx?)$/, \"\")}`,\n );\n }\n res.push(\n `${urlprefix}${dirent.name.replace(/(?<temp2>\\.(?<temp1>j|t)sx?)$/, \"\")}`,\n );\n } else {\n const dirPath = path.join(directory, dirent.name);\n if (dirent.isDirectory() && !dirent.isSymbolicLink()) {\n res.push(...parseUrlForPages(`${urlprefix + dirent.name}/`, dirPath));\n }\n }\n });\n return res;\n};\n\n/**\n * Recursively parse app directory for URLs.\n */\nconst parseUrlForAppDir = (urlprefix: string, directory: string) => {\n fsReadDirSyncCache[directory] ??= fs.readdirSync(directory, {\n withFileTypes: true,\n });\n const res: string[] = [];\n fsReadDirSyncCache[directory].forEach((dirent) => {\n // TODO: this should account for all page extensions\n // not just js(x) and ts(x)\n if (/(?<temp2>\\.(?<temp1>j|t)sx?)$/.test(dirent.name)) {\n if (/^page(?<temp2>\\.(?<temp1>j|t)sx?)$/.test(dirent.name)) {\n res.push(\n `${urlprefix}${dirent.name.replace(/^page(?<temp2>\\.(?<temp1>j|t)sx?)$/, \"\")}`,\n );\n } else if (!/^layout(?<temp2>\\.(?<temp1>j|t)sx?)$/.test(dirent.name)) {\n res.push(\n `${urlprefix}${dirent.name.replace(/(?<temp2>\\.(?<temp1>j|t)sx?)$/, \"\")}`,\n );\n }\n } else {\n const dirPath = path.join(directory, dirent.name);\n // @ts-expect-error - types suggest this shouldn't take an arg, but I don't want to change anything\n if (dirent.isDirectory(dirPath) && !dirent.isSymbolicLink()) {\n res.push(...parseUrlForPages(`${urlprefix + dirent.name}/`, dirPath));\n }\n }\n });\n return res;\n};\n\n/**\n * Takes a URL and does the following things.\n * - Replaces `index.html` with `/`\n * - Makes sure all URLs are have a trailing `/`\n * - Removes query string\n */\nexport const normalizeURL = (url: string) => {\n if (!url) {\n return;\n }\n url = url.split(\"?\", 1)[0] as string;\n url = url.split(\"#\", 1)[0] as string;\n url = url.replace(/(?<temp1>\\/index\\.html)$/, \"/\");\n // Empty URLs should not be trailed with `/`, e.g. `#heading`\n if (url === \"\") {\n return url;\n }\n url = url.endsWith(\"/\") ? url : `${url}/`;\n return url;\n};\n\n/**\n * Normalizes an app route so it represents the actual request path. Essentially\n * performing the following transformations:\n *\n * - `/(dashboard)/user/[id]/page` to `/user/[id]`\n * - `/(dashboard)/account/page` to `/account`\n * - `/user/[id]/page` to `/user/[id]`\n * - `/account/page` to `/account`\n * - `/page` to `/`\n * - `/(dashboard)/user/[id]/route` to `/user/[id]`\n * - `/(dashboard)/account/route` to `/account`\n * - `/user/[id]/route` to `/user/[id]`\n * - `/account/route` to `/account`\n * - `/route` to `/`\n * - `/` to `/`\n *\n * @param route the app route to normalize\n * @returns the normalized pathname\n */\nexport const normalizeAppPath = (route: string) =>\n ensureLeadingSlash(\n route.split(\"/\").reduce((pathname, segment, index, segments) => {\n // Empty segments are ignored.\n if (!segment) {\n return pathname;\n }\n\n // Groups are ignored.\n if (isGroupSegment(segment)) {\n return pathname;\n }\n\n // Parallel segments are ignored.\n if (segment.startsWith(\"@\")) {\n return pathname;\n }\n\n // The last segment (if it's a leaf) should be ignored.\n if (\n (segment === \"page\" || segment === \"route\") &&\n index === segments.length - 1\n ) {\n return pathname;\n }\n\n return `${pathname}/${segment}`;\n }, \"\"),\n );\n\n/**\n * Gets the possible URLs from a directory.\n */\nexport const getUrlFromPagesDirectories = (\n urlPrefix: string,\n directories: string[],\n) =>\n Array.from(\n // De-duplicate similar pages across multiple directories.\n new Set(\n directories\n .flatMap((directory) => parseUrlForPages(urlPrefix, directory))\n .map(\n // Since the URLs are normalized we add `^` and `$` to the RegExp to make sure they match exactly.\n (url) => `^${normalizeURL(url)}$`,\n ),\n ),\n ).map((urlReg) => {\n urlReg = urlReg.replaceAll(/\\[.*]/g, \"((?!.+?\\\\..+?).*?)\");\n return new RegExp(urlReg);\n });\n\nexport const getUrlFromAppDirectory = (\n urlPrefix: string,\n directories: string[],\n) =>\n Array.from(\n // De-duplicate similar pages across multiple directories.\n new Set(\n directories\n .map((directory) => parseUrlForAppDir(urlPrefix, directory))\n .flat()\n .map(\n // Since the URLs are normalized we add `^` and `$` to the RegExp to make sure they match exactly.\n (url) => `^${normalizeAppPath(url)}$`,\n ),\n ),\n ).map((urlReg) => {\n urlReg = urlReg.replaceAll(/\\[.*]/g, \"((?!.+?\\\\..+?).*?)\");\n return new RegExp(urlReg);\n });\n\nexport const execOnce = <TArgs extends any[], TResult>(\n fn: (...args: TArgs) => TResult,\n): ((...args: TArgs) => TResult) => {\n let used = false;\n let result: TResult;\n\n return (...args: TArgs) => {\n if (!used) {\n used = true;\n result = fn(...args);\n }\n return result;\n };\n};\n\nconst ensureLeadingSlash = (route: string) =>\n route.startsWith(\"/\") ? route : `/${route}`;\n\nconst isGroupSegment = (segment: string) =>\n segment.startsWith(\"(\") && segment.endsWith(\")\");\n","import type { RuleDefinition } from \"@eslint/core\";\n\nimport path from \"node:path\";\n\nconst name = \"no-img-element\";\nconst url = `https://nextjs.org/docs/messages/${name}`;\n\ntype MessageId = \"noImgElement\";\n\n/**\n * Rule to prevent usage of <img> element due to slower LCP and higher bandwidth\n */\nexport const noImgElement: RuleDefinition = {\n create: (context) => {\n // Get relative path of the file\n const relativePath = context.filename\n .replace(path.sep, \"/\")\n .replace(context.cwd, \"\")\n .replace(/^\\//, \"\");\n\n const isAppDir = /^(?<temp1>src\\/)?app\\//.test(relativePath);\n\n return {\n JSXOpeningElement: (node) => {\n if (node.name.type !== \"JSXIdentifier\" || node.name.name !== \"img\") {\n return;\n }\n\n if (node.attributes.length === 0) {\n return;\n }\n\n // Check if this img is inside a picture element\n const parentJSXElement = node.parent;\n const grandParentJSXElement = parentJSXElement?.parent;\n\n if (\n grandParentJSXElement?.openingElement?.name?.type ===\n \"JSXIdentifier\" &&\n grandParentJSXElement?.openingElement?.name?.name === \"picture\"\n ) {\n return;\n }\n\n // If is metadata route files, ignore\n // e.g. opengraph-image.js, twitter-image.js, icon.js\n if (\n isAppDir &&\n /\\/opengraph-image|twitter-image|icon\\.\\w+$/.test(relativePath)\n ) {\n return;\n }\n\n context.report({\n data: { url },\n messageId: \"noImgElement\",\n node,\n });\n },\n };\n },\n meta: {\n docs: {\n category: \"HTML\",\n description:\n \"Prevent usage of `<img>` element due to slower LCP and higher bandwidth.\",\n recommended: true,\n url,\n },\n messages: {\n noImgElement:\n \"Using `<img>` could result in slower LCP and higher bandwidth. Consider using `<Image />` from `next/image` or a custom image loader to automatically optimize images. This may incur additional usage or cost from your provider. See: {{url}}\",\n } satisfies Record<MessageId, string>,\n schema: [],\n type: \"problem\",\n },\n};\n","import type { RuleDefinition } from \"@eslint/core\";\n\nimport { posix, sep } from \"node:path\";\n\nimport NodeAttributes from \"../utils/node-attributes.js\";\n\nconst name = \"no-page-custom-font\";\nconst url = `https://nextjs.org/docs/messages/${name}`;\n\nconst isIdentifierMatch = (id1: any, id2: any): boolean | null =>\n (id1 === null && id2 === null) || (id1 && id2 && id1.name === id2.name);\n\ntype MessageId = \"noPageCustomFont\" | \"noPageCustomFontOutsideHead\";\n\n/**\n * Rule to prevent page-only custom fonts\n */\nexport const noPageCustomFont: RuleDefinition = {\n create: (context) => {\n const { sourceCode } = context;\n const paths = context.filename.split(\"pages\");\n const page = paths[paths.length - 1];\n\n // outside of a file within `pages`, bail\n if (!page) {\n return {};\n }\n\n const isDocument =\n page.startsWith(`${sep}_document`) ||\n page.startsWith(`${posix.sep}_document`);\n\n let documentImportName: string | undefined;\n let localDefaultExportId: any = null;\n let exportDeclarationType: any;\n\n return {\n ExportDefaultDeclaration: (node): void => {\n exportDeclarationType = node.declaration.type;\n\n if (node.declaration.type === \"FunctionDeclaration\") {\n localDefaultExportId = node.declaration.id;\n return;\n }\n\n if (\n node.declaration.type === \"ClassDeclaration\" &&\n node.declaration.superClass &&\n node.declaration.superClass.type === \"Identifier\" &&\n node.declaration.superClass.name === documentImportName\n ) {\n localDefaultExportId = node.declaration.id;\n }\n },\n\n ImportDeclaration: (node): void => {\n if (node.source.value === \"next/document\") {\n const documentImport = node.specifiers.find(\n (specifier: any) => specifier.type === \"ImportDefaultSpecifier\",\n );\n if (documentImport?.local) {\n documentImportName = documentImport.local.name;\n }\n }\n },\n\n JSXOpeningElement: (node): void => {\n if (node.name.type !== \"JSXIdentifier\" || node.name.name !== \"link\") {\n return;\n }\n\n const ancestors = (sourceCode as any).getAncestors(node);\n\n // if `export default <n>` is further down within the file after the\n // currently traversed component, then `localDefaultExportName` will\n // still be undefined\n if (!localDefaultExportId) {\n // find the top level of the module\n const program = ancestors.find(\n (ancestor: any) => ancestor.type === \"Program\",\n );\n\n if (!program?.tokens) {\n return;\n }\n\n // go over each token to find the combination of `export default <n>`\n for (let i = 0; i <= program.tokens.length - 1; i++) {\n if (localDefaultExportId) {\n break;\n }\n\n const token = program.tokens[i];\n\n // TODO: fix\n\n if (token?.type === \"Keyword\" && token.value === \"export\") {\n const nextToken = program.tokens[i + 1];\n\n if (nextToken && nextToken.value === \"default\") {\n const maybeIdentifier = program.tokens[i + 2];\n\n // TODO: fix\n\n if (maybeIdentifier && maybeIdentifier.type === \"Identifier\") {\n // Create a simple identifier with the name\n // This is a simplification and may not be fully type-safe\n // but works for our comparison purposes\n localDefaultExportId = {\n decorators: [],\n loc: {\n end: { column: 0, line: 0 },\n start: { column: 0, line: 0 },\n },\n name: maybeIdentifier.value,\n optional: false,\n range: [0, 0],\n type: \"Identifier\",\n };\n }\n }\n }\n }\n }\n\n const parentComponent = ancestors.find((ancestor: any) => {\n // export default class ... extends ...\n if (exportDeclarationType === \"ClassDeclaration\") {\n return (\n ancestor.type === exportDeclarationType &&\n \"superClass\" in ancestor &&\n ancestor.superClass &&\n ancestor.superClass.type === \"Identifier\" &&\n ancestor.superClass.name === documentImportName\n );\n }\n\n if (\"id\" in ancestor) {\n // export default function ...\n if (exportDeclarationType === \"FunctionDeclaration\") {\n return (\n ancestor.type === exportDeclarationType &&\n isIdentifierMatch(ancestor.id, localDefaultExportId)\n );\n }\n\n // function ...() {} export default ...\n // class ... extends ...; export default ...\n return isIdentifierMatch(ancestor.id, localDefaultExportId);\n }\n\n return false;\n });\n\n // file starts with _document and this <link /> is within the default export\n if (isDocument && parentComponent) {\n return;\n }\n\n const attributes = new NodeAttributes(node);\n if (!attributes.has(\"href\") || !attributes.hasValue(\"href\")) {\n return;\n }\n\n const hrefValue = attributes.value(\"href\");\n const isGoogleFont =\n typeof hrefValue === \"string\" &&\n hrefValue.startsWith(\"https://fonts.googleapis.com/css\");\n\n if (isGoogleFont) {\n // No longer needed as we use messageId\n\n // Determine which message to use based on context\n\n context.report({\n data: { url },\n messageId:\n isDocument ? \"noPageCustomFontOutsideHead\" : \"noPageCustomFont\",\n node,\n });\n }\n },\n };\n },\n meta: {\n docs: {\n description: \"Prevent page-only custom fonts.\",\n recommended: true,\n url,\n },\n messages: {\n noPageCustomFont:\n \"Custom fonts not added in `pages/_document.js` will only load for a single page. This is discouraged. See: {{url}}\",\n noPageCustomFontOutsideHead:\n \"Using `<link />` outside of `<Head>` will disable automatic font optimization. This is discouraged. See: {{url}}\",\n } satisfies Record<MessageId, string>,\n schema: [],\n type: \"problem\",\n },\n};\n","import type { RuleDefinition } from \"@eslint/core\";\n\nconst name = \"no-script-component-in-head\";\nconst url = `https://nextjs.org/docs/messages/${name}`;\n\ntype MessageId = \"noScriptComponentInHead\";\n\n/**\n * Rule to prevent usage of next/script in next/head component\n */\nexport const noScriptComponentInHead: RuleDefinition = {\n create: (context) => {\n let isNextHead: null | string = null;\n\n /**\n * Recursively find Script components inside a node's children\n */\n const findNestedScriptComponent = (node: any): any => {\n if (node.type !== \"JSXElement\") {\n return null;\n }\n\n // Check if current element is a Script component\n if (\n node.openingElement.name.type === \"JSXIdentifier\" &&\n node.openingElement.name.name === \"Script\"\n ) {\n return node;\n }\n\n // Recursively check all children\n for (const child of node.children) {\n const scriptComponent = findNestedScriptComponent(child);\n if (scriptComponent) {\n return scriptComponent;\n }\n }\n\n return null;\n };\n\n return {\n ImportDeclaration: (node: any) => {\n if (node.source.value === \"next/head\") {\n isNextHead = node.source.value;\n }\n },\n JSXElement: (node: any) => {\n if (!isNextHead) {\n return;\n }\n\n if (\n node.openingElement.name.type !== \"JSXIdentifier\" ||\n node.openingElement.name.name !== \"Head\"\n ) {\n return;\n }\n\n // Use recursive function to find any nested Script component\n const scriptTag = findNestedScriptComponent(node);\n\n if (scriptTag) {\n context.report({\n data: { url },\n messageId: \"noScriptComponentInHead\",\n node,\n });\n }\n },\n };\n },\n meta: {\n docs: {\n description: \"Prevent usage of `next/script` in `next/head` component.\",\n recommended: true,\n url,\n },\n messages: {\n noScriptComponentInHead:\n \"`next/script` should not be used in `next/head` component. Move `<Script />` outside of `<Head>` instead. See: {{url}}\",\n } satisfies Record<MessageId, string>,\n schema: [],\n type: \"problem\",\n },\n};\n","import type { RuleDefinition } from \"@eslint/core\";\n\nimport * as path from \"node:path\";\n\nconst name = \"no-styled-jsx-in-document\";\nconst url = `https://nextjs.org/docs/messages/${name}`;\n\ntype MessageId = \"noStyledJsxInDocument\";\n\n/**\n * Rule to prevent usage of styled-jsx in pages/_document.js\n */\nexport const noStyledJsxInDocument: RuleDefinition = {\n create: (context) => ({\n JSXOpeningElement: (node: any) => {\n const document = context.filename.split(\"pages\", 2)[1];\n if (!document) {\n return;\n }\n const { dir, name } = path.parse(document);\n\n if (\n !(\n name.startsWith(\"_document\") ||\n (dir === \"/_document\" && name === \"index\")\n )\n ) {\n return;\n }\n\n if (\n node.name.type === \"JSXIdentifier\" &&\n node.name.name === \"style\" &&\n node.attributes.find(\n (attr: any): attr is any =>\n attr.type === \"JSXAttribute\" &&\n attr.name.type === \"JSXIdentifier\" &&\n attr.name.name === \"jsx\",\n )\n ) {\n context.report({\n data: { url },\n messageId: \"noStyledJsxInDocument\",\n node,\n });\n }\n },\n }),\n meta: {\n docs: {\n description: \"Prevent usage of `styled-jsx` in `pages/_document.js`.\",\n recommended: true,\n url,\n },\n messages: {\n noStyledJsxInDocument:\n \"`styled-jsx` should not be used in `pages/_document.js`. See: {{url}}\",\n } satisfies Record<MessageId, string>,\n schema: [],\n type: \"problem\",\n },\n};\n","import type { RuleDefinition } from \"@eslint/core\";\n\nconst name = \"no-sync-scripts\";\nconst url = `https://nextjs.org/docs/messages/${name}`;\n\ntype MessageId = \"noSyncScripts\";\n\n/**\n * Rule to prevent synchronous scripts\n */\nexport const noSyncScripts: RuleDefinition = {\n create: (context) => ({\n JSXOpeningElement: (node: any) => {\n if (node.name.type !== \"JSXIdentifier\" || node.name.name !== \"script\") {\n return;\n }\n if (node.attributes.length === 0) {\n return;\n }\n const attributeNames = node.attributes\n .filter(\n (attr: any) =>\n attr.type === \"JSXAttribute\" && attr.name.type === \"JSXIdentifier\",\n )\n .map((attr: any) => attr.name.name);\n if (\n attributeNames.includes(\"src\") &&\n !attributeNames.includes(\"async\") &&\n !attributeNames.includes(\"defer\")\n ) {\n context.report({\n data: { url },\n messageId: \"noSyncScripts\",\n node,\n });\n }\n },\n }),\n meta: {\n docs: {\n description: \"Prevent synchronous scripts.\",\n recommended: true,\n url,\n },\n messages: {\n noSyncScripts: \"Synchronous scripts should not be used. See: {{url}}\",\n } satisfies Record<MessageId, string>,\n schema: [],\n type: \"problem\",\n },\n};\n","import type { RuleDefinition } from \"@eslint/core\";\n\nconst name = \"no-title-in-document-head\";\nconst url = `https://nextjs.org/docs/messages/${name}`;\n\ntype MessageId = \"noTitleInDocumentHead\";\n\n/**\n * Rule to prevent usage of <title> with Head component from next/document\n */\nexport const noTitleInDocumentHead: RuleDefinition = {\n create: (context) => {\n let headFromNextDocument = false;\n return {\n ImportDeclaration: (node: any) => {\n if (node.source.value === \"next/document\") {\n if (\n node.specifiers.some(\n (specifier: any) =>\n specifier.type === \"ImportSpecifier\" &&\n specifier.local.name === \"Head\",\n )\n ) {\n headFromNextDocument = true;\n }\n }\n },\n JSXElement: (node: any) => {\n if (!headFromNextDocument) {\n return;\n }\n\n if (\n node.openingElement.name.type !== \"JSXIdentifier\" ||\n node.openingElement.name.name !== \"Head\"\n ) {\n return;\n }\n\n const titleTag = node.children.find(\n (child: any) =>\n child.type === \"JSXElement\" &&\n child.openingElement.name.type === \"JSXIdentifier\" &&\n child.openingElement.name.name === \"title\",\n );\n\n if (titleTag) {\n context.report({\n data: { url },\n messageId: \"noTitleInDocumentHead\",\n node: titleTag,\n });\n }\n },\n };\n },\n meta: {\n docs: {\n description:\n \"Prevent usage of `<title>` with `Head` component from `next/document`.\",\n recommended: true,\n url,\n },\n messages: {\n noTitleInDocumentHead:\n \"Do not use `<title>` element with `<Head />` component from `next/document`. Titles should defined at the page-level using `<Head />` from `next/head` instead. See: {{url}}\",\n } satisfies Record<MessageId, string>,\n schema: [],\n type: \"problem\",\n },\n};\n","import type { RuleDefinition } from \"@eslint/core\";\n\nimport * as path from \"node:path\";\n\nconst NEXT_EXPORT_FUNCTIONS = [\n \"getStaticProps\",\n \"getStaticPaths\",\n \"getServerSideProps\",\n];\n\n// 0 is the exact match\nconst THRESHOLD = 1;\n\nconst name = \"no-typos\";\nconst url = `https://nextjs.org/docs/messages/${name}`;\n\n// the minimum number of operations required to convert string a to string b.\nconst minDistance = (a: string, b: string): number | undefined => {\n const m = a.length;\n const n = b.length;\n\n if (m < n) {\n return minDistance(b, a);\n }\n\n if (n === 0) {\n return m;\n }\n\n let previousRow = Array.from({ length: n + 1 }, (_, i) => i);\n\n for (let i = 0; i < m; i++) {\n const s1 = a[i];\n // Initialize with first value\n const currentRow: number[] = [i + 1];\n for (let j = 0; j < n; j++) {\n const s2 = b[j];\n // These values are guaranteed to exist because of how we initialize and build the arrays\n const insertions = (previousRow[j + 1] ?? Infinity) + 1;\n const deletions = (currentRow[j] ?? Infinity) + 1;\n const substitutions = (previousRow[j] ?? Infinity) + Number(s1 !== s2);\n currentRow.push(Math.min(insertions, deletions, substitutions));\n }\n previousRow = currentRow;\n }\n return previousRow[previousRow.length - 1];\n};\n\ntype MessageId = \"noTypos\";\n\n/**\n * Rule to prevent common typos in Next.js data fetching functions\n */\nexport const noTypos: RuleDefinition = {\n create: (context) => {\n const checkTypos = (node: any, functionName: string) => {\n if (NEXT_EXPORT_FUNCTIONS.includes(functionName)) {\n return;\n }\n\n const potentialTypos = NEXT_EXPORT_FUNCTIONS.map((o) => ({\n distance: minDistance(o, functionName) ?? Infinity,\n option: o,\n }))\n .filter(({ distance }) => distance <= THRESHOLD && distance > 0)\n .sort((a, b) => a.distance - b.distance);\n\n if (potentialTypos.length) {\n context.report({\n data: { functionName, suggestion: potentialTypos[0]?.option ?? \"\" },\n messageId: \"noTypos\",\n node,\n });\n }\n };\n return {\n ExportNamedDeclaration: (node: any) => {\n const page = context.filename.split(\"pages\", 2)[1];\n if (!page || path.parse(page).dir.startsWith(\"/api\")) {\n return;\n }\n\n const decl = node.declaration;\n\n if (!decl) {\n return;\n }\n\n switch (decl.type) {\n case \"FunctionDeclaration\": {\n if (decl.id) {\n checkTypos(node, decl.id.name);\n }\n break;\n }\n case \"VariableDeclaration\": {\n decl.declarations.forEach((d: any) => {\n if (d.id.type === \"Identifier\") {\n checkTypos(node, d.id.name);\n }\n });\n break;\n }\n default: {\n break;\n }\n }\n },\n };\n },\n meta: {\n docs: {\n description: \"Prevent common typos in Next.js data fetching functions.\",\n recommended: true,\n url,\n },\n messages: {\n noTypos: \"{{functionName}} may be a typo. Did you mean {{suggestion}}?\",\n } satisfies Record<MessageId, string>,\n schema: [],\n type: \"problem\",\n },\n};\n","import type { RuleDefinition } from \"@eslint/core\";\n\nconst name = \"no-unwanted-polyfillio\";\nconst url = `https://nextjs.org/docs/messages/${name}`;\n\n// Keep in sync with next.js polyfills file : https://github.com/vercel/next.js/blob/master/packages/next-polyfill-nomodule/src/index.js\nconst NEXT_POLYFILLED_FEATURES = [\n \"Array.prototype.@@iterator\",\n \"Array.prototype.at\",\n \"Array.prototype.copyWithin\",\n \"Array.prototype.fill\",\n \"Array.prototype.find\",\n \"Array.prototype.findIndex\",\n \"Array.prototype.flatMap\",\n \"Array.prototype.flat\",\n \"Array.from\",\n \"Array.prototype.includes\",\n \"Array.of\",\n \"Function.prototype.name\",\n \"fetch\",\n \"Map\",\n \"Number.EPSILON\",\n \"Number.Epsilon\",\n \"Number.isFinite\",\n \"Number.isNaN\",\n \"Number.isInteger\",\n \"Number.isSafeInteger\",\n \"Number.MAX_SAFE_INTEGER\",\n \"Number.MIN_SAFE_INTEGER\",\n \"Number.parseFloat\",\n \"Number.parseInt\",\n \"Object.assign\",\n \"Object.entries\",\n \"Object.fromEntries\",\n \"Object.getOwnPropertyDescriptor\",\n \"Object.getOwnPropertyDescriptors\",\n \"Object.hasOwn\",\n \"Object.is\",\n \"Object.keys\",\n \"Object.values\",\n \"Reflect\",\n \"Set\",\n \"Symbol\",\n \"Symbol.asyncIterator\",\n \"String.prototype.codePointAt\",\n \"String.prototype.endsWith\",\n \"String.fromCodePoint\",\n \"String.prototype.includes\",\n \"String.prototype.@@iterator\",\n \"String.prototype.padEnd\",\n \"String.prototype.padStart\",\n \"String.prototype.repeat\",\n \"String.raw\",\n \"String.prototype.startsWith\",\n \"String.prototype.trimEnd\",\n \"String.prototype.trimStart\",\n \"URL\",\n \"URL.prototype.toJSON\",\n \"URLSearchParams\",\n \"WeakMap\",\n \"WeakSet\",\n \"Promise\",\n \"Promise.prototype.finally\",\n \"es2015\", // Should be covered by babel-preset-env instead.\n \"es2016\", // contains polyfilled 'Array.prototype.includes', 'String.prototype.padEnd' and 'String.prototype.padStart'\n \"es2017\", // contains polyfilled 'Object.entries', 'Object.getOwnPropertyDescriptors', 'Object.values', 'String.prototype.padEnd' and 'String.prototype.padStart'\n \"es2018\", // contains polyfilled 'Promise.prototype.finally' and ''Symbol.asyncIterator'\n \"es2019\", // Contains polyfilled 'Object.fromEntries' and polyfilled 'Array.prototype.flat', 'Array.prototype.flatMap', 'String.prototype.trimEnd' and 'String.prototype.trimStart'\n \"es5\", // Should be covered by babel-preset-env instead.\n \"es6\", // Should be covered by babel-preset-env instead.\n \"es7\", // contains polyfilled 'Array.prototype.includes', 'String.prototype.padEnd' and 'String.prototype.padStart'\n];\n\ntype MessageId = \"noUnwantedPolyfillio\";\n\nexport const noUnwantedPolyfillio: RuleDefinition = {\n create: (context) => {\n let scriptImport: null | string = null;\n\n return {\n ImportDeclaration: (node: any) => {\n if (node.source.value === \"next/script\" && node.specifiers.length > 0) {\n const specifier = node.specifiers[0];\n if (specifier && specifier.type === \"ImportDefaultSpecifier\") {\n scriptImport = specifier.local.name;\n }\n }\n },\n JSXOpeningElement: (node: any) => {\n if (\n node.name.type !== \"JSXIdentifier\" ||\n (node.name.name !== \"script\" && node.name.name !== scriptImport)\n ) {\n return;\n }\n if (node.attributes.length === 0) {\n return;\n }\n\n const srcNode = node.attributes.find(\n (attr: any) =>\n attr.type === \"JSXAttribute\" &&\n attr.name.type === \"JSXIdentifier\" &&\n attr.name.name === \"src\",\n );\n if (\n !srcNode?.value ||\n srcNode.value.type !== \"Literal\" ||\n typeof srcNode.value.value !== \"string\"\n ) {\n return;\n }\n const src = srcNode.value.value;\n if (\n src.startsWith(\"https://cdn.polyfill.io/v2/\") ||\n src.startsWith(\"https://polyfill.io/v3/\") ||\n // https://community.fastly.com/t/new-options-for-polyfill-io-users/2540\n src.startsWith(\"https://polyfill-fastly.net/\") ||\n src.startsWith(\"https://polyfill-fastly.io/\") ||\n // https://blog.cloudflare.com/polyfill-io-now-available-on-cdnjs-reduce-your-supply-chain-risk\n src.startsWith(\"https://cdnjs.cloudflare.com/polyfill/\")\n ) {\n const featureQueryString = new URL(src).searchParams.get(\"features\");\n const featuresRequested = featureQueryString?.split(\",\") ?? [\"\"];\n const unwantedFeatures = featuresRequested.filter((feature: string) =>\n NEXT_POLYFILLED_FEATURES.includes(feature),\n );\n if (unwantedFeatures.length > 0) {\n context.report({\n data: {\n features: unwantedFeatures.join(\", \"),\n url,\n verb: unwantedFeatures.length > 1 ? \"are\" : \"is\",\n },\n messageId: \"noUnwantedPolyfillio\",\n node,\n });\n }\n }\n },\n };\n },\n meta: {\n docs: {\n description: \"Prevent duplicate polyfills from Polyfill.io.\",\n url,\n },\n messages: {\n noUnwantedPolyfillio:\n \"No duplicate polyfills from Polyfill.io are allowed. {{features}} {{verb}} already shipped with Next.js. See: {{url}}\",\n } satisfies Record<MessageId, string>,\n schema: [],\n type: \"problem\",\n },\n};\n"],"mappings":";AAEA,OAAOA,SAAQ;;;ACAf,SAAS,uBAAuB;;;ACqBhC,IAAqB,iBAArB,MAAoC;AAAA,EAClC;AAAA,EAWA,YAAY,SAAc;AACxB,SAAK,aAAa,CAAC;AACnB,YAAQ,WAAW,QAAQ,CAAC,cAAmB;AAC7C,UAAI,CAAC,UAAU,QAAQ,UAAU,S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B;AAAA,IACvB,0BAA0B;AAAA,IAC1B,oBAAoB;AAAA,IACpB,sBAAsB;AAAA,IACtB,6BAA6B;AAAA,IAC7B,6BAA6B;AAAA,IAC7B,iDACE;AAAA,IACF,eAAe;AAAA,IACf,8BAA8B;AAAA,IAC9B,qBAAqB;AAAA,IACrB,mBAAmB;AAAA,IACnB,8BAA8B;AAAA,IAC9B,0BAA0B;AAAA,IAC1B,kBAAkB;AAAA,IAClB,uBAAuB;AAAA,IACvB,+BAA+B;AAAA,IAC/B,6BAA6B;AAAA,IAC7B,mBAAmB;AAAA,IACnB,6BAA6B;AAAA,IAC7B,YAAY;AAAA,IACZ,0BAA0B;AAAA,EAC5B;AACF;AAKA,IAAM,mBAAuC;AAAA,EAC3C,8BAA8B;AAAA,EAC9B,iCAAiC;AAAA,EACjC,2BAA2B;AAAA,EAC3B,6BAA6B;AAAA,EAC7B,oCAAoC;AAAA,EACpC,oCAAoC;AAAA,EACpC,wDAAwD;AAAA,EACxD,sBAAsB;AAAA,EACtB,qCAAqC;AAAA,EACrC,4BAA4B;AAAA,EAC5B,0BAA0B;AAAA,EAC1B,qCAAqC;AAAA,EACrC,iCAAiC;AAAA,EACjC,yBAAyB;AAAA,EACzB,8BAA8B;AAAA,EAC9B,sCAAsC;AAAA,EACtC,oCAAoC;AAAA,EACpC,0BAA0B;AAAA,EAC1B,oCAAoC;AAAA,EACpC,mBAAmB;AAAA,EACnB,iCAAiC;AACnC;AAKA,IAAM,oBAAmC;AAAA,EACvC,OAAO,CAAC,sBAAsB;AAAA,EAC9B,SAAS;AAAA,IACP,QAAQ;AAAA,EACV;AAAA,EACA,OAAO;AACT;AAKA,IAAM,eAA8B;AAAA,EAClC,GAAG;AAAA,EACH,SAAS;AAAA,IACP,aAAa;AAAA,EACf;AACF;AAEA,IAAO,gBAAQ;","names":["fs","name","url","name","url","name","url","name","url","name","url","description","name","url","name","url","path","name","url","name","url","path","name","url","path","name","url","fs","path","path","url","name","url","path","name","url","posix","sep","name","url","sep","posix","name","url","path","name","url","name","url","name","url","path","name","url","name","url","fs"]}
|
package/package.json
CHANGED
@@ -1,10 +1,15 @@
|
|
1
1
|
{
|
2
2
|
"name": "eslint-plugin-nextjs",
|
3
|
-
"version": "0.
|
3
|
+
"version": "1.0.0",
|
4
4
|
"description": "A fork of @next/eslint-plugin-next that's been upgraded for TypeScript and ESLint V9.",
|
5
5
|
"keywords": [
|
6
6
|
"eslint",
|
7
|
-
"
|
7
|
+
"eslintplugin",
|
8
|
+
"eslint-plugin",
|
9
|
+
"next",
|
10
|
+
"nextjs",
|
11
|
+
"eslint-plugin-next",
|
12
|
+
"@next/eslint-plugin-next"
|
8
13
|
],
|
9
14
|
"homepage": "https://github.com/drake-nathan/js-style-kit#readme",
|
10
15
|
"bugs": {
|
@@ -21,7 +26,6 @@
|
|
21
26
|
".": {
|
22
27
|
"types": "./dist/index.d.ts",
|
23
28
|
"import": "./dist/index.js",
|
24
|
-
"require": "./dist/index.cjs",
|
25
29
|
"default": "./dist/index.js"
|
26
30
|
}
|
27
31
|
},
|
@@ -33,8 +37,8 @@
|
|
33
37
|
"scripts": {
|
34
38
|
"build": "tsup",
|
35
39
|
"dev": "tsup --watch",
|
36
|
-
"format": "prettier
|
37
|
-
"format:check": "prettier
|
40
|
+
"format": "prettier . --write --cache",
|
41
|
+
"format:check": "prettier . --check --cache",
|
38
42
|
"lint": "eslint .",
|
39
43
|
"lint:fix": "eslint . --fix",
|
40
44
|
"lint:inspect": "eslint --inspect-config",
|
@@ -45,16 +49,17 @@
|
|
45
49
|
"fast-glob": "^3.3.3"
|
46
50
|
},
|
47
51
|
"devDependencies": {
|
52
|
+
"@eslint/core": "^0.13.0",
|
48
53
|
"@repo/typescript-config": "workspace:*",
|
49
54
|
"@types/bun": "^1.2.8",
|
50
|
-
"@types/node": "^22.
|
51
|
-
"eslint": "^9.
|
52
|
-
"eslint-
|
55
|
+
"@types/node": "^22.14.0",
|
56
|
+
"eslint": "^9.24.0",
|
57
|
+
"eslint-plugin-eslint-plugin": "^6.4.0",
|
53
58
|
"tsup": "^8.4.0",
|
54
|
-
"typescript": "^5.8.
|
59
|
+
"typescript": "^5.8.3"
|
55
60
|
},
|
56
61
|
"peerDependencies": {
|
57
|
-
"eslint": "
|
62
|
+
"eslint": ">=9.0.0"
|
58
63
|
},
|
59
64
|
"engines": {
|
60
65
|
"node": "^20.11.0 || >=21.2.0"
|