import js from "@eslint/js"; import tseslint from "typescript-eslint"; import reactHooks from "eslint-plugin-react-hooks"; import reactRefresh from "eslint-plugin-react-refresh"; import globals from "globals"; export default tseslint.config( { ignores: ["out/**", "dist/**", "node_modules/**", "*.config.js", "*.config.ts"] }, js.configs.recommended, ...tseslint.configs.recommended, { files: ["**/*.{ts,tsx}"], languageOptions: { ecmaVersion: 2022, globals: { ...globals.node, ...globals.browser }, }, rules: { "@typescript-eslint/no-unused-vars": [ "warn", { argsIgnorePattern: "^_", varsIgnorePattern: "^_" }, ], "@typescript-eslint/no-explicit-any": "warn", "no-empty": ["error", { allowEmptyCatch: true }], "no-console": ["warn", { allow: ["warn", "error"] }], }, }, // The renderer is sandboxed: it must never import electron or the vrchat SDK. // It only talks to the main process through window.api (shared/ipc). { files: ["src/renderer/**/*.{ts,tsx}"], plugins: { "react-hooks": reactHooks, "react-refresh": reactRefresh }, rules: { ...reactHooks.configs.recommended.rules, "react-hooks/set-state-in-effect": "warn", "react-hooks/refs": "warn", "no-restricted-imports": [ "error", { paths: [ { name: "electron", message: "renderer must not import electron; use window.api" }, { name: "vrchat", message: "renderer must not import the vrchat SDK; use window.api" }, ], }, ], }, }, );