import path from "node:path"; import js from "@eslint/js"; import { defineConfig, globalIgnores, includeIgnoreFile } from "eslint/config"; import prettierRecommended from "eslint-plugin-prettier/recommended"; import reactHooks from "eslint-plugin-react-hooks"; import reactRefresh from "eslint-plugin-react-refresh"; import globals from "globals"; import tseslint from "typescript-eslint"; export default defineConfig([ includeIgnoreFile(path.join(import.meta.dirname, ".gitignore")), globalIgnores(["src/components/ui/", "**/*.d.ts", "**/*.cjs", "**/*.mjs"]), js.configs.recommended, tseslint.configs.recommended, prettierRecommended, { languageOptions: { globals: { ...globals.browser, ...globals.node }, }, plugins: { "react-hooks": reactHooks, "react-refresh": reactRefresh, }, rules: { "react-hooks/rules-of-hooks": "error", "react-hooks/exhaustive-deps": "error", "react-refresh/only-export-components": [ "warn", { allowConstantExport: true }, ], "no-unused-vars": "off", "@typescript-eslint/no-unused-vars": [ "error", { argsIgnorePattern: "^_", varsIgnorePattern: "^_", caughtErrorsIgnorePattern: "^_", }, ], "no-console": "error", "prettier/prettier": "warn", }, }, ]);