chore: code quality audit and lint fixes
🔍 Lint / 🪄 Check lint (pull_request) Has been cancelled
🔍 Lint / 🎨 Check format (pull_request) Has been cancelled
🔍 Lint / 🔎 Typecheck (pull_request) Has been cancelled
📊 Quality / 🔒 Security Audit (pull_request) Has been cancelled
📊 Quality / 📋 Dependency Freshness (pull_request) Has been cancelled
📊 Quality / 📦 Bundle Size (pull_request) Has been cancelled
🔍 Lint / 🏗 Build (pull_request) Has been cancelled

- Fix all 63 ESLint errors across codebase
- Consolidate MaterialWithTextureSlots type in src/types/three/three.ts
- Add CSS custom properties for design tokens
- Extract ebike constants to src/data/ebike/ebikeConfig.ts
- Add proper TypeScript types for window extensions
- Fix React hooks violations (refs during render, setState in effects)
- Remove unused exports and redundant CSS
- Add type guards for Three.js material handling
- Clean up AI slop comments and legacy CSS patterns
This commit is contained in:
Tom Boullay
2026-05-29 09:00:04 +02:00
parent ade301389e
commit 52bb1b2915
18 changed files with 550 additions and 465 deletions
+11
View File
@@ -0,0 +1,11 @@
import type * as THREE from "three";
import type { Vector3Tuple } from "@/types/three/three";
declare global {
interface Window {
ebikeVisualGroup: React.RefObject<THREE.Group | null> | null;
ebikeParkedPosition: Vector3Tuple | null;
ebikeParkedRotation: number | null;
ebikeSteerFactor: number | undefined;
}
}
+19
View File
@@ -1,4 +1,5 @@
import type { Octree } from "three-stdlib";
import type * as THREE from "three";
export type Vector3Tuple = [number, number, number];
@@ -13,3 +14,21 @@ export interface ModelTransformProps {
export type ColliderShape = "cuboid" | "ball" | "hull";
export type OctreeReadyHandler = (octree: Octree) => void;
/**
* Keys for texture slots that may exist on various material types.
*/
export type TextureMaterialKey = Extract<
| keyof THREE.MeshBasicMaterial
| keyof THREE.MeshStandardMaterial
| keyof THREE.MeshPhysicalMaterial
| keyof THREE.MeshToonMaterial,
string
>;
/**
* Interface for materials that may have texture slots.
* Used for type-safe texture diagnostic access and disposal.
*/
export type MaterialWithTextureSlots = THREE.Material &
Partial<Record<TextureMaterialKey, THREE.Texture | null>>;