import js from "@eslint/js"; import nextPlugin from "@next/eslint-plugin-next"; import tsParser from "@typescript-eslint/parser"; import tsPlugin from "@typescript-eslint/eslint-plugin"; import reactHooks from "eslint-plugin-react-hooks"; import globals from "globals"; const sharedGlobals = { ...globals.browser, ...globals.node, }; const nextRules = { ...nextPlugin.configs.recommended.rules, ...nextPlugin.configs["core-web-vitals"].rules, "@next/next/no-img-element": "off", }; export default [ { ignores: ["node_modules/**", ".next/**", "out/**", "coverage/**"], }, { files: ["**/*.{js,mjs,cjs}"], languageOptions: { ...js.configs.recommended.languageOptions, globals: sharedGlobals, }, plugins: { "@next/next": nextPlugin, "react-hooks": reactHooks, }, rules: { ...js.configs.recommended.rules, ...nextRules, ...reactHooks.configs.recommended.rules, }, }, { files: ["**/*.{ts,tsx}"], languageOptions: { parser: tsParser, parserOptions: { ecmaVersion: "latest", sourceType: "module", }, globals: sharedGlobals, }, plugins: { "@next/next": nextPlugin, "@typescript-eslint": tsPlugin, "react-hooks": reactHooks, }, rules: { ...tsPlugin.configs.recommended.rules, ...nextRules, ...reactHooks.configs.recommended.rules, "no-unused-vars": "off", "@typescript-eslint/no-unused-vars": [ "warn", { argsIgnorePattern: "^_", varsIgnorePattern: "^_", }, ], }, }, ];