Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ export default [
},
rules: {
'import-x/no-unresolved': ['error', { ignore: ['^@playcanvas/react(?:/|$)'] }],
// false positives through memo(forwardRef(...)) and hook results named `props`
'react/prop-types': 'off',
'react/jsx-uses-react': 'off',
'react/react-in-jsx-scope': 'off',
'react-compiler/react-compiler': 'warn'
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"devDependencies": {
"@changesets/cli": "3.0.3",
"@playcanvas/eslint-config": "3.0.0-beta.8",
"@playcanvas/eslint-config": "3.0.0-beta.9",
"@testing-library/dom": "10.4.2",
"@types/react": "19.3.0",
"@types/react-dom": "19.3.0",
Expand Down
2 changes: 0 additions & 2 deletions packages/lib/src/Application.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@ type CanvasProps = {
// These props are excluded from the <Application/> component props.
type ExcludedApplicationProps = 'mouse' | 'touch' | 'keyboard' | 'gamepads' | 'scene' | 'scripts' | 'assets';

/* eslint-disable @typescript-eslint/consistent-type-definitions -- interfaces preserve inherited prop overrides */
interface ApplicationProps
extends Omit<Partial<PublicProps<PlayCanvasApplication>>, ExcludedApplicationProps>, CanvasProps {
/**
Expand Down Expand Up @@ -297,7 +296,6 @@ interface ApplicationWithoutCanvasProps extends ApplicationProps {
/** A ref to a html canvas element */
canvasRef: React.RefObject<HTMLCanvasElement | null>;
}
/* eslint-enable @typescript-eslint/consistent-type-definitions */

const exclude: ExcludedApplicationProps[] = ['mouse', 'touch', 'keyboard', 'gamepads', 'scene', 'scripts', 'assets'];

Expand Down
1 change: 0 additions & 1 deletion packages/lib/src/Container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { useLayoutEffect, useRef } from 'react';

import { Entity } from './Entity.tsx';
import { useApp } from './hooks/index.ts';
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- preserve the existing index signature
interface ContainerProps {
asset: Asset;
children?: React.ReactNode;
Expand Down
1 change: 0 additions & 1 deletion packages/lib/src/Entity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ export const Entity = forwardRef<PcEntity, EntityProps>(function Entity(props, r
type PointerEventCallback = (event: SyntheticPointerEvent) => void;
type MouseEventCallback = (event: SyntheticMouseEvent) => void;

// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- preserve the public inherited prop override
export interface EntityProps extends Partial<PublicProps<PcEntity>> {
/**
* The name of the entity
Expand Down
1 change: 0 additions & 1 deletion packages/lib/src/components/Align.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { Children, useLayoutEffect, useRef, useState } from 'react';
import { Entity } from '../Entity.tsx';
import { useApp, useParent } from '../hooks/index.ts';

// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- preserve the existing component declaration
interface AlignProps {
left?: boolean;
right?: boolean;
Expand Down
1 change: 0 additions & 1 deletion packages/lib/src/components/Anim.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ export const Anim: FC<AnimProps> = (props) => {
return null;
};

// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- preserve the inherited engine props
interface AnimProps extends Partial<Serializable<PublicProps<AnimComponent>>> {
/**
* The asset containing the animations to play. Setting this prop will automatically assign the animations to the component.
Expand Down
1 change: 0 additions & 1 deletion packages/lib/src/components/Collision.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ export const Collision: FC<CollisionProps> = (props) => {
return null;
};

// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- preserve the inherited engine props
interface CollisionProps extends Partial<Serializable<PublicProps<CollisionComponent>>> {
type?: 'box' | 'capsule' | 'compound' | 'cone' | 'cylinder' | 'mesh' | 'sphere';
}
Expand Down
1 change: 0 additions & 1 deletion packages/lib/src/components/Light.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export const Light: FC<LightProps> = (props) => {
return null;
};

// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- preserve the inherited engine props
interface LightProps extends Partial<Serializable<PublicProps<LightComponent>>> {
/**
* The type of the light.
Expand Down
1 change: 0 additions & 1 deletion packages/lib/src/components/Render.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ export const Render: FC<RenderProps> = (props) => {
const primitiveTypes = ['asset', 'box', 'capsule', 'cone', 'cylinder', 'plane', 'sphere', 'torus'] as const;
type PrimitiveType = (typeof primitiveTypes)[number];

// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- preserve the inherited engine props
interface RenderProps extends Omit<Partial<PublicProps<PcRenderComponent>>, 'asset'> {
/**
* The type of primitive shape to render.
Expand Down
1 change: 0 additions & 1 deletion packages/lib/src/components/RigidBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ export const RigidBody: FC<RigidBodyProps> = (props) => {
const rigidBodyTypes = [BODYTYPE_STATIC, BODYTYPE_DYNAMIC, BODYTYPE_KINEMATIC] as const;
type RigidBodyType = (typeof rigidBodyTypes)[number];

// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- preserve the inherited engine props
interface RigidBodyProps extends Partial<Serializable<PublicProps<RigidBodyComponent>>> {
/**
* Sets the rigid body type determines how the body is simulated.
Expand Down
1 change: 0 additions & 1 deletion packages/lib/src/components/Screen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export const Screen: FC<ScreenProps> = (props) => {
return null;
};

// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- preserve the inherited engine props
interface ScreenProps extends Partial<Serializable<PublicProps<ScreenComponent>>> {
/**
* Whether the screen is rendered in screen space.
Expand Down
1 change: 0 additions & 1 deletion packages/lib/src/components/Script.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ export const Script = memo(ScriptComponent, (prevProps, nextProps) => {
return prevProps.script === nextProps.script && shallowEquals(prevProps, nextProps);
});

// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- preserve the existing index signature
interface ScriptProps {
script: SubclassOf<PcScript>;
[key: string]: unknown;
Expand Down
1 change: 0 additions & 1 deletion packages/lib/src/components/Sprite.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export const Sprite: FC<SpriteProps> = (props) => {
return null;
};

// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- preserve the inherited engine props
interface SpriteProps extends Partial<PublicProps<SpriteComponent>> {
asset: Asset;
}
Expand Down
2 changes: 0 additions & 2 deletions packages/lib/src/contexts/physics-context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import React, { createContext, useContext, useEffect, useState } from 'react';
/**
* Physics context type containing physics state information.
*/
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- preserve the public context declaration
export interface PhysicsContextType {
/**
* Whether physics is enabled on the application.
Expand Down Expand Up @@ -55,7 +54,6 @@ let physicsInstanceCount = 0;
*/
export const usePhysics = () => useContext(PhysicsContext);

// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- preserve the existing provider declaration
interface PhysicsProviderProps {
children: React.ReactNode;
enabled: boolean;
Expand Down
1 change: 0 additions & 1 deletion packages/lib/src/gltf/components/Gltf.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { PathMatcher } from '../utils/path-matcher.ts';

import { RuleProcessor } from './RuleProcessor.tsx';

// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- preserve the public component declaration
export interface GltfProps {
/**
* The GLTF asset loaded via useModel
Expand Down
1 change: 0 additions & 1 deletion packages/lib/src/gltf/components/RuleProcessor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { componentSchemaRegistry } from '../utils/schema-registry.ts';
* Internal component that applies final merged rules to entities
* Handles component modifications and renders new children
*/
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- preserve the public component declaration
export interface RuleProcessorProps {
entity: Entity;
rule: MergedRule;
Expand Down
2 changes: 0 additions & 2 deletions packages/lib/src/gltf/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export enum ActionType {
/**
* Base action interface
*/
/* eslint-disable @typescript-eslint/consistent-type-definitions -- preserve the public gltf declarations */
export interface BaseAction {
type: ActionType;
ruleId: string;
Expand Down Expand Up @@ -132,4 +131,3 @@ export interface ModifyNodeProps {
clearChildren?: boolean;
children?: ReactNode;
}
/* eslint-enable @typescript-eslint/consistent-type-definitions */
2 changes: 0 additions & 2 deletions packages/lib/src/gltf/utils/path-matcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import type { Entity } from 'playcanvas';
* - Combined queries: "head.*[light]"
*/

/* eslint-disable @typescript-eslint/consistent-type-definitions -- preserve the public path declarations */
export interface PathMatcherOptions {
caseSensitive?: boolean;
}
Expand All @@ -22,7 +21,6 @@ export interface EntityMetadata {
name: string;
originalChildGUIDs: string[];
}
/* eslint-enable @typescript-eslint/consistent-type-definitions */

export type PathPredicate = (entity: Entity, metadata: EntityMetadata) => boolean;

Expand Down
3 changes: 0 additions & 3 deletions packages/lib/src/hooks/use-app-event.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ describe('useAppEvent', () => {

it('should support custom events with custom EventCallbackMap', () => {
// Define a custom event map - no need to extend BaseEventCallbackMap
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- preserve the interface generic coverage
interface CustomEventMap {
levelComplete: (level: number, score: number) => void;
playerDeath: (position: [number, number, number]) => void;
Expand Down Expand Up @@ -88,7 +87,6 @@ describe('useAppEvent', () => {

it('should support custom events without extending BaseEventCallbackMap', () => {
// Define a custom event map that doesn't extend BaseEventCallbackMap
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- preserve the interface generic coverage
interface StandaloneEventMap {
gameStart: () => void;
gamePause: (paused: boolean) => void;
Expand Down Expand Up @@ -117,7 +115,6 @@ describe('useAppEvent', () => {
});

it('should forward all arguments to the callback for custom events', async () => {
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- preserve the interface generic coverage
interface CustomEventMap {
levelComplete: (level: number, score: number) => void;
}
Expand Down
1 change: 0 additions & 1 deletion packages/lib/src/hooks/use-asset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ type AssetResultCallback = (meta: AssetMeta) => void;
/**
* Result of an asset loading operation
*/
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- preserve the public hook result declaration
export interface AssetResult {
/**
* The loaded asset, or null if not loaded or failed
Expand Down
4 changes: 2 additions & 2 deletions packages/lib/src/hooks/use-script.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ export const useScript = (scriptConstructor: SubclassOf<Script>, props: Props, r
}, [props]);
};

/* eslint-disable @typescript-eslint/consistent-indexed-object-style, @typescript-eslint/consistent-type-definitions -- preserve the existing index signature */
/* eslint-disable @typescript-eslint/consistent-indexed-object-style -- preserve the existing index signature */
interface Props {
[key: string]: unknown;
}
/* eslint-enable @typescript-eslint/consistent-indexed-object-style, @typescript-eslint/consistent-type-definitions */
/* eslint-enable @typescript-eslint/consistent-indexed-object-style */
1 change: 0 additions & 1 deletion packages/lib/src/types/graphics-device-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* Type definition for graphics device options that can be passed to the PlayCanvas Application.
* These options correspond to WebGL context attributes.
*/
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- preserve the public options declaration
export interface GraphicsDeviceOptions {
/** Whether the canvas contains an alpha buffer. */
alpha?: boolean;
Expand Down
1 change: 0 additions & 1 deletion packages/lib/test/utils/gltf-entity-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ export function createEntityHierarchy(app: PcApplication, structure: EntityStruc
/**
* Structure definition for entity hierarchy
*/
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- preserve the existing recursive declaration
export interface EntityStructure {
name: string;
components?: Record<string, Record<string, unknown> | undefined>;
Expand Down
Loading
Loading