diff --git a/.oxlintrc.json b/.oxlintrc.json new file mode 100644 index 0000000..13bcd02 --- /dev/null +++ b/.oxlintrc.json @@ -0,0 +1,34 @@ +{ + "$schema": "./node_modules/oxlint/configuration_schema.json", + "plugins": ["react", "react-perf", "promise", "import"], + "categories": { + "correctness": "error", + "suspicious": "warn" + }, + "rules": { + "no-shadow": "off", + "react/react-in-jsx-scope": "off", + "react/prop-types": "off", + "react/display-name": "off", + "react/no-unknown-property": "off", + "import/no-unassigned-import": [ + "warn", + { + "allow": [ + "**/*.css", + "@pixi/canvas-display", + "@pixi/canvas-extract", + "@pixi/canvas-graphics", + "@pixi/canvas-mesh", + "@pixi/canvas-particle-container", + "@pixi/canvas-prepare", + "@pixi/canvas-renderer", + "@pixi/canvas-sprite-tiling", + "@pixi/canvas-sprite", + "@pixi/canvas-text" + ] + } + ] + }, + "ignorePatterns": ["dist/", "node_modules/"] +} diff --git a/README.md b/README.md index 4bff9bd..e44817b 100644 --- a/README.md +++ b/README.md @@ -30,3 +30,8 @@ bun dev - Questinmark after flag - Earn points for wins - Powerups + +## TODOs + +- Fix scoreboard modal +- Fix fullscrean diff --git a/bun.lockb b/bun.lockb index cf944d5..96e95cc 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/eslint.config.js b/eslint.config.js deleted file mode 100644 index edef9da..0000000 --- a/eslint.config.js +++ /dev/null @@ -1,40 +0,0 @@ -import globals from "globals"; -import pluginJs from "@eslint/js"; -import tseslint from "typescript-eslint"; -import pluginReact from "eslint-plugin-react"; -import reactHooks from "eslint-plugin-react-hooks"; - -export default [ - { - ignores: ["dist/", "node_modules/"], - }, - pluginJs.configs.recommended, - ...tseslint.configs.recommended, - { - ...pluginReact.configs.flat.recommended, - settings: { - react: { - version: "detect", - }, - }, - }, - { - plugins: { "react-hooks": reactHooks }, - rules: reactHooks.configs.recommended.rules, - }, - { - files: ["**/*.{js,mjs,cjs,ts,jsx,tsx}"], - rules: { - "react/react-in-jsx-scope": "off", - "react/prop-types": "off", - "react/display-name": "off", - "react/no-unknown-property": "off", - }, - }, - { - languageOptions: { - ...pluginReact.configs.flat.recommended.languageOptions, - globals: { ...globals.browser, ...globals.node }, - }, - }, -]; diff --git a/package.json b/package.json index a0ff57b..ab089cf 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "dev:backend": "bun run backend/index.ts --watch --hot", "dev:client": "vite", "build": "tsc -b && vite build", - "lint": "eslint", + "lint": "oxlint", "preview": "vite preview", "drizzle:schema": "drizzle-kit generate", "drizzle:migrate": "bun run backend/migrate.ts", @@ -51,8 +51,6 @@ "zod": "^4.1.8" }, "devDependencies": { - "@eslint/compat": "^1.3.2", - "@eslint/js": "^9.35.0", "@tailwindcss/vite": "next", "@types/bun": "latest", "@types/random-seed": "^0.3.5", @@ -60,13 +58,9 @@ "@types/react-dom": "^19.1.9", "@vitejs/plugin-react-swc": "^4.0.1", "drizzle-kit": "0.31.4", - "eslint": "^9.35.0", - "eslint-plugin-react": "^7.37.5", - "eslint-plugin-react-hooks": "5.2.0", - "globals": "^16.4.0", + "oxlint": "^1.51.0", "tailwindcss": "^4.1.13", "typescript": "^5.9.2", - "typescript-eslint": "^8.44.0", "vite": "^7.1.5", "vite-bundle-analyzer": "^1.2.3", "vite-imagetools": "^8.0.0" diff --git a/src/components/Auth/LoginButton.tsx b/src/components/Auth/LoginButton.tsx index 66b1c23..7ef0263 100644 --- a/src/components/Auth/LoginButton.tsx +++ b/src/components/Auth/LoginButton.tsx @@ -64,6 +64,7 @@ const LoginButton = () => { token: res.token, }); await queryClient.resetQueries(); + return; }) .catch((e) => { setError(e); diff --git a/src/components/Auth/RegisterButton.tsx b/src/components/Auth/RegisterButton.tsx index cdeb5eb..5eee063 100644 --- a/src/components/Auth/RegisterButton.tsx +++ b/src/components/Auth/RegisterButton.tsx @@ -83,6 +83,7 @@ const RegisterButton = () => { }); await queryClient.resetQueries(); setIsOpen(false); + return; }) .catch((e) => { setError(e); diff --git a/src/components/Board.tsx b/src/components/Board.tsx index 6e65bf9..8a9ee08 100644 --- a/src/components/Board.tsx +++ b/src/components/Board.tsx @@ -143,6 +143,19 @@ const Board: React.FC = (props) => { const viewportRef = useRef(null); const [zenMode, setZenMode] = useState(false); + + // Force resize when zen mode changes - the layout needs time to settle + useEffect(() => { + const timeout = setTimeout(() => { + if (ref.current) { + setWidth(ref.current.clientWidth); + setHeight(ref.current.clientHeight); + if (viewportRef.current) onViewportChange(viewportRef.current); + } + }, 50); + return () => clearTimeout(timeout); + }, [zenMode, onViewportChange]); + useEffect(() => { if (ref.current) { ref.current.addEventListener("wheel", (e) => { @@ -187,7 +200,7 @@ const Board: React.FC = (props) => {
= (props) => {
{theme && ( Leaderboard -
+
{leaderboard?.map((_, i) => (
{i + 1}.
diff --git a/src/components/pixi/PixiViewport.tsx b/src/components/pixi/PixiViewport.tsx index ce8ac1f..75e4cd4 100644 --- a/src/components/pixi/PixiViewport.tsx +++ b/src/components/pixi/PixiViewport.tsx @@ -65,6 +65,7 @@ const PixiViewport = (props: ViewportProps) => { viewport.off("zoomed-end"); }; }, [clamp, clampZoom, onViewportChange, viewportRef, app.renderer]); + if (!app.renderer) return null; return ( { }; setup().then(() => { - createRoot(document.getElementById("root")!).render( + return createRoot(document.getElementById("root")!).render( diff --git a/src/views/store/Store.tsx b/src/views/store/Store.tsx index f589781..3cb6651 100644 --- a/src/views/store/Store.tsx +++ b/src/views/store/Store.tsx @@ -15,7 +15,7 @@ import { Rarity } from "../../components/Rarity"; import { lootboxResultAtom } from "../../atoms"; import { useAtom } from "jotai"; import { useEffect } from "react"; -import Particles, { initParticlesEngine } from "@tsparticles/react"; +import { initParticlesEngine, Particles as ParticlesComponent } from "@tsparticles/react"; import { motion } from "motion/react"; import BounceImg from "../../components/BounceImg"; @@ -29,9 +29,8 @@ const Store = () => { useEffect(() => { const cb = async () => { const { loadSlim } = await import("@tsparticles/slim"); - const { loadSeaAnemonePreset } = await import( - "@tsparticles/preset-sea-anemone" - ); + const { loadSeaAnemonePreset } = + await import("@tsparticles/preset-sea-anemone"); initParticlesEngine(async (engine) => { // you can initiate the tsParticles instance (engine) here, adding custom shapes or presets // this loads the tsparticles package bundle, it's the easiest method for getting everything ready @@ -60,7 +59,7 @@ const Store = () => {
-