|
| 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 | +import prettier from "eslint-config-prettier"; |
| 6 | +import globals from "globals"; |
| 7 | + |
| 8 | +export default tseslint.config( |
| 9 | + { ignores: ["dist", "coverage", "src-tauri", "node_modules"] }, |
| 10 | + js.configs.recommended, |
| 11 | + ...tseslint.configs.recommended, |
| 12 | + { |
| 13 | + files: ["src/**/*.{ts,tsx}"], |
| 14 | + languageOptions: { |
| 15 | + ecmaVersion: 2022, |
| 16 | + globals: { ...globals.browser }, |
| 17 | + }, |
| 18 | + plugins: { |
| 19 | + "react-hooks": reactHooks, |
| 20 | + "react-refresh": reactRefresh, |
| 21 | + }, |
| 22 | + rules: { |
| 23 | + ...reactHooks.configs.recommended.rules, |
| 24 | + "react-refresh/only-export-components": [ |
| 25 | + "warn", |
| 26 | + { allowConstantExport: true }, |
| 27 | + ], |
| 28 | + "@typescript-eslint/no-unused-vars": [ |
| 29 | + "warn", |
| 30 | + { argsIgnorePattern: "^_", varsIgnorePattern: "^_" }, |
| 31 | + ], |
| 32 | + "@typescript-eslint/no-explicit-any": "warn", |
| 33 | + }, |
| 34 | + }, |
| 35 | + { |
| 36 | + files: ["src/test/**", "src/**/*.{test,spec}.{ts,tsx}"], |
| 37 | + languageOptions: { |
| 38 | + globals: { ...globals.browser, ...globals.node }, |
| 39 | + }, |
| 40 | + }, |
| 41 | + { |
| 42 | + files: ["*.config.{js,ts}"], |
| 43 | + languageOptions: { globals: { ...globals.node } }, |
| 44 | + }, |
| 45 | + prettier, |
| 46 | +); |
0 commit comments