// ESLint flat config for Next.js 16 // Note: Using a workaround for FlatCompat circular reference issue // For more info, see https://github.com/storybookjs/eslint-plugin-storybook#configuration-flat-config-format import storybook from "eslint-plugin-storybook"; import js from "@eslint/js"; import tseslint from "@typescript-eslint/eslint-plugin"; import tsparser from "@typescript-eslint/parser"; import nextPlugin from "@next/eslint-plugin-next"; import globals from "globals"; const eslintConfig = [ // Base JavaScript recommended rules js.configs.recommended, // Storybook config ...storybook.configs["flat/recommended"], // Global ignores { ignores: [ ".next/**", "node_modules/**", "dist/**", "build/**", "coverage/**", "storybook-static/**", "playwright-report/**", "test-results/**", "lhci-results/**", "docs/**", ], }, // JavaScript files configuration { files: ["**/*.{js,jsx}"], languageOptions: { ecmaVersion: "latest", sourceType: "module", globals: { ...globals.node, ...globals.browser, ...globals.es2021, }, parserOptions: { ecmaFeatures: { jsx: true, }, }, }, }, // TypeScript files configuration { files: ["**/*.{ts,tsx}"], languageOptions: { parser: tsparser, globals: { ...globals.node, ...globals.browser, ...globals.es2021, }, parserOptions: { ecmaVersion: "latest", sourceType: "module", ecmaFeatures: { jsx: true, }, project: "./tsconfig.json", }, }, plugins: { "@typescript-eslint": tseslint, "@next/next": nextPlugin, }, rules: { "@typescript-eslint/no-unused-vars": [ "error", { argsIgnorePattern: "^_", varsIgnorePattern: "^_", }, ], "@typescript-eslint/no-explicit-any": "warn", // Next.js rules "@next/next/no-html-link-for-pages": "off", "@next/next/no-img-element": "warn", }, }, // All files - basic rules { files: ["**/*.{ts,tsx,js,jsx}"], rules: { // Basic rules "react/no-unescaped-entities": "off", "no-console": "warn", }, }, ]; export default eslintConfig;