import eslint from "@eslint/js"; 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 tseslint.config( { ignores: ["dist", "coverage", "node_modules"] }, eslint.configs.recommended, ...tseslint.configs.strictTypeChecked, ...tseslint.configs.stylisticTypeChecked, { files: ["**/*.{ts,tsx}"], languageOptions: { globals: { ...globals.browser, ...globals.node }, parserOptions: { projectService: true, tsconfigRootDir: import.meta.dirname, }, }, plugins: { "react-hooks": reactHooks, "react-refresh": reactRefresh, }, rules: { ...reactHooks.configs.flat.recommended.rules, "react-refresh/only-export-components": ["warn", { allowConstantExport: true }], "@typescript-eslint/consistent-type-definitions": ["error", "interface"], "@typescript-eslint/no-confusing-void-expression": "off", "@typescript-eslint/restrict-template-expressions": ["error", { allowNumber: true }], "react-hooks/set-state-in-effect": "off", }, }, { files: ["tests/**/*.{ts,tsx}"], rules: { "@typescript-eslint/no-non-null-assertion": "off", }, }, );