Browse Source

ref(js): Remove unused React imports (#55169)

eslint rule: https://github.com/getsentry/eslint-config-sentry/pull/187
Evan Purkhiser 1 year ago
parent
commit
4aa7e1307a

+ 1 - 0
static/app/components/autoplayVideo.spec.tsx

@@ -1,3 +1,4 @@
+// eslint-disable-next-line no-restricted-imports
 import * as React from 'react';
 
 import {render, screen} from 'sentry-test/reactTestingLibrary';

+ 1 - 1
static/app/components/discover/transactionsList.tsx

@@ -1,4 +1,4 @@
-import React, {Component, Fragment, useContext, useEffect} from 'react';
+import {Component, Fragment, useContext, useEffect} from 'react';
 import {browserHistory} from 'react-router';
 import styled from '@emotion/styled';
 import {Location, LocationDescriptor, Query} from 'history';

+ 1 - 1
static/app/components/events/interfaces/crashContent/exception/sourceMapDebug.tsx

@@ -1,4 +1,4 @@
-import React, {Fragment, useState} from 'react';
+import {Fragment, useState} from 'react';
 import styled from '@emotion/styled';
 import uniqBy from 'lodash/uniqBy';
 

+ 2 - 2
static/app/components/events/interfaces/spans/profilingMeasurements.tsx

@@ -1,4 +1,4 @@
-import React, {useState} from 'react';
+import {memo, useState} from 'react';
 import {useTheme} from '@emotion/react';
 import styled from '@emotion/styled';
 import uniqBy from 'lodash/uniqBy';
@@ -130,7 +130,7 @@ function Chart({data, type, transactionDuration}: ChartProps) {
 }
 
 // Memoized to prevent re-rendering when the cursor guide is displayed
-const MemoizedChart = React.memo(
+const MemoizedChart = memo(
   Chart,
   (prevProps, nextProps) => prevProps.type === nextProps.type
 );

+ 1 - 1
static/app/components/forms/controls/multipleCheckbox.tsx

@@ -1,4 +1,4 @@
-import React, {createContext, ReactNode, useCallback, useContext, useMemo} from 'react';
+import {createContext, ReactNode, useCallback, useContext, useMemo} from 'react';
 import styled from '@emotion/styled';
 import noop from 'lodash/noop';
 

+ 1 - 1
static/app/routes.tsx

@@ -1,4 +1,4 @@
-import React, {Fragment} from 'react';
+import {Fragment} from 'react';
 import {
   IndexRedirect,
   IndexRoute as BaseIndexRoute,

+ 3 - 3
static/app/views/dashboards/widgetCard/index.tsx

@@ -1,4 +1,4 @@
-import React, {Component, Fragment} from 'react';
+import {Component, Fragment} from 'react';
 import LazyLoad from 'react-lazyload';
 import {WithRouterProps} from 'react-router';
 import {useSortable} from '@dnd-kit/sortable';
@@ -288,7 +288,7 @@ class WidgetCard extends Component<Props, State> {
         customComponent={<ErrorCard>{t('Error loading widget data')}</ErrorCard>}
       >
         {conditionalWrapWithDashboardsMEPProvider(
-          <React.Fragment>
+          <Fragment>
             <VisuallyCompleteWithData
               id="DashboardList-FirstWidgetCard"
               hasData={
@@ -420,7 +420,7 @@ class WidgetCard extends Component<Props, State> {
                   }}
                 </MEPConsumer>
               )}
-          </React.Fragment>
+          </Fragment>
         )}
       </ErrorBoundary>
     );

+ 1 - 1
static/app/views/discover/table/cellAction.tsx

@@ -1,4 +1,4 @@
-import React, {Component} from 'react';
+import {Component} from 'react';
 import styled from '@emotion/styled';
 
 import {Button} from 'sentry/components/button';

+ 0 - 1
static/app/views/discover/table/quickContext/actionDropdown.spec.tsx

@@ -1,4 +1,3 @@
-import React from 'react';
 import {browserHistory} from 'react-router';
 import type {Location} from 'history';
 

+ 3 - 3
static/app/views/monitors/components/detailsSidebar.tsx

@@ -1,4 +1,4 @@
-import React from 'react';
+import {Fragment} from 'react';
 import styled from '@emotion/styled';
 
 import {SectionHeading} from 'sentry/components/charts/styles';
@@ -41,7 +41,7 @@ export default function DetailsSidebar({monitorEnv, monitor}: Props) {
   );
 
   return (
-    <React.Fragment>
+    <Fragment>
       <CheckIns>
         <SectionHeading>{t('Last Check-In')}</SectionHeading>
         <SectionHeading>{t('Next Check-In')}</SectionHeading>
@@ -107,7 +107,7 @@ export default function DetailsSidebar({monitorEnv, monitor}: Props) {
           value={getFormattedDate(monitor.dateCreated, 'MMM D, YYYY')}
         />
       </KeyValueTable>
-    </React.Fragment>
+    </Fragment>
   );
 }
 

Some files were not shown because too many files changed in this diff