import js from "@eslint/js"; import globals from "globals"; import typescriptParser from "@typescript-eslint/parser"; import typescriptPlugin from "@typescript-eslint/eslint-plugin"; import reactHooksPlugin from "eslint-plugin-react-hooks"; const eslintConfig = [ js.configs.recommended, { files: ["**/*.{js,jsx}"], languageOptions: { ecmaVersion: "latest", sourceType: "module", globals: { ...globals.browser, ...globals.node, ...globals.es2021, }, }, rules: { "no-console": "warn", "no-unused-vars": "warn", }, }, { files: ["**/*.{ts,tsx}"], languageOptions: { parser: typescriptParser, parserOptions: { ecmaVersion: "latest", sourceType: "module", ecmaFeatures: { jsx: true, }, }, globals: { ...globals.browser, ...globals.node, ...globals.es2021, }, }, plugins: { "@typescript-eslint": typescriptPlugin, "react-hooks": reactHooksPlugin, }, rules: { "no-console": "warn", "no-unused-vars": "off", "no-undef": "off", "@typescript-eslint/no-explicit-any": "warn", "@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_", varsIgnorePattern: "^_", }], "react-hooks/rules-of-hooks": "error", "react-hooks/exhaustive-deps": "warn", }, }, // Ignore config files and build outputs { ignores: [ "node_modules/**", ".next/**", "out/**", "dist/**", "build/**", "*.config.js", "*.config.mjs", "*.config.ts", ], }, ]; export default eslintConfig;