- Type response bodies in gameController.test.ts to fix no-unsafe-member-access - Replace async methods with Promise.resolve() in InMemoryGameSessionStore and InMemoryLobbyGameStore to satisfy require-await rule - Add argsIgnorePattern and varsIgnorePattern to eslint config so underscore-prefixed params are globally ignored - Fix no-misused-promises in ws/index.ts, lobbyHandlers, gameHandlers, __root.tsx, login.tsx and play.tsx by using void + .catch() - Fix no-floating-promises on navigate calls in login.tsx - Move API_URL outside Play component to fix useCallback dependency warning - Type fetch response bodies in play.tsx to fix no-unsafe-assignment - Add only-throw-error: off for route files (TanStack Router throw redirect) - Remove unused WebSocket import from express.d.ts - Fix unsafe return in connections.ts by typing empty Map constructor - Exclude scripts/ folder from eslint - Add targeted override for better-auth auth-client.ts (upstream typing issue)
65 lines
1.7 KiB
JavaScript
65 lines
1.7 KiB
JavaScript
import eslint from "@eslint/js";
|
|
import { defineConfig, globalIgnores } from "eslint/config";
|
|
import eslintConfigPrettier from "eslint-config-prettier/flat";
|
|
import tseslint from "typescript-eslint";
|
|
import reactHooks from "eslint-plugin-react-hooks";
|
|
import reactRefresh from "eslint-plugin-react-refresh";
|
|
import pluginRouter from "@tanstack/eslint-plugin-router";
|
|
|
|
export default defineConfig([
|
|
globalIgnores([
|
|
"**/dist/**",
|
|
"node_modules/",
|
|
"eslint.config.mjs",
|
|
"**/*.config.ts",
|
|
"routeTree.gen.ts",
|
|
"scripts/**",
|
|
]),
|
|
|
|
eslint.configs.recommended,
|
|
tseslint.configs.recommendedTypeChecked,
|
|
eslintConfigPrettier,
|
|
|
|
{
|
|
languageOptions: {
|
|
parserOptions: {
|
|
projectService: true,
|
|
tsconfigRootDir: import.meta.dirname,
|
|
},
|
|
},
|
|
},
|
|
|
|
{
|
|
files: ["apps/web/**/*.{ts,tsx}"],
|
|
extends: [
|
|
...pluginRouter.configs["flat/recommended"],
|
|
reactHooks.configs.flat.recommended,
|
|
reactRefresh.configs.vite,
|
|
],
|
|
},
|
|
{
|
|
files: ["apps/web/src/routes/**/*.{ts,tsx}"],
|
|
rules: {
|
|
"react-refresh/only-export-components": "off",
|
|
"@typescript-eslint/only-throw-error": "off",
|
|
},
|
|
},
|
|
{
|
|
rules: {
|
|
"@typescript-eslint/no-unused-vars": [
|
|
"error",
|
|
{
|
|
argsIgnorePattern: "^_",
|
|
varsIgnorePattern: "^_",
|
|
caughtErrorsIgnorePattern: "^_",
|
|
},
|
|
],
|
|
},
|
|
},
|
|
{
|
|
// better-auth's createAuthClient return type is insufficiently typed upstream.
|
|
// This is a known issue: https://github.com/better-auth/better-auth/issues
|
|
files: ["apps/web/src/lib/auth-client.ts"],
|
|
rules: { "@typescript-eslint/no-unsafe-assignment": "off" },
|
|
},
|
|
]);
|