Browse Source

lint: Fix `no-empty-pattern` and `no-dupe-else-if` eslint violations (#83279)

Ryan Albrecht 2 months ago
parent
commit
6f5c8b5cca

+ 0 - 2
eslint.config.mjs

@@ -284,8 +284,6 @@ export default typescript.config([
       'no-case-declarations': 'off', // TODO(ryan953): Fix violations and delete this line
       'no-constant-binary-expression': 'off', // TODO(ryan953): Fix violations and delete this line
       'no-dupe-class-members': 'off', // TODO(ryan953): Fix violations and delete this line
-      'no-dupe-else-if': 'off', // TODO(ryan953): Fix violations and delete this line
-      'no-empty-pattern': 'off', // TODO(ryan953): Fix violations and delete this line
       'no-import-assign': 'off', // TODO(ryan953): Fix violations and delete this line
       'no-loss-of-precision': 'off', // TODO(ryan953): Fix violations and delete this line
       'no-prototype-builtins': 'off', // TODO(ryan953): Fix violations and delete this line

+ 2 - 2
static/app/components/lazyLoad.spec.tsx

@@ -8,11 +8,11 @@ type TestProps = {
   testProp?: boolean;
 };
 
-function FooComponent({}: TestProps) {
+function FooComponent() {
   return <div>my foo component</div>;
 }
 
-function BarComponent({}: TestProps) {
+function BarComponent() {
   return <div>my bar component</div>;
 }
 

+ 0 - 1
static/app/components/replays/utils.spec.tsx

@@ -77,7 +77,6 @@ describe('getFramesByColumn', () => {
 
   const {
     errorFrames: [CRUMB_1, CRUMB_2, CRUMB_3, CRUMB_4, CRUMB_5],
-    feedbackFrames: [],
   } = hydrateErrors(
     ReplayRecordFixture({
       started_at: new Date('2022-04-14T14:19:47.326000Z'),

+ 1 - 1
static/app/views/alerts/rules/metric/triggers/dynamicAlertsFeedbackButton.tsx

@@ -5,7 +5,7 @@ import {IconMegaphone} from 'sentry/icons';
 import {t} from 'sentry/locale';
 import {useFeedbackForm} from 'sentry/utils/useFeedbackForm';
 
-export default function DynamicAlertsFeedbackButton({}) {
+export default function DynamicAlertsFeedbackButton() {
   const openForm = useFeedbackForm();
 
   if (!openForm) {

+ 3 - 8
static/app/views/explore/content.tsx

@@ -1,7 +1,6 @@
 import {useCallback, useMemo} from 'react';
 import styled from '@emotion/styled';
 import * as Sentry from '@sentry/react';
-import type {Location} from 'history';
 
 import Feature from 'sentry/components/acl/feature';
 import {Alert} from 'sentry/components/alert';
@@ -57,11 +56,7 @@ import {ExploreTables} from 'sentry/views/explore/tables';
 import {ExploreToolbar} from 'sentry/views/explore/toolbar';
 import {combineConfidenceForSeries} from 'sentry/views/explore/utils';
 
-interface ExploreContentProps {
-  location: Location;
-}
-
-function ExploreContentImpl({}: ExploreContentProps) {
+function ExploreContentImpl() {
   const location = useLocation();
   const navigate = useNavigate();
   const organization = useOrganization();
@@ -257,13 +252,13 @@ function ExploreTagsProvider({children}) {
   );
 }
 
-export function ExploreContent(props: ExploreContentProps) {
+export function ExploreContent() {
   Sentry.setTag('explore.visited', 'yes');
 
   return (
     <PageParamsProvider>
       <ExploreTagsProvider>
-        <ExploreContentImpl {...props} />
+        <ExploreContentImpl />
       </ExploreTagsProvider>
     </PageParamsProvider>
   );

+ 1 - 3
static/app/views/explore/toolbar/toolbarVisualize.tsx

@@ -39,9 +39,7 @@ type ParsedVisualize = {
   label: string;
 };
 
-interface ToolbarVisualizeProps {}
-
-export function ToolbarVisualize({}: ToolbarVisualizeProps) {
+export function ToolbarVisualize() {
   const visualizes = useExploreVisualizes();
   const setVisualizes = useSetExploreVisualizes();
 

+ 1 - 4
static/app/views/feedback/feedbackListPage.tsx

@@ -23,15 +23,12 @@ import SentryDocumentTitle from 'sentry/components/sentryDocumentTitle';
 import {feedbackWidgetPlatforms} from 'sentry/data/platformCategories';
 import {t} from 'sentry/locale';
 import {space} from 'sentry/styles/space';
-import type {RouteComponentProps} from 'sentry/types/legacyReactRouter';
 import useOrganization from 'sentry/utils/useOrganization';
 import usePageFilters from 'sentry/utils/usePageFilters';
 import useProjects from 'sentry/utils/useProjects';
 import FluidHeight from 'sentry/views/replays/detail/layout/fluidHeight';
 
-interface Props extends RouteComponentProps<{}, {}, {}> {}
-
-export default function FeedbackListPage({}: Props) {
+export default function FeedbackListPage() {
   const organization = useOrganization();
   const {hasSetupOneFeedback} = useHaveSelectedProjectsSetupFeedback();
   const {hasSetupNewFeedback} = useHaveSelectedProjectsSetupNewFeedback();

+ 0 - 2
static/app/views/insights/common/components/fullSpanDescription.tsx

@@ -85,8 +85,6 @@ export function FullSpanDescription({
         result = prettyPrintJsonString(description);
       } else if (fullSpan?.sentry_tags?.description) {
         result = prettyPrintJsonString(fullSpan?.sentry_tags.description);
-      } else if (fullSpan?.sentry_tags?.description) {
-        result = prettyPrintJsonString(fullSpan?.sentry_tags?.description);
       } else {
         stringifiedQuery = description || fullSpan?.sentry_tags?.description || 'N/A';
       }

+ 1 - 1
static/app/views/insights/common/components/modulePageFilterBar.tsx

@@ -136,5 +136,5 @@ const StyledIconBuisness = styled(IconBusiness)`
 
 export const UpsellFooterHook = HookOrDefault({
   hookName: 'component:insights-date-range-query-limit-footer',
-  defaultComponent: ({}) => undefined,
+  defaultComponent: () => undefined,
 });

+ 2 - 2
static/app/views/profiling/content.tsx

@@ -142,7 +142,7 @@ export default function ProfilingContent({location}: ProfilingContentProps) {
                     </Tabs>
                   </div>
                   {tab === 'flamegraph' ? (
-                    <FlamegraphTab location={location} selection={selection} />
+                    <FlamegraphTab />
                   ) : (
                     <TransactionsTab location={location} selection={selection} />
                   )}
@@ -232,7 +232,7 @@ function TransactionsTab({location, selection}: TabbedContentProps) {
   );
 }
 
-function FlamegraphTab({}: TabbedContentProps) {
+function FlamegraphTab() {
   return (
     <LandingAggregateFlamegraphSizer>
       <LandingAggregateFlamegraphContainer>

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