|
| 1 | +import js from "@eslint/js"; |
| 2 | +import tseslint from "typescript-eslint"; |
| 3 | +import reactHooks from "eslint-plugin-react-hooks"; |
| 4 | +import reactRefresh from "eslint-plugin-react-refresh"; |
| 5 | + |
| 6 | +export default tseslint.config( |
| 7 | + { ignores: ["build/**", "node_modules/**", ".react-router/**"] }, |
| 8 | + js.configs.recommended, |
| 9 | + ...tseslint.configs.recommended, |
| 10 | + { |
| 11 | + plugins: { |
| 12 | + "react-hooks": reactHooks, |
| 13 | + "react-refresh": reactRefresh, |
| 14 | + }, |
| 15 | + rules: { |
| 16 | + ...reactHooks.configs.recommended.rules, |
| 17 | + "react-refresh/only-export-components": [ |
| 18 | + "warn", |
| 19 | + { allowConstantExport: true }, |
| 20 | + ], |
| 21 | + // Relaxed for existing codebase — tighten over time |
| 22 | + "@typescript-eslint/no-explicit-any": "warn", |
| 23 | + "@typescript-eslint/no-unused-vars": [ |
| 24 | + "warn", |
| 25 | + { argsIgnorePattern: "^_", varsIgnorePattern: "^_" }, |
| 26 | + ], |
| 27 | + "@typescript-eslint/no-empty-object-type": "warn", |
| 28 | + "react-hooks/static-components": "warn", |
| 29 | + "react-hooks/set-state-in-effect": "warn", |
| 30 | + }, |
| 31 | + } |
| 32 | +); |
0 commit comments