import antfu, { OptionsConfig, TypedFlatConfigItem, ConfigNames } from '@antfu/eslint-config'; import { FlatConfigComposer } from 'eslint-flat-config-utils'; import { Linter } from 'eslint'; interface NextOptions { /** * Enable the core web vitals rules. * @see https://nextjs.org/docs/app/building-your-application/configuring/eslint#core-web-vitals * @default true */ webVitals?: boolean; } /* eslint-disable */ /* prettier-ignore */ declare module 'eslint' { namespace Linter { interface RulesRecord extends RuleOptions {} } } interface RuleOptions { /** * Enforce font-display behavior with Google Fonts. * @see https://nextjs.org/docs/messages/google-font-display */ '@next/next/google-font-display'?: Linter.RuleEntry<[]> /** * Ensure `preconnect` is used with Google Fonts. * @see https://nextjs.org/docs/messages/google-font-preconnect */ '@next/next/google-font-preconnect'?: Linter.RuleEntry<[]> /** * Enforce `id` attribute on `next/script` components with inline content. * @see https://nextjs.org/docs/messages/inline-script-id */ '@next/next/inline-script-id'?: Linter.RuleEntry<[]> /** * Prefer `next/script` component when using the inline script for Google Analytics. * @see https://nextjs.org/docs/messages/next-script-for-ga */ '@next/next/next-script-for-ga'?: Linter.RuleEntry<[]> /** * Prevent assignment to the `module` variable. * @see https://nextjs.org/docs/messages/no-assign-module-variable */ '@next/next/no-assign-module-variable'?: Linter.RuleEntry<[]> /** * Prevent client components from being async functions. * @see https://nextjs.org/docs/messages/no-async-client-component */ '@next/next/no-async-client-component'?: Linter.RuleEntry<[]> /** * Prevent usage of `next/script`'s `beforeInteractive` strategy outside of `pages/_document.js`. * @see https://nextjs.org/docs/messages/no-before-interactive-script-outside-document */ '@next/next/no-before-interactive-script-outside-document'?: Linter.RuleEntry<[]> /** * Prevent manual stylesheet tags. * @see https://nextjs.org/docs/messages/no-css-tags */ '@next/next/no-css-tags'?: Linter.RuleEntry<[]> /** * Prevent importing `next/document` outside of `pages/_document.js`. * @see https://nextjs.org/docs/messages/no-document-import-in-page */ '@next/next/no-document-import-in-page'?: Linter.RuleEntry<[]> /** * Prevent duplicate usage of `
` in `pages/_document.js`. * @see https://nextjs.org/docs/messages/no-duplicate-head */ '@next/next/no-duplicate-head'?: Linter.RuleEntry<[]> /** * Prevent usage of `` element. * @see https://nextjs.org/docs/messages/no-head-element */ '@next/next/no-head-element'?: Linter.RuleEntry<[]> /** * Prevent usage of `next/head` in `pages/_document.js`. * @see https://nextjs.org/docs/messages/no-head-import-in-document */ '@next/next/no-head-import-in-document'?: Linter.RuleEntry<[]> /** * Prevent usage of `` elements to navigate to internal Next.js pages. * @see https://nextjs.org/docs/messages/no-html-link-for-pages */ '@next/next/no-html-link-for-pages'?: Linter.RuleEntry