import js from "@eslint/js"; import globals from "globals"; import reactHooks from "eslint-plugin-react-hooks"; import reactRefresh from "eslint-plugin-react-refresh"; import tseslint from "@typescript-eslint/eslint-plugin"; import tsParser from "@typescript-eslint/parser"; import { URL } from "node:url"; export default [ { ignores: ["node_modules/**", "dist/**", ".next/**"], }, js.configs.recommended, { files: ["src/**/*.{ts,tsx}"], languageOptions: { parser: tsParser, parserOptions: { project: ["./tsconfig.json"], tsconfigRootDir: new URL(".", import.meta.url).pathname, ecmaFeatures: { jsx: true }, }, globals: { ...globals.browser, ...globals.node }, }, plugins: { "@typescript-eslint": tseslint, "react-hooks": reactHooks, "react-refresh": reactRefresh, }, rules: { ...tseslint.configs["recommended-type-checked"].rules, ...reactHooks.configs.recommended.rules, "react-refresh/only-export-components": [ "warn", { allowConstantExport: true }, ], }, }, { files: ["vite.config.ts"], languageOptions: { parser: tsParser, parserOptions: { project: ["./tsconfig.node.json"], tsconfigRootDir: new URL(".", import.meta.url).pathname, }, globals: { ...globals.node }, }, plugins: { "@typescript-eslint": tseslint, }, rules: { ...tseslint.configs.recommended.rules, }, }, ];