eslint-plugin-nextjs 0.0.0 → 0.1.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 +9 -380
- package/dist/index.cjs +1494 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +43 -0
- package/dist/index.d.ts +42 -1
- package/dist/index.js +1455 -1
- package/dist/index.js.map +1 -1
- package/dist/rules/google-font-display.cjs +119 -0
- package/dist/rules/google-font-display.cjs.map +1 -0
- package/dist/rules/google-font-display.d.cts +8 -0
- package/dist/rules/google-font-display.d.ts +8 -0
- package/dist/rules/google-font-display.js +92 -0
- package/dist/rules/google-font-display.js.map +1 -0
- package/dist/rules/google-font-preconnect.cjs +109 -0
- package/dist/rules/google-font-preconnect.cjs.map +1 -0
- package/dist/rules/google-font-preconnect.d.cts +5 -0
- package/dist/rules/google-font-preconnect.d.ts +5 -0
- package/dist/rules/google-font-preconnect.js +82 -0
- package/dist/rules/google-font-preconnect.js.map +1 -0
- package/dist/rules/inline-script-id.cjs +94 -0
- package/dist/rules/inline-script-id.cjs.map +1 -0
- package/dist/rules/inline-script-id.d.cts +5 -0
- package/dist/rules/inline-script-id.d.ts +5 -0
- package/dist/rules/inline-script-id.js +67 -0
- package/dist/rules/inline-script-id.js.map +1 -0
- package/dist/rules/next-script-for-ga.cjs +129 -0
- package/dist/rules/next-script-for-ga.cjs.map +1 -0
- package/dist/rules/next-script-for-ga.d.cts +5 -0
- package/dist/rules/next-script-for-ga.d.ts +5 -0
- package/dist/rules/next-script-for-ga.js +102 -0
- package/dist/rules/next-script-for-ga.js.map +1 -0
- package/dist/rules/no-assign-module-variable.cjs +64 -0
- package/dist/rules/no-assign-module-variable.cjs.map +1 -0
- package/dist/rules/no-assign-module-variable.d.cts +5 -0
- package/dist/rules/no-assign-module-variable.d.ts +5 -0
- package/dist/rules/no-assign-module-variable.js +37 -0
- package/dist/rules/no-assign-module-variable.js.map +1 -0
- package/dist/rules/no-async-client-component.cjs +99 -0
- package/dist/rules/no-async-client-component.cjs.map +1 -0
- package/dist/rules/no-async-client-component.d.cts +5 -0
- package/dist/rules/no-async-client-component.d.ts +5 -0
- package/dist/rules/no-async-client-component.js +72 -0
- package/dist/rules/no-async-client-component.js.map +1 -0
- package/dist/rules/no-before-interactive-script-outside-document.cjs +94 -0
- package/dist/rules/no-before-interactive-script-outside-document.cjs.map +1 -0
- package/dist/rules/no-before-interactive-script-outside-document.d.cts +5 -0
- package/dist/rules/no-before-interactive-script-outside-document.d.ts +5 -0
- package/dist/rules/no-before-interactive-script-outside-document.js +59 -0
- package/dist/rules/no-before-interactive-script-outside-document.js.map +1 -0
- package/dist/rules/no-css-tags.cjs +70 -0
- package/dist/rules/no-css-tags.cjs.map +1 -0
- package/dist/rules/no-css-tags.d.cts +5 -0
- package/dist/rules/no-css-tags.d.ts +5 -0
- package/dist/rules/no-css-tags.js +43 -0
- package/dist/rules/no-css-tags.js.map +1 -0
- package/dist/rules/no-document-import-in-page.cjs +74 -0
- package/dist/rules/no-document-import-in-page.cjs.map +1 -0
- package/dist/rules/no-document-import-in-page.d.cts +5 -0
- package/dist/rules/no-document-import-in-page.d.ts +5 -0
- package/dist/rules/no-document-import-in-page.js +39 -0
- package/dist/rules/no-document-import-in-page.js.map +1 -0
- package/dist/rules/no-duplicate-head.cjs +87 -0
- package/dist/rules/no-duplicate-head.cjs.map +1 -0
- package/dist/rules/no-duplicate-head.d.cts +5 -0
- package/dist/rules/no-duplicate-head.d.ts +5 -0
- package/dist/rules/no-duplicate-head.js +60 -0
- package/dist/rules/no-duplicate-head.js.map +1 -0
- package/dist/rules/no-head-element.cjs +76 -0
- package/dist/rules/no-head-element.cjs.map +1 -0
- package/dist/rules/no-head-element.d.cts +5 -0
- package/dist/rules/no-head-element.d.ts +5 -0
- package/dist/rules/no-head-element.js +41 -0
- package/dist/rules/no-head-element.js.map +1 -0
- package/dist/rules/no-head-import-in-document.cjs +76 -0
- package/dist/rules/no-head-import-in-document.cjs.map +1 -0
- package/dist/rules/no-head-import-in-document.d.cts +5 -0
- package/dist/rules/no-head-import-in-document.d.ts +5 -0
- package/dist/rules/no-head-import-in-document.js +41 -0
- package/dist/rules/no-head-import-in-document.js.map +1 -0
- package/dist/rules/no-html-link-for-pages.cjs +302 -0
- package/dist/rules/no-html-link-for-pages.cjs.map +1 -0
- package/dist/rules/no-html-link-for-pages.d.cts +5 -0
- package/dist/rules/no-html-link-for-pages.d.ts +5 -0
- package/dist/rules/no-html-link-for-pages.js +267 -0
- package/dist/rules/no-html-link-for-pages.js.map +1 -0
- package/dist/rules/no-img-element.cjs +83 -0
- package/dist/rules/no-img-element.cjs.map +1 -0
- package/dist/rules/no-img-element.d.cts +5 -0
- package/dist/rules/no-img-element.d.ts +5 -0
- package/dist/rules/no-img-element.js +48 -0
- package/dist/rules/no-img-element.js.map +1 -0
- package/dist/rules/no-page-custom-font.cjs +184 -0
- package/dist/rules/no-page-custom-font.cjs.map +1 -0
- package/dist/rules/no-page-custom-font.d.cts +5 -0
- package/dist/rules/no-page-custom-font.d.ts +5 -0
- package/dist/rules/no-page-custom-font.js +159 -0
- package/dist/rules/no-page-custom-font.js.map +1 -0
- package/dist/rules/no-script-component-in-head.cjs +74 -0
- package/dist/rules/no-script-component-in-head.cjs.map +1 -0
- package/dist/rules/no-script-component-in-head.d.cts +5 -0
- package/dist/rules/no-script-component-in-head.d.ts +5 -0
- package/dist/rules/no-script-component-in-head.js +47 -0
- package/dist/rules/no-script-component-in-head.js.map +1 -0
- package/dist/rules/no-styled-jsx-in-document.cjs +78 -0
- package/dist/rules/no-styled-jsx-in-document.cjs.map +1 -0
- package/dist/rules/no-styled-jsx-in-document.d.cts +5 -0
- package/dist/rules/no-styled-jsx-in-document.d.ts +5 -0
- package/dist/rules/no-styled-jsx-in-document.js +43 -0
- package/dist/rules/no-styled-jsx-in-document.js.map +1 -0
- package/dist/rules/no-sync-scripts.cjs +64 -0
- package/dist/rules/no-sync-scripts.cjs.map +1 -0
- package/dist/rules/no-sync-scripts.d.cts +5 -0
- package/dist/rules/no-sync-scripts.d.ts +5 -0
- package/dist/rules/no-sync-scripts.js +37 -0
- package/dist/rules/no-sync-scripts.js.map +1 -0
- package/dist/rules/no-title-in-document-head.cjs +78 -0
- package/dist/rules/no-title-in-document-head.cjs.map +1 -0
- package/dist/rules/no-title-in-document-head.d.cts +5 -0
- package/dist/rules/no-title-in-document-head.d.ts +5 -0
- package/dist/rules/no-title-in-document-head.js +51 -0
- package/dist/rules/no-title-in-document-head.js.map +1 -0
- package/dist/rules/no-typos.cjs +133 -0
- package/dist/rules/no-typos.cjs.map +1 -0
- package/dist/rules/no-typos.d.cts +5 -0
- package/dist/rules/no-typos.d.ts +5 -0
- package/dist/rules/no-typos.js +98 -0
- package/dist/rules/no-typos.js.map +1 -0
- package/dist/rules/no-unwanted-polyfillio.cjs +164 -0
- package/dist/rules/no-unwanted-polyfillio.cjs.map +1 -0
- package/dist/rules/no-unwanted-polyfillio.d.cts +5 -0
- package/dist/rules/no-unwanted-polyfillio.d.ts +5 -0
- package/dist/rules/no-unwanted-polyfillio.js +137 -0
- package/dist/rules/no-unwanted-polyfillio.js.map +1 -0
- package/dist/utils/define-rule.cjs +31 -0
- package/dist/utils/define-rule.cjs.map +1 -0
- package/dist/utils/define-rule.d.cts +5 -0
- package/dist/utils/define-rule.d.ts +5 -0
- package/dist/utils/define-rule.js +6 -0
- package/dist/utils/define-rule.js.map +1 -0
- package/dist/utils/get-root-dirs.cjs +60 -0
- package/dist/utils/get-root-dirs.cjs.map +1 -0
- package/dist/utils/get-root-dirs.d.cts +8 -0
- package/dist/utils/get-root-dirs.d.ts +8 -0
- package/dist/utils/get-root-dirs.js +25 -0
- package/dist/utils/get-root-dirs.js.map +1 -0
- package/dist/utils/node-attributes.cjs +67 -0
- package/dist/utils/node-attributes.cjs.map +1 -0
- package/dist/utils/node-attributes.d.cts +15 -0
- package/dist/utils/node-attributes.d.ts +15 -0
- package/dist/utils/node-attributes.js +46 -0
- package/dist/utils/node-attributes.js.map +1 -0
- package/dist/utils/url.cjs +167 -0
- package/dist/utils/url.cjs.map +1 -0
- package/dist/utils/url.d.cts +35 -0
- package/dist/utils/url.d.ts +35 -0
- package/dist/utils/url.js +128 -0
- package/dist/utils/url.js.map +1 -0
- package/package.json +15 -2
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../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"],"sourcesContent":["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","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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEO,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,IA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MAAM,kBAAkB,IAAI;AAC3E,IAAM,0BAA0B,iBAAiB,MAAM,kBAAkB,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","url","path","path","url","name","fs","path","fastGlob","path","url","url","import_node_path","url","path","import_node_path","url","message","url","path","url","name","url","url","path","name","url","rules"]}
|
package/dist/index.d.cts
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
import * as _eslint_core from '@eslint/core';
|
2
|
+
import { ESLint, Linter, Rule } from 'eslint';
|
3
|
+
|
4
|
+
interface PluginConfig extends ESLint.Plugin {
|
5
|
+
configs: {
|
6
|
+
"core-web-vitals": Linter.LegacyConfig;
|
7
|
+
"core-web-vitals/flat": Linter.Config;
|
8
|
+
recommended: Linter.LegacyConfig;
|
9
|
+
"recommended/flat": Linter.Config;
|
10
|
+
};
|
11
|
+
name: string;
|
12
|
+
rules: {
|
13
|
+
"nextjs/google-font-display": Rule.RuleModule;
|
14
|
+
"nextjs/google-font-preconnect": Rule.RuleModule;
|
15
|
+
"nextjs/inline-script-id": Rule.RuleModule;
|
16
|
+
"nextjs/next-script-for-ga": Rule.RuleModule;
|
17
|
+
"nextjs/no-assign-module-variable": Rule.RuleModule;
|
18
|
+
"nextjs/no-async-client-component": Rule.RuleModule;
|
19
|
+
"nextjs/no-before-interactive-script-outside-document": Rule.RuleModule;
|
20
|
+
"nextjs/no-css-tags": Rule.RuleModule;
|
21
|
+
"nextjs/no-document-import-in-page": Rule.RuleModule;
|
22
|
+
"nextjs/no-duplicate-head": Rule.RuleModule;
|
23
|
+
"nextjs/no-head-element": Rule.RuleModule;
|
24
|
+
"nextjs/no-head-import-in-document": Rule.RuleModule;
|
25
|
+
"nextjs/no-html-link-for-pages": Rule.RuleModule;
|
26
|
+
"nextjs/no-img-element": Rule.RuleModule;
|
27
|
+
"nextjs/no-page-custom-font": Rule.RuleModule;
|
28
|
+
"nextjs/no-script-component-in-head": Rule.RuleModule;
|
29
|
+
"nextjs/no-styled-jsx-in-document": Rule.RuleModule;
|
30
|
+
"nextjs/no-sync-scripts": Rule.RuleModule;
|
31
|
+
"nextjs/no-title-in-document-head": Rule.RuleModule;
|
32
|
+
"nextjs/no-typos": Rule.RuleModule;
|
33
|
+
"nextjs/no-unwanted-polyfillio": Rule.RuleModule;
|
34
|
+
};
|
35
|
+
}
|
36
|
+
/**
|
37
|
+
* ESLint plugin for Next.js projects
|
38
|
+
*/
|
39
|
+
declare const _default: PluginConfig;
|
40
|
+
|
41
|
+
declare const rules: Record<string, _eslint_core.RuleDefinition<_eslint_core.RuleDefinitionTypeOptions>> | undefined;
|
42
|
+
|
43
|
+
export { _default as default, rules };
|
package/dist/index.d.ts
CHANGED
@@ -1,2 +1,43 @@
|
|
1
|
+
import * as _eslint_core from '@eslint/core';
|
2
|
+
import { ESLint, Linter, Rule } from 'eslint';
|
1
3
|
|
2
|
-
|
4
|
+
interface PluginConfig extends ESLint.Plugin {
|
5
|
+
configs: {
|
6
|
+
"core-web-vitals": Linter.LegacyConfig;
|
7
|
+
"core-web-vitals/flat": Linter.Config;
|
8
|
+
recommended: Linter.LegacyConfig;
|
9
|
+
"recommended/flat": Linter.Config;
|
10
|
+
};
|
11
|
+
name: string;
|
12
|
+
rules: {
|
13
|
+
"nextjs/google-font-display": Rule.RuleModule;
|
14
|
+
"nextjs/google-font-preconnect": Rule.RuleModule;
|
15
|
+
"nextjs/inline-script-id": Rule.RuleModule;
|
16
|
+
"nextjs/next-script-for-ga": Rule.RuleModule;
|
17
|
+
"nextjs/no-assign-module-variable": Rule.RuleModule;
|
18
|
+
"nextjs/no-async-client-component": Rule.RuleModule;
|
19
|
+
"nextjs/no-before-interactive-script-outside-document": Rule.RuleModule;
|
20
|
+
"nextjs/no-css-tags": Rule.RuleModule;
|
21
|
+
"nextjs/no-document-import-in-page": Rule.RuleModule;
|
22
|
+
"nextjs/no-duplicate-head": Rule.RuleModule;
|
23
|
+
"nextjs/no-head-element": Rule.RuleModule;
|
24
|
+
"nextjs/no-head-import-in-document": Rule.RuleModule;
|
25
|
+
"nextjs/no-html-link-for-pages": Rule.RuleModule;
|
26
|
+
"nextjs/no-img-element": Rule.RuleModule;
|
27
|
+
"nextjs/no-page-custom-font": Rule.RuleModule;
|
28
|
+
"nextjs/no-script-component-in-head": Rule.RuleModule;
|
29
|
+
"nextjs/no-styled-jsx-in-document": Rule.RuleModule;
|
30
|
+
"nextjs/no-sync-scripts": Rule.RuleModule;
|
31
|
+
"nextjs/no-title-in-document-head": Rule.RuleModule;
|
32
|
+
"nextjs/no-typos": Rule.RuleModule;
|
33
|
+
"nextjs/no-unwanted-polyfillio": Rule.RuleModule;
|
34
|
+
};
|
35
|
+
}
|
36
|
+
/**
|
37
|
+
* ESLint plugin for Next.js projects
|
38
|
+
*/
|
39
|
+
declare const _default: PluginConfig;
|
40
|
+
|
41
|
+
declare const rules: Record<string, _eslint_core.RuleDefinition<_eslint_core.RuleDefinitionTypeOptions>> | undefined;
|
42
|
+
|
43
|
+
export { _default as default, rules };
|