Skip to content

fix: use react-jsx transform #5428

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 19, 2024
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
2 changes: 1 addition & 1 deletion .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ overrides:
- 'plugin:@typescript-eslint/recommended'
- 'plugin:@typescript-eslint/recommended-requiring-type-checking'
- 'plugin:import/typescript'
- 'plugin:react/jsx-runtime'
settings:
import/resolver:
typescript: true
Expand Down Expand Up @@ -124,7 +125,6 @@ overrides:
- no-only-tests
rules:
'@typescript-eslint/no-empty-function': 'off'
'react/react-in-jsx-scope': 'off'
'import/order': 'warn'
'import/no-unresolved': 'off'
'react/no-unescaped-entities': 'off'
Expand Down
2 changes: 1 addition & 1 deletion packages/base/src/Device/Media.cy.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect, useState } from 'react';
import { useEffect, useState } from 'react';
import { MediaEventProvider } from './EventProvider';
import { attachMediaHandler, detachMediaHandler, getCurrentRange } from './Media';

Expand Down
2 changes: 1 addition & 1 deletion packages/charts/src/components/BarChart/BarChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { enrichEventWithDetails, ThemingParameters, useIsRTL, useSyncRef } from '@ui5/webcomponents-react-base';
import type { CSSProperties } from 'react';
import React, { forwardRef, useCallback } from 'react';
import { forwardRef, useCallback } from 'react';
import {
Bar,
BarChart as BarChartLib,
Expand Down
1 change: 0 additions & 1 deletion packages/charts/src/components/BarChart/Placeholder.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ThemingParameters } from '@ui5/webcomponents-react-base';
import React from 'react';
import ContentLoader from 'react-content-loader';

export const BarChartPlaceholder = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { enrichEventWithDetails, ThemingParameters, useIsRTL, useSyncRef } from '@ui5/webcomponents-react-base';
import type { CSSProperties } from 'react';
import React, { forwardRef, useCallback, useMemo } from 'react';
import { forwardRef, useCallback, useMemo } from 'react';
import {
Bar,
Brush,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { CSSProperties } from 'react';
import React from 'react';

interface ComparisonLine {
x?: number;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ThemingParameters } from '@ui5/webcomponents-react-base';
import React from 'react';
import ContentLoader from 'react-content-loader';
import type { IChartMeasure } from '../../interfaces/IChartMeasure.js';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { enrichEventWithDetails, ThemingParameters, useIsRTL, useSyncRef } from '@ui5/webcomponents-react-base';
import type { CSSProperties } from 'react';
import React, { forwardRef, useCallback } from 'react';
import { forwardRef, useCallback } from 'react';
import {
Bar as Column,
BarChart as ColumnChartLib,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ThemingParameters } from '@ui5/webcomponents-react-base';
import React from 'react';
import ContentLoader from 'react-content-loader';

export const ColumnChartPlaceholder = (props) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { ThemingParameters, useIsomorphicId } from '@ui5/webcomponents-react-base';
import type { CSSProperties } from 'react';
import React, { forwardRef } from 'react';
import { forwardRef } from 'react';
import type { TooltipProps } from 'recharts';
import { useLongestYAxisLabel } from '../../hooks/useLongestYAxisLabel.js';
import { usePrepareDimensionsAndMeasures } from '../../hooks/usePrepareDimensionsAndMeasures.js';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ThemingParameters } from '@ui5/webcomponents-react-base';
import React from 'react';
import ContentLoader from 'react-content-loader';

export const ColumnChartWithTrendPlaceholder = (props) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ThemingParameters } from '@ui5/webcomponents-react-base';
import React from 'react';
import ContentLoader from 'react-content-loader';
import type { IChartMeasure } from '../../interfaces/IChartMeasure.js';

