Skip to content

Commit 3ad8ece

Browse files
committed
Tests
1 parent ddd49cb commit 3ad8ece

81 files changed

Lines changed: 3926 additions & 391 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

eslint.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export default [
1313
'dist/**',
1414
'build/**',
1515
'public/**',
16+
'html/**',
1617
'.DS_Store',
1718
'coverage/**',
1819
'*.log',
@@ -69,5 +70,13 @@ export default [
6970
],
7071
},
7172
},
73+
{
74+
files: ['**/*.test.{js,jsx,ts,tsx}', '**/__tests__/**/*.{js,jsx,ts,tsx}'],
75+
rules: {
76+
'@typescript-eslint/no-require-imports': 'off',
77+
'@typescript-eslint/no-explicit-any': 'off',
78+
'@typescript-eslint/no-unused-vars': 'off',
79+
},
80+
},
7281
prettierConfig,
7382
];

src/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default function App() {
1212
// Initialize the new ECS system
1313
useEffect(() => {
1414
// Use a flag to prevent double registration in development StrictMode
15-
const isInitialized = (window as any).__ecsSystemInitialized;
15+
const isInitialized = (window as { __ecsSystemInitialized?: boolean }).__ecsSystemInitialized;
1616
if (isInitialized) {
1717
console.log('ECS system already initialized, skipping...');
1818
return;
@@ -22,7 +22,7 @@ export default function App() {
2222
// Initialize the new component registry system
2323
initializeECS();
2424
console.log('✅ ECS System initialized successfully');
25-
(window as any).__ecsSystemInitialized = true;
25+
(window as { __ecsSystemInitialized?: boolean }).__ecsSystemInitialized = true;
2626
} catch (error) {
2727
console.error('❌ Failed to initialize ECS System:', error);
2828
console.error('Error details:', error);

src/core/components/cameras/CameraBackgroundManager.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export const CameraBackgroundManager: React.FC = () => {
1717
const world = ECSWorld.getInstance().getWorld();
1818
const lastUpdateRef = useRef<{
1919
clearFlags: string;
20-
backgroundColor?: any;
20+
backgroundColor?: { r: number; g: number; b: number; a: number };
2121
skyboxTexture?: string;
2222
}>({
2323
clearFlags: 'skybox',

src/core/components/cameras/CameraControlsManager.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const CameraControlsManager: React.FC<ICameraControlsManagerProps> = ({
2525
isTransforming,
2626
}) => {
2727
const [updateTrigger, setUpdateTrigger] = useState(0);
28-
const orbitControlsRef = useRef<any>(null);
28+
const orbitControlsRef = useRef<typeof OrbitControls | null>(null);
2929

3030
// Find the main camera and get its control mode
3131
const findMainCameraData = useCallback(() => {
@@ -91,7 +91,7 @@ export const CameraControlsManager: React.FC<ICameraControlsManagerProps> = ({
9191
}
9292

9393
const { cameraData } = mainCameraData;
94-
const controlMode = (cameraData as any).controlMode ?? 'free';
94+
const controlMode = (cameraData as CameraData & { controlMode?: string }).controlMode ?? 'free';
9595

9696
// Update target in free mode with follow enabled (even when transforming)
9797
if (controlMode === 'free' && cameraData.enableSmoothing && cameraData.followTarget) {

src/core/components/cameras/CameraFollowManager.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@ export const CameraFollowManager: React.FC<ICameraFollowManagerProps> = ({ isPla
169169

170170
// NEW LOGIC: Determine if camera should follow based on mode
171171
const cameraData = componentRegistry.getComponentData(state.followingCamera, 'Camera');
172-
const controlMode = (cameraData as any)?.controlMode ?? 'free';
172+
const controlMode =
173+
(cameraData as CameraData & { controlMode?: string })?.controlMode ?? 'free';
173174

174175
// In Editor mode: ALWAYS follow regardless of control mode
175176
// In Play mode: Only follow in locked mode (free mode uses OrbitControls which handles following via target updates)

src/core/components/cameras/GameCameraManager.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ export const GameCameraManager: React.FC<IGameCameraManagerProps> = ({ isPlaying
4444
KnownComponentTypes.TRANSFORM,
4545
);
4646

47-
const cameraData = cameraComponent?.data as CameraData | undefined;
48-
const transformData = transformComponent?.data as ITransformData | undefined;
47+
const cameraData = cameraComponent?.data as CameraData;
48+
const transformData = transformComponent?.data as ITransformData;
4949

5050
return {
5151
entityId,

0 commit comments

Comments
 (0)