From f3524dbace2b5cb0e8a92bbdcbcd3c002e5c5512 Mon Sep 17 00:00:00 2001 From: Kavitha Date: Mon, 27 Nov 2023 09:52:16 +0530 Subject: [PATCH] fix format --- packages/victory-area/src/area.tsx | 8 ++++---- packages/victory-bar/src/bar.js | 2 +- packages/victory-candlestick/src/candle.js | 2 +- packages/victory-chart/src/victory-chart.tsx | 2 +- packages/victory-core/src/victory-label/victory-label.tsx | 2 +- packages/victory-core/src/victory-primitives/arc.tsx | 2 +- .../victory-core/src/victory-primitives/background.tsx | 3 +-- packages/victory-core/src/victory-primitives/border.tsx | 4 ++-- .../victory-core/src/victory-primitives/line-segment.tsx | 2 +- packages/victory-core/src/victory-primitives/point.tsx | 3 +-- packages/victory-core/src/victory-primitives/whisker.tsx | 2 +- packages/victory-errorbar/src/error-bar.tsx | 3 +-- packages/victory-group/src/victory-group.tsx | 3 +-- packages/victory-line/src/curve.tsx | 3 +-- .../victory-native/src/helpers/wrap-core-component.js | 5 ++--- packages/victory-pie/src/slice.js | 3 +-- packages/victory-stack/src/victory-stack.tsx | 2 +- packages/victory-tooltip/src/flyout.js | 2 +- packages/victory-voronoi/src/voronoi.js | 2 +- 19 files changed, 24 insertions(+), 31 deletions(-) diff --git a/packages/victory-area/src/area.tsx b/packages/victory-area/src/area.tsx index 3804c6373..7512ccf70 100644 --- a/packages/victory-area/src/area.tsx +++ b/packages/victory-area/src/area.tsx @@ -99,15 +99,15 @@ export const Area: React.FC = (props) => { props = evaluateProps(props); const { ariaLabel, - role="presentation", - shapeRendering="auto", + role = "presentation", + shapeRendering = "auto", className, polar, origin, data, - pathComponent=, + pathComponent = , events, - groupComponent=, + groupComponent = , clipPath, id, style, diff --git a/packages/victory-bar/src/bar.js b/packages/victory-bar/src/bar.js index 1374e88ab..20024ad83 100644 --- a/packages/victory-bar/src/bar.js +++ b/packages/victory-bar/src/bar.js @@ -49,7 +49,7 @@ const defaultProps = { }; // eslint-disable-next-line prefer-arrow-callback const Bar = forwardRef(function Bar(props, ref) { - props = evaluateProps({ ...defaultProps, ...props}); + props = evaluateProps({ ...defaultProps, ...props }); const { polar, origin, style, barWidth, cornerRadius } = props; const path = polar diff --git a/packages/victory-candlestick/src/candle.js b/packages/victory-candlestick/src/candle.js index d97f165a2..ba8d591d2 100644 --- a/packages/victory-candlestick/src/candle.js +++ b/packages/victory-candlestick/src/candle.js @@ -98,7 +98,7 @@ const defaultProps = { }; const Candle = (props) => { - props = evaluateProps({ ...defaultProps, ...props}); + props = evaluateProps({ ...defaultProps, ...props }); const { ariaLabel, events, diff --git a/packages/victory-chart/src/victory-chart.tsx b/packages/victory-chart/src/victory-chart.tsx index 2f0f9a09d..f4a10c605 100644 --- a/packages/victory-chart/src/victory-chart.tsx +++ b/packages/victory-chart/src/victory-chart.tsx @@ -53,7 +53,7 @@ const defaultProps = { }; const VictoryChartImpl: React.FC = (initialProps) => { - initialProps = {...defaultProps,...initialProps} + initialProps = { ...defaultProps, ...initialProps }; const role = "chart"; const { getAnimationProps, setAnimationState, getProps } = Hooks.useAnimationState(); diff --git a/packages/victory-core/src/victory-label/victory-label.tsx b/packages/victory-core/src/victory-label/victory-label.tsx index 48f3c3547..3b671a6a9 100644 --- a/packages/victory-core/src/victory-label/victory-label.tsx +++ b/packages/victory-core/src/victory-label/victory-label.tsx @@ -585,7 +585,7 @@ export const VictoryLabel: { role: string; defaultStyles: typeof defaultStyles; } & React.FC = (props) => { - props = evaluateProps({...defaultProps,...props}); + props = evaluateProps({ ...defaultProps, ...props }); if (props.text === null || props.text === undefined) { return null; diff --git a/packages/victory-core/src/victory-primitives/arc.tsx b/packages/victory-core/src/victory-primitives/arc.tsx index 8c2cf17a0..39e69bb13 100644 --- a/packages/victory-core/src/victory-primitives/arc.tsx +++ b/packages/victory-core/src/victory-primitives/arc.tsx @@ -69,7 +69,7 @@ const defaultProps = { }; export const Arc = (props: ArcProps) => { - props = evaluateProps({...defaultProps,...props}); + props = evaluateProps({ ...defaultProps, ...props }); return React.cloneElement(props.pathComponent!, { ...props.events, diff --git a/packages/victory-core/src/victory-primitives/background.tsx b/packages/victory-core/src/victory-primitives/background.tsx index 0b400f6e4..b9f073437 100644 --- a/packages/victory-core/src/victory-primitives/background.tsx +++ b/packages/victory-core/src/victory-primitives/background.tsx @@ -38,7 +38,7 @@ const defaultProps = { }; export const Background = (props: BackgroundProps) => { - props = evaluateProps({...defaultProps,...props}); + props = evaluateProps({ ...defaultProps, ...props }); return props.polar ? React.cloneElement(props.circleComponent!, { @@ -77,4 +77,3 @@ Background.propTypes = { x: PropTypes.number, y: PropTypes.number, }; - diff --git a/packages/victory-core/src/victory-primitives/border.tsx b/packages/victory-core/src/victory-primitives/border.tsx index 5d5662d2b..6c34fc592 100644 --- a/packages/victory-core/src/victory-primitives/border.tsx +++ b/packages/victory-core/src/victory-primitives/border.tsx @@ -44,7 +44,7 @@ const defaultProps = { }; export const Border = (props: BorderProps) => { - props = evaluateProps({...defaultProps,...props}); + props = evaluateProps({ ...defaultProps, ...props }); return React.cloneElement(props.rectComponent!, { ...props.events, @@ -71,4 +71,4 @@ Border.propTypes = { width: PropTypes.number, x: PropTypes.number, y: PropTypes.number, -}; \ No newline at end of file +}; diff --git a/packages/victory-core/src/victory-primitives/line-segment.tsx b/packages/victory-core/src/victory-primitives/line-segment.tsx index 6f3587132..d7d13e3d7 100644 --- a/packages/victory-core/src/victory-primitives/line-segment.tsx +++ b/packages/victory-core/src/victory-primitives/line-segment.tsx @@ -45,7 +45,7 @@ const defaultProps = { }; export const LineSegment = (props: LineSegmentProps) => { - props = evaluateProps({...defaultProps,...props}); + props = evaluateProps({ ...defaultProps, ...props }); return React.cloneElement(props.lineComponent!, { ...props.events, diff --git a/packages/victory-core/src/victory-primitives/point.tsx b/packages/victory-core/src/victory-primitives/point.tsx index b9e0f6367..92adf21aa 100644 --- a/packages/victory-core/src/victory-primitives/point.tsx +++ b/packages/victory-core/src/victory-primitives/point.tsx @@ -73,7 +73,7 @@ const defaultProps = { }; export const Point = (props: PointProps) => { - props = evaluateProps({...defaultProps,...props}); + props = evaluateProps({ ...defaultProps, ...props }); const userProps = UserProps.getSafeUserProps(props); return React.cloneElement(props.pathComponent!, { @@ -115,4 +115,3 @@ Point.propTypes = { x: PropTypes.number, y: PropTypes.number, }; - diff --git a/packages/victory-core/src/victory-primitives/whisker.tsx b/packages/victory-core/src/victory-primitives/whisker.tsx index c41fa84e3..ddb610559 100644 --- a/packages/victory-core/src/victory-primitives/whisker.tsx +++ b/packages/victory-core/src/victory-primitives/whisker.tsx @@ -48,7 +48,7 @@ const defaultProps = { }; export const Whisker = (props: WhiskerProps) => { - props = evaluateProps({...defaultProps,...props}); + props = evaluateProps({ ...defaultProps, ...props }); const { ariaLabel, groupComponent, diff --git a/packages/victory-errorbar/src/error-bar.tsx b/packages/victory-errorbar/src/error-bar.tsx index cdaf889c0..b172fcb58 100644 --- a/packages/victory-errorbar/src/error-bar.tsx +++ b/packages/victory-errorbar/src/error-bar.tsx @@ -117,7 +117,7 @@ const defaultProps = { }; export const ErrorBar = (props: ErrorBarProps & typeof ErrorBar.default) => { - props = evaluateProps({...defaultProps,...props}); + props = evaluateProps({ ...defaultProps, ...props }); const { groupComponent } = props; const userProps = UserProps.getSafeUserProps(props); const { tabIndex, ariaLabel } = props; @@ -158,4 +158,3 @@ ErrorBar.propTypes = { x: PropTypes.number, y: PropTypes.number, }; - diff --git a/packages/victory-group/src/victory-group.tsx b/packages/victory-group/src/victory-group.tsx index 2568afb21..f81cba9ec 100644 --- a/packages/victory-group/src/victory-group.tsx +++ b/packages/victory-group/src/victory-group.tsx @@ -67,7 +67,7 @@ const VictoryGroupBase: React.FC = (initialProps) => { const role = VictoryGroup?.role; const { getAnimationProps, setAnimationState, getProps } = Hooks.useAnimationState(); - initialProps = {...defaultProps,...initialProps} + initialProps = { ...defaultProps, ...initialProps }; const props = getProps(initialProps); const modifiedProps = Helpers.modifyProps(props, fallbackProps, role); @@ -197,7 +197,6 @@ VictoryGroupBase.propTypes = { offset: PropTypes.number, }; - const componentConfig: VictoryComponentConfiguration = { role: "group", expectedComponents: [ diff --git a/packages/victory-line/src/curve.tsx b/packages/victory-line/src/curve.tsx index 8ba97fcca..3c9a77114 100644 --- a/packages/victory-line/src/curve.tsx +++ b/packages/victory-line/src/curve.tsx @@ -42,7 +42,7 @@ const defaultProps = { }; export const Curve: React.FC = (props) => { - props = evaluateProps({...defaultProps,...props}); + props = evaluateProps({ ...defaultProps, ...props }); const userProps = UserProps.getSafeUserProps(props); const { polar, origin } = props; const lineFunction = LineHelpers.getLineFunction(props); @@ -77,7 +77,6 @@ Curve.propTypes = { polar: PropTypes.bool, }; - export interface CurveProps extends VictoryCommonPrimitiveProps { ariaLabel?: StringOrCallback; // eslint-disable-next-line @typescript-eslint/ban-types diff --git a/packages/victory-native/src/helpers/wrap-core-component.js b/packages/victory-native/src/helpers/wrap-core-component.js index 48ffe8b0b..a0dec81d7 100644 --- a/packages/victory-native/src/helpers/wrap-core-component.js +++ b/packages/victory-native/src/helpers/wrap-core-component.js @@ -7,10 +7,9 @@ import React from "react"; * @returns {React.FC} WrappedComponent Wrapped component (passes props through) */ export const wrapCoreComponent = ({ Component, defaultProps }) => { - const WrappedComponent = (props) => { - props={...defaultProps,...props}; - return + props = { ...defaultProps, ...props }; + return ; }; /** diff --git a/packages/victory-pie/src/slice.js b/packages/victory-pie/src/slice.js index da476a361..cde7fe05b 100644 --- a/packages/victory-pie/src/slice.js +++ b/packages/victory-pie/src/slice.js @@ -74,9 +74,8 @@ const defaultProps = { shapeRendering: "auto", }; - const Slice = (props) => { - props = evaluateProps({...defaultProps,...props}); + props = evaluateProps({ ...defaultProps, ...props }); const defaultTransform = props.origin ? `translate(${props.origin.x}, ${props.origin.y})` : undefined; diff --git a/packages/victory-stack/src/victory-stack.tsx b/packages/victory-stack/src/victory-stack.tsx index 6c70806e5..376a7807c 100644 --- a/packages/victory-stack/src/victory-stack.tsx +++ b/packages/victory-stack/src/victory-stack.tsx @@ -63,7 +63,7 @@ const defaultProps = { const VictoryStackBase = (initialProps: VictoryStackProps) => { // eslint-disable-next-line no-use-before-define const { role } = VictoryStack; - initialProps = {...defaultProps,...initialProps} + initialProps = { ...defaultProps, ...initialProps }; const { setAnimationState, getAnimationProps, getProps } = Hooks.useAnimationState(); diff --git a/packages/victory-tooltip/src/flyout.js b/packages/victory-tooltip/src/flyout.js index bbd25fa98..df5dc0fe7 100644 --- a/packages/victory-tooltip/src/flyout.js +++ b/packages/victory-tooltip/src/flyout.js @@ -92,7 +92,7 @@ const defaultProps = { }; const Flyout = (props) => { - props = evaluateProps({...defaultProps,...props}); + props = evaluateProps({ ...defaultProps, ...props }); const userProps = UserProps.getSafeUserProps(props); return React.cloneElement(props.pathComponent, { diff --git a/packages/victory-voronoi/src/voronoi.js b/packages/victory-voronoi/src/voronoi.js index 519fe73fd..af69f1910 100644 --- a/packages/victory-voronoi/src/voronoi.js +++ b/packages/victory-voronoi/src/voronoi.js @@ -45,7 +45,7 @@ const defaultProps = { }; const Voronoi = (props) => { - props = evaluateProps({...defaultProps,...props}); + props = evaluateProps({ ...defaultProps, ...props }); const { ariaLabel,