Expand Down
2 changes: 1 addition & 1 deletion packages/charts/src/components/ComposedChart/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { enrichEventWithDetails, ThemingParameters, useIsRTL, useSyncRef } from '@ui5/webcomponents-react-base';
import type { CSSProperties, FC } from 'react';
import React, { forwardRef, useCallback } from 'react';
import { forwardRef, useCallback } from 'react';
import {
Area,
Bar,
Expand Down
2 changes: 1 addition & 1 deletion packages/charts/src/components/DonutChart/DonutChart.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import React, { forwardRef } from 'react';
import { forwardRef } from 'react';
import type { PieChartProps } from '../PieChart/PieChart.js';
import { PieChart } from '../PieChart/PieChart.js';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { Meta, StoryObj } from '@storybook/react';
import React from 'react';
import { bigDataSet, complexDataSet, secondaryDimensionDataSet, simpleDataSet } from '../../resources/DemoProps.js';
import { LineChart } from './LineChart.js';

Expand Down
2 changes: 1 addition & 1 deletion packages/charts/src/components/LineChart/LineChart.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';

import { enrichEventWithDetails, ThemingParameters, useIsRTL, useSyncRef } from '@ui5/webcomponents-react-base';
import React, { forwardRef, useCallback, useRef } from 'react';
import { forwardRef, useCallback, useRef } from 'react';
import type { LineProps } from 'recharts';
import {
Brush,
Expand Down
1 change: 0 additions & 1 deletion packages/charts/src/components/LineChart/Placeholder.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ThemingParameters } from '@ui5/webcomponents-react-base';
import React from 'react';
import ContentLoader from 'react-content-loader';

export const LineChartPlaceholder = (props) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { enrichEventWithDetails, ThemingParameters } from '@ui5/webcomponents-react-base';
import { clsx } from 'clsx';
import type { CSSProperties } from 'react';
import React, { createElement, forwardRef, useCallback, useMemo } from 'react';
import { createElement, forwardRef, useCallback, useMemo } from 'react';
import { createUseStyles } from 'react-jss';
import { getValueByDataKey } from 'recharts/lib/util/ChartUtils.js';
import type { IChartBaseProps } from '../../interfaces/IChartBaseProps.js';
Expand Down
2 changes: 1 addition & 1 deletion packages/charts/src/components/PieChart/PieChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { enrichEventWithDetails } from '@ui5/webcomponents-react-base';
import { clsx } from 'clsx';
import type { CSSProperties } from 'react';
import React, { cloneElement, forwardRef, isValidElement, useCallback, useMemo } from 'react';
import { cloneElement, forwardRef, isValidElement, useCallback, useMemo } from 'react';
import { createUseStyles } from 'react-jss';
import {
Cell,
Expand Down
1 change: 0 additions & 1 deletion packages/charts/src/components/PieChart/Placeholder.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ThemingParameters } from '@ui5/webcomponents-react-base';
import React from 'react';
import ContentLoader from 'react-content-loader';

export const PieChartPlaceholder = (props) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/charts/src/components/RadarChart/RadarChart.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';

import { enrichEventWithDetails, ThemingParameters } from '@ui5/webcomponents-react-base';
import React, { forwardRef, useCallback, useRef } from 'react';
import { forwardRef, useCallback, useRef } from 'react';
import {
Legend,
PolarAngleAxis,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import type { CommonProps } from '@ui5/webcomponents-react';
import { enrichEventWithDetails, ThemingParameters } from '@ui5/webcomponents-react-base';
import type { CSSProperties } from 'react';
import React, { forwardRef } from 'react';
import { forwardRef } from 'react';
import { PolarAngleAxis, RadialBar, RadialBarChart } from 'recharts';
import { useOnClickInternal } from '../../hooks/useOnClickInternal.js';
import { ChartContainer } from '../../internal/ChartContainer.js';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ThemingParameters } from '@ui5/webcomponents-react-base';
import React from 'react';
import ContentLoader from 'react-content-loader';

export const ScatterChartPlaceholder = (props) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { enrichEventWithDetails, ThemingParameters, useIsRTL, useSyncRef } from '@ui5/webcomponents-react-base';
import type { CSSProperties } from 'react';
import React, { forwardRef, useCallback, useRef } from 'react';
import { forwardRef, useCallback, useRef } from 'react';
import type { ReferenceLineProps } from 'recharts';
import {
CartesianGrid,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ThemingParameters } from '@ui5/webcomponents-react-base';
import React from 'react';
import ContentLoader from 'react-content-loader';

export const TimelineChartPlaceholder = () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { Meta, StoryObj } from '@storybook/react';
import { ThemingParameters } from '@ui5/webcomponents-react-base';
import React from 'react';
import { Invention, TimingFigure } from './examples/Annotations.js';
import { dummyDataSet, dummyDiscreteDataSet, inventionDataset, schedulingEDFData } from './examples/Dataset.js';
import { TimelineChart } from './TimelineChart.js';
Expand Down
10 changes: 5 additions & 5 deletions packages/charts/src/components/TimelineChart/TimelineChart.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { CommonProps } from '@ui5/webcomponents-react';
import { throttle } from '@ui5/webcomponents-react-base';
import type { CSSProperties, ReactNode } from 'react';
import React, { forwardRef, useEffect, useRef, useState } from 'react';
import { forwardRef, useEffect, useRef, useState } from 'react';
import type * as React from 'react';
import { TimelineChartBody } from './chartbody/TimelineChartBody.js';
import { TimelineChartPlaceholder } from './Placeholder.js';
import { TimelineChartColumnLabel, TimelineChartRowTitle, TimelineChartRowLabels } from './TimelineChartHeaders.js';
Expand Down Expand Up @@ -35,7 +35,7 @@ interface TimelineChartProps extends CommonProps {
* The total width of the chart. If not supplied, the chart's
* width expands to fill its conatainer.
*/
width?: CSSProperties['width'];
width?: React.CSSProperties['width'];

/**
* The height the row of the timeline.
Expand All @@ -53,7 +53,7 @@ interface TimelineChartProps extends CommonProps {
*
* **Note:** Use the `TimelineChartAnnotation` component here.
*/
annotations?: ReactNode | ReactNode[];
annotations?: React.ReactNode | React.ReactNode[];

/**
* Toggles the visibility of the annotations applied to the chart.
Expand Down Expand Up @@ -149,7 +149,7 @@ const TimelineChart = forwardRef<HTMLDivElement, TimelineChartProps>(
const numOfRows = dataset?.length ?? 0;
const height = rowHeight * numOfRows + COLUMN_HEADER_HEIGHT;

const style: CSSProperties = {
const style: React.CSSProperties = {
height: `${height}px`,
width: width,
gridTemplateColumns: `${ROW_TITLE_WIDTH}px auto`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { CommonProps } from '@ui5/webcomponents-react';
import type { CSSProperties } from 'react';
import React, { forwardRef } from 'react';
import { forwardRef } from 'react';
import { DEFAULT_ROW_HEIGHT } from './util/constants.js';
import { useStyles } from './util/styles.js';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ThemingParameters } from '@ui5/webcomponents-react-base';
import type { CSSProperties, ReactElement } from 'react';
import React, { useEffect, useState } from 'react';
import { useEffect, useState } from 'react';
import type { ITimelineChartRow } from './types/TimelineChartTypes.js';
import { DEFAULT_CHART_VERTICAL_COLS, SPACING, TICK_LENGTH, TOLERANCE } from './util/constants.js';
import { useStyles } from './util/styles.js';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { CSSProperties, ReactNode } from 'react';
import React, { forwardRef, useEffect, useImperativeHandle, useRef, useState } from 'react';
import { forwardRef, useEffect, useImperativeHandle, useRef, useState } from 'react';
import type { ITimelineChartRow } from '../types/TimelineChartTypes.js';
import { MAX_BODY_WIDTH, SCALE_FACTOR } from '../util/constants.js';
import { TimelineChartBodyCtx } from '../util/context.js';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { ThemingParameters } from '@ui5/webcomponents-react-base';
import type { ReactElement } from 'react';
import React from 'react';
import { DEFAULT_CHART_VERTICAL_COLS, TOLERANCE } from '../util/constants.js';

interface TimelineChartGridProps {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { ReactNode } from 'react';
import React from 'react';
import { useStyles } from '../util/styles.js';

interface TimelineChartLayerProps {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { throttle } from '@ui5/webcomponents-react-base';
import type { CSSProperties } from 'react';
import React, { useEffect, useRef, useState } from 'react';
import { useEffect, useRef, useState } from 'react';
import type * as React from 'react';
import type { ITimelineChartRow } from '../types/TimelineChartTypes.js';
import { HOVER_OPACITY, NORMAL_OPACITY, THROTTLE_INTERVAL } from '../util/constants.js';

Expand Down Expand Up @@ -107,7 +107,7 @@ interface TimelineTaskProps {
*/
totalDuration: number;

color: CSSProperties['color'];
color: React.CSSProperties['color'];

timelineStart: number;

Expand Down Expand Up @@ -199,7 +199,7 @@ interface TimelineMilestoneProps {
*/
totalDuration: number;

color?: CSSProperties['color'];
color?: React.CSSProperties['color'];

timelineStart: number;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ThemingParameters, useIsomorphicLayoutEffect } from '@ui5/webcomponents-react-base';
import type { ReactElement } from 'react';
import React, { useState } from 'react';
import { useState } from 'react';
import type { ITimelineChartMileStone, ITimelineChartRow, ITimelineChartTask } from '../types/TimelineChartTypes.js';
import { TimelineChartConnection } from '../types/TimelineChartTypes.js';
import { ARROWHEAD_HEIGHT, ARROWHEAD_WIDTH, ARROW_CLEARANCE } from '../util/constants.js';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ThemingParameters } from '@ui5/webcomponents-react-base';
import type { CSSProperties } from 'react';
import React, { useContext, useEffect, useLayoutEffect, useRef, useState } from 'react';
import { useContext, useEffect, useLayoutEffect, useRef, useState } from 'react';
import { TimelineChartBodyCtx } from '../util/context.js';

interface TimingFigureProps {
Expand Down
2 changes: 1 addition & 1 deletion packages/charts/src/internal/ChartContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { type CommonProps, Label, Loader } from '@ui5/webcomponents-react';
import { ThemingParameters } from '@ui5/webcomponents-react-base';
import { clsx } from 'clsx';
import type { ComponentType, CSSProperties, ReactElement, ReactNode } from 'react';
import React, { Component, forwardRef } from 'react';
import { Component, forwardRef } from 'react';
import { createUseStyles } from 'react-jss';
import { ResponsiveContainer } from 'recharts';

Expand Down
2 changes: 1 addition & 1 deletion packages/charts/src/internal/ChartDataLabel.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ThemingParameters } from '@ui5/webcomponents-react-base';
import React, { createElement } from 'react';
import { createElement } from 'react';
import { Label } from 'recharts';
import type { IChartMeasure } from '../interfaces/IChartMeasure.js';
import { getTextWidth } from '../internal/Utils.js';
Expand Down
1 change: 0 additions & 1 deletion packages/charts/src/internal/XAxisTicks.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ThemingParameters } from '@ui5/webcomponents-react-base';
import React from 'react';
import type { IChartMeasure } from '../interfaces/IChartMeasure.js';
import { getTextWidth, truncateLongLabel } from './Utils.js';

