Skip to content

Commit 7f92b50

Browse files
chore(deps): update dependency @isentinel/eslint-config to v0.7.2
chore(deps): update dependency @isentinel/eslint-config to v0.7.2
2 parents e8b800d + 49c7a5d commit 7f92b50

19 files changed

+115
-186
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"@commitlint/types": "19.0.3",
6262
"@eslint-react/eslint-plugin": "1.5.27",
6363
"@eslint/config-inspector": "0.5.1",
64-
"@isentinel/eslint-config": "0.7.1",
64+
"@isentinel/eslint-config": "0.7.2",
6565
"@rbxts/compiler-types": "2.3.0-types.1",
6666
"@rbxts/types": "1.0.790",
6767
"bundle-require": "5.0.0",

pnpm-lock.yaml

+36-123
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/client/ui/components/background-blur.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type { BindingValue } from "types/util/react";
66

77
interface BackgroundBlurProps {
88
/** The size of the blur effect. */
9-
readonly BlurSize?: BindingValue<number>;
9+
BlurSize?: BindingValue<number>;
1010
}
1111

1212
/**
@@ -15,7 +15,7 @@ interface BackgroundBlurProps {
1515
* @param props - The component props.
1616
* @returns The rendered background blur component.
1717
*/
18-
export function BackgroundBlur({ BlurSize }: BackgroundBlurProps): React.Element {
18+
export function BackgroundBlur({ BlurSize }: Readonly<BackgroundBlurProps>): React.Element {
1919
const camera = useCamera();
2020
const [visible, setVisible] = useState(false);
2121

src/client/ui/components/delay-render.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ import { setTimeout } from "@rbxts/set-timeout";
33

44
interface DelayRenderProps extends React.PropsWithChildren {
55
/** The delay (in seconds) before rendering the children component. */
6-
readonly MountDelay?: number;
6+
MountDelay?: number;
77
/**
88
* Indicates whether the children component should be rendered. If true, the
99
* children component will be rendered after the MountDelay. If false, the
1010
* children component will be unmounted after the UnmountDelay.
1111
*/
12-
readonly ShouldRender: boolean;
12+
ShouldRender: boolean;
1313
/** The delay (in seconds) before unmounting the children component. */
14-
readonly UnmountDelay?: number;
14+
UnmountDelay?: number;
1515
}
1616

1717
/**
@@ -39,7 +39,7 @@ export function DelayRender({
3939
ShouldRender,
4040
UnmountDelay = 0,
4141
children,
42-
}: DelayRenderProps): React.Element {
42+
}: Readonly<DelayRenderProps>): React.Element {
4343
const [render, setRender] = useState(false);
4444

4545
useEffect(() => {

src/client/ui/components/error-handler/error-boundary.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { ErrorInfo } from "@rbxts/react";
33
import React, { ReactComponent } from "@rbxts/react";
44

55
interface ErrorBoundaryProps extends React.PropsWithChildren {
6-
readonly Fallback: (error: unknown) => React.Element;
6+
Fallback: (error: unknown) => React.Element;
77
}
88

99
interface ErrorBoundaryState {
@@ -26,7 +26,10 @@ interface ErrorBoundaryState {
2626
* @see https://react.dev/reference/react/Component#catching-rendering-errors-with-an-error-boundary
2727
*/
2828
@ReactComponent
29-
export default class ErrorBoundary extends React.Component<ErrorBoundaryProps, ErrorBoundaryState> {
29+
export default class ErrorBoundary extends React.Component<
30+
Readonly<ErrorBoundaryProps>,
31+
ErrorBoundaryState
32+
> {
3033
public readonly state: ErrorBoundaryState = {
3134
hasError: false,
3235
};

src/client/ui/components/error-handler/error-handler.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import React from "@rbxts/react";
33
import ErrorBoundary from "./error-boundary";
44
import ErrorPage from "./error-page";
55

6-
type ErrorHandlerProps = Readonly<React.PropsWithChildren>;
6+
type ErrorHandlerProps = React.PropsWithChildren;
77

8-
export default function ErrorHandler({ children }: ErrorHandlerProps): React.Element {
8+
export default function ErrorHandler({ children }: Readonly<ErrorHandlerProps>): React.Element {
99
return (
1010
<ErrorBoundary
1111
Fallback={err => {
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import React from "@rbxts/react";
22

33
interface ErrorPageProps {
4-
readonly Message: string;
4+
Message: string;
55
}
66

7-
export default function ErrorPage({ Message }: ErrorPageProps): React.Element {
7+
export default function ErrorPage({ Message }: Readonly<ErrorPageProps>): React.Element {
88
warn(Message);
99

10-
// eslint-disable-next-line react/no-useless-fragment -- This is a placeholder for future functions.
10+
// eslint-disable-next-line react/no-useless-fragment -- This is a placeholder for a future error page.
1111
return <></>;
1212
}

src/client/ui/components/object-viewport.tsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ import Make from "@rbxts/make";
22
import { useMountEffect } from "@rbxts/pretty-react-hooks";
33
import React, { useRef } from "@rbxts/react";
44

5-
interface Props extends React.PropsWithChildren {
5+
export interface ObjectViewportProps extends React.PropsWithChildren {
66
/** Additional depth to push the camera back. */
7-
readonly ExtraCameraDepth?: number;
7+
ExtraCameraDepth?: number;
88
/** The native props to a viewport. */
9-
readonly Native: React.InstanceProps<ViewportFrame>;
9+
Native: React.InstanceProps<ViewportFrame>;
1010
/** The object to be displayed in the viewport. */
11-
readonly Object: BasePart | Model;
11+
Object: BasePart | Model;
1212
}
1313

1414
function setDefaultCameraView(camera: Camera, model: Model, cameraDepth = 0): void {
@@ -47,7 +47,7 @@ export default function ObjectViewport({
4747
Native,
4848
Object,
4949
children,
50-
}: Props): React.Element {
50+
}: Readonly<ObjectViewportProps>): React.Element {
5151
// Setup the viewport after mounting when we have a ref to it
5252
const viewportRef = useRef<ViewportFrame>();
5353

src/client/ui/components/primitive/button.tsx

+7-7
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@ import type { FrameProps } from "./frame";
44

55
export interface ButtonProps extends FrameProps<TextButton> {
66
/** The default properties of a `TextButton` component. */
7-
readonly Native?: Partial<React.InstanceProps<TextButton>>;
7+
Native?: Partial<React.InstanceProps<TextButton>>;
88
/** A callback that is triggered when the button is clicked. */
9-
readonly onClick?: () => void;
9+
onClick?: () => void;
1010
/**
1111
* A callback that is triggered when the mouse button is pressed down on the
1212
* button.
1313
*/
14-
readonly onMouseDown?: () => void;
14+
onMouseDown?: () => void;
1515
/** A callback that is triggered when the mouse enters the button. */
16-
readonly onMouseEnter?: () => void;
16+
onMouseEnter?: () => void;
1717
/** A callback that is triggered when the mouse leaves the button. */
18-
readonly onMouseLeave?: () => void;
18+
onMouseLeave?: () => void;
1919
/**
2020
* A callback that is triggered when the mouse button is released on the
2121
* button.
2222
*/
23-
readonly onMouseUp?: () => void;
23+
onMouseUp?: () => void;
2424
}
2525

2626
/**
@@ -55,7 +55,7 @@ export default function Button({
5555
onMouseLeave,
5656
onMouseUp,
5757
children,
58-
}: ButtonProps): React.Element {
58+
}: Readonly<ButtonProps>): React.Element {
5959
const event = {
6060
Activated: () => {
6161
onClick?.();

src/client/ui/components/primitive/canvas-group.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export type CanvasGroupProps = FrameProps<CanvasGroup>;
1919
*
2020
* @see https://developer.roblox.com/en-us/api-reference/class/CanvasGroup
2121
*/
22-
const CanvasGroup = forwardRef((props: CanvasGroupProps, ref: React.Ref<CanvasGroup>) => {
22+
const CanvasGroup = forwardRef((props: Readonly<CanvasGroupProps>, ref: React.Ref<CanvasGroup>) => {
2323
const { CornerRadius, Native, children } = props;
2424

2525
return (

src/client/ui/components/primitive/frame.tsx

+18-16
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import type { BindingValue } from "types/util/react";
55

66
export interface FrameProps<T extends Instance = Frame> extends React.PropsWithChildren {
77
/** An optional helper that rounds the corners of the frame. */
8-
readonly CornerRadius?: BindingValue<UDim>;
8+
CornerRadius?: BindingValue<UDim>;
99
/** The default properties of the component. */
10-
readonly Native?: Partial<React.InstanceProps<T>>;
10+
Native?: Partial<React.InstanceProps<T>>;
1111
}
1212

1313
/**
@@ -29,20 +29,22 @@ export interface FrameProps<T extends Instance = Frame> extends React.PropsWithC
2929
*
3030
* @see https://create.roblox.com/docs/reference/engine/classes/Frame
3131
*/
32-
const Frame = forwardRef(({ CornerRadius, Native, children }: FrameProps, ref: Ref<Frame>) => {
33-
const { AnchorPoint, Position } = Native ?? {};
32+
const Frame = forwardRef(
33+
({ CornerRadius, Native, children }: Readonly<FrameProps>, ref: Ref<Frame>) => {
34+
const { AnchorPoint, Position } = Native ?? {};
3435

35-
return (
36-
<frame
37-
ref={ref}
38-
{...Native}
39-
AnchorPoint={AnchorPoint ?? new Vector2(0.5, 0.5)}
40-
Position={Position ?? new UDim2(0.5, 0, 0.5, 0)}
41-
>
42-
{children}
43-
{CornerRadius ? <uicorner CornerRadius={CornerRadius} /> : undefined}
44-
</frame>
45-
);
46-
});
36+
return (
37+
<frame
38+
ref={ref}
39+
{...Native}
40+
AnchorPoint={AnchorPoint ?? new Vector2(0.5, 0.5)}
41+
Position={Position ?? new UDim2(0.5, 0, 0.5, 0)}
42+
>
43+
{children}
44+
{CornerRadius ? <uicorner CornerRadius={CornerRadius} /> : undefined}
45+
</frame>
46+
);
47+
},
48+
);
4749

4850
export default Frame;

src/client/ui/components/primitive/group.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, { forwardRef } from "@rbxts/react";
22

33
interface GroupProps extends React.PropsWithChildren {
44
/** All the default properties of a `Frame` component. */
5-
readonly Native?: Partial<Omit<React.InstanceProps<Frame>, "BackgroundTransparency">>;
5+
Native?: Partial<Omit<React.InstanceProps<Frame>, "BackgroundTransparency">>;
66
}
77

88
/**
@@ -22,7 +22,7 @@ interface GroupProps extends React.PropsWithChildren {
2222
*
2323
* @component
2424
*/
25-
const Group = forwardRef(({ Native, children }: GroupProps, ref: React.Ref<Frame>) => {
25+
const Group = forwardRef(({ Native, children }: Readonly<GroupProps>, ref: React.Ref<Frame>) => {
2626
const { AnchorPoint, Position, Size } = Native ?? {};
2727

2828
return (

src/client/ui/components/primitive/image.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import type { FrameProps } from "./frame";
77

88
export interface ImageProps extends FrameProps<ImageLabel> {
99
/** The image to display. */
10-
readonly Image: BindingValue<AssetId>;
10+
Image: BindingValue<AssetId>;
1111
}
1212

1313
/**
@@ -28,7 +28,7 @@ export interface ImageProps extends FrameProps<ImageLabel> {
2828
*
2929
* @see https://developer.roblox.com/en-us/api-reference/class/ImageLabel
3030
*/
31-
const ImageLabel = forwardRef((props: ImageProps, ref: React.Ref<ImageLabel>) => {
31+
const ImageLabel = forwardRef((props: Readonly<ImageProps>, ref: React.Ref<ImageLabel>) => {
3232
const { CornerRadius, Image, Native, children } = props;
3333

3434
return (

src/client/ui/components/primitive/layer.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ export interface LayerProps extends React.PropsWithChildren {
1212
*
1313
* @default true
1414
*/
15-
readonly ClampUltraWide?: boolean;
15+
ClampUltraWide?: boolean;
1616
/** The display order of the layer. */
17-
readonly DisplayOrder?: number;
17+
DisplayOrder?: number;
1818
}
1919

2020
/**
@@ -47,7 +47,7 @@ export default function Layer({
4747
ClampUltraWide = true,
4848
DisplayOrder,
4949
children,
50-
}: LayerProps): React.Element {
50+
}: Readonly<LayerProps>): React.Element {
5151
return $NODE_ENV === "development" && IS_EDIT ? (
5252
<Group
5353
Native={{

src/client/ui/components/primitive/padding-component.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { PropsWithChildren } from "@rbxts/react";
22
import React, { forwardRef } from "@rbxts/react";
33

44
interface PaddingProps extends PropsWithChildren {
5-
readonly Padding: number;
5+
Padding: number;
66
}
77

88
/**
@@ -19,7 +19,7 @@ interface PaddingProps extends PropsWithChildren {
1919
* @see https://developer.roblox.com/en-us/api-reference/class/UIPadding
2020
*/
2121
const PaddingComponent = forwardRef(
22-
({ Padding, children }: PaddingProps, ref: React.Ref<UIPadding>) => {
22+
({ Padding, children }: Readonly<PaddingProps>, ref: React.Ref<UIPadding>) => {
2323
return (
2424
<uipadding
2525
key="Padding"

src/client/ui/components/primitive/scrolling-frame.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import { useRem, useTheme } from "client/ui/hooks";
44

55
interface ScrollingFrameProps extends React.PropsWithChildren {
66
/** The size of the canvas. */
7-
readonly CanvasSize: Vector2;
7+
CanvasSize: Vector2;
88
/** All the default properties of a `ScrollingFrame` component. */
9-
readonly Native?: Partial<Omit<React.InstanceProps<ScrollingFrame>, "BackgroundTransparency">>;
9+
Native?: Partial<Omit<React.InstanceProps<ScrollingFrame>, "BackgroundTransparency">>;
1010
}
1111

1212
/**
@@ -43,7 +43,7 @@ export default function ScrollingFrame({
4343
CanvasSize,
4444
Native,
4545
children,
46-
}: ScrollingFrameProps): React.Element {
46+
}: Readonly<ScrollingFrameProps>): React.Element {
4747
const theme = useTheme();
4848
const rem = useRem();
4949

src/client/ui/components/primitive/text.tsx

+14-6
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,23 @@ export interface TextLabelProps extends FrameProps<TextLabel> {
1010
* The font of the text, defaults to the primary font specified by the
1111
* default theme.
1212
*/
13-
readonly Font?: BindingValue<Enum.Font>;
13+
Font?: BindingValue<Enum.Font>;
1414
/**
1515
* The default properties of a `TextLabel` component, minus the ones
1616
* specified in the TextProps.
1717
*/
18-
readonly Native?: Partial<
18+
Native?: Partial<
1919
Omit<
2020
React.InstanceProps<TextLabel>,
2121
"Font" | "Text" | "TextColor" | "TextColor3" | "TextSize"
2222
>
2323
>;
2424
/** The text to display. */
25-
readonly Text: BindingValue<string>;
25+
Text: BindingValue<string>;
2626
/** The color of the text. */
27-
readonly TextColor?: BindingValue<Color3>;
27+
TextColor?: BindingValue<Color3>;
2828
/** The size of the text. */
29-
readonly TextSize?: BindingValue<number>;
29+
TextSize?: BindingValue<number>;
3030
}
3131

3232
/**
@@ -49,7 +49,15 @@ export interface TextLabelProps extends FrameProps<TextLabel> {
4949
*/
5050
const TextLabel = forwardRef(
5151
(
52-
{ CornerRadius, Font, Native, Text, TextColor, TextSize, children }: TextLabelProps,
52+
{
53+
CornerRadius,
54+
Font,
55+
Native,
56+
Text,
57+
TextColor,
58+
TextSize,
59+
children,
60+
}: Readonly<TextLabelProps>,
5361
ref: React.Ref<TextLabel>,
5462
) => {
5563
const rem = useRem();

src/client/ui/components/ultra-wide-container.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import Group from "./primitive/group";
66
const MAX_ASPECT_RATIO = 19 / 9;
77
const BASE_RESOLUTION = new Vector2(1920, 1020);
88

9-
type UltraWideContainerProps = Readonly<React.PropsWithChildren>;
9+
type UltraWideContainerProps = React.PropsWithChildren;
1010

1111
/**
1212
* Creates a 1920x1080 scaling container to handle ultra wide monitors and
@@ -18,7 +18,9 @@ type UltraWideContainerProps = Readonly<React.PropsWithChildren>;
1818
* @returns The rendered container component.
1919
* @see https://github.com/Quenty/NevermoreEngine/tree/a9256cab3584bea4bd32c327d00b9a52f2a3ec95/src/ultrawidecontainerutils
2020
*/
21-
export default function UltraWideContainer({ children }: UltraWideContainerProps): React.Element {
21+
export default function UltraWideContainer({
22+
children,
23+
}: Readonly<UltraWideContainerProps>): React.Element {
2224
const viewport = useViewport();
2325

2426
return (

src/client/ui/functions/profiler.ts

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ function getName(callback: Callback): string {
2727
export function profileAllComponents(): void {
2828
const profiledComponents = new Map<FunctionComponent, FunctionComponent>();
2929

30+
// eslint-disable-next-line react/prefer-read-only-props -- We need to modify the props
3031
React.createElement = ((...args: Parameters<typeof React.createElement>) => {
3132
const [component] = args;
3233

0 commit comments

Comments
 (0)