Expand Down
1 change: 0 additions & 1 deletion packages/charts/src/internal/YAxisTicks.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ThemingParameters } from '@ui5/webcomponents-react-base';
import React from 'react';
import type { IChartMeasure } from '../interfaces/IChartMeasure.js';
import { defaultMaxYAxisWidth } from './defaults.js';
import { getTextWidth, truncateLongLabel } from './Utils.js';
Expand Down
2 changes: 1 addition & 1 deletion packages/cypress-commands/CommandsAndQueries.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Heading, Markdown } from '@storybook/blocks';
import React, { Fragment } from 'react';
import { Fragment } from 'react';

interface CommandsAndQueries {
id: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import declineIcon from '@ui5/webcomponents-icons/dist/decline.js';
import deleteIcon from '@ui5/webcomponents-icons/dist/delete.js';
import emailIcon from '@ui5/webcomponents-icons/dist/email.js';
import forwardIcon from '@ui5/webcomponents-icons/dist/forward.js';
import React, { useState } from 'react';
import { useState } from 'react';
import { PopoverHorizontalAlign, PopoverPlacementType, PopoverVerticalAlign } from '../../enums/index.js';
import { Button } from '../../webComponents/index.js';
import { ActionSheet } from './index.js';
Expand Down
2 changes: 1 addition & 1 deletion packages/main/src/components/ActionSheet/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { isPhone } from '@ui5/webcomponents-base/dist/Device.js';
import { useI18nBundle, useIsRTL, useSyncRef } from '@ui5/webcomponents-react-base';
import { clsx } from 'clsx';
import type { ReactElement } from 'react';
import React, { forwardRef, useReducer, useRef } from 'react';
import { forwardRef, useReducer, useRef } from 'react';
import { createPortal } from 'react-dom';
import { createUseStyles } from 'react-jss';
import { ButtonDesign } from '../../enums/index.js';
Expand Down
2 changes: 1 addition & 1 deletion packages/main/src/components/AnalyticalCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { deprecationNotice, useStylesheet } from '@ui5/webcomponents-react-base';
import type { ReactNode } from 'react';
import React, { forwardRef, useEffect } from 'react';
import { forwardRef, useEffect } from 'react';
import type { CommonProps } from '../../interfaces/index.js';
import type { CardDomRef } from '../../webComponents/index.js';
import { Card } from '../../webComponents/index.js';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import iconUp from '@ui5/webcomponents-icons/dist/up.js';
import { useI18nBundle, useIsomorphicId } from '@ui5/webcomponents-react-base';
import { clsx } from 'clsx';
import type { MouseEventHandler, ReactElement, ReactNode } from 'react';
import React, { cloneElement, forwardRef } from 'react';
import { cloneElement, forwardRef } from 'react';
import { createUseStyles } from 'react-jss';
import { DeviationIndicator, ValueColor } from '../../enums/index.js';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { Meta, StoryObj } from '@storybook/react';
import '@ui5/webcomponents-icons/dist/delete.js';
import '@ui5/webcomponents-icons/dist/edit.js';
import '@ui5/webcomponents-icons/dist/settings.js';
import React, { useCallback, useEffect, useMemo, useReducer, useRef, useState } from 'react';
import { useCallback, useEffect, useMemo, useReducer, useRef, useState } from 'react';
import {
AnalyticalTableScaleWidthMode,
AnalyticalTableSelectionBehavior,
Expand Down
Loading