Browse Source

chore(ts): Consistent enum casing (#50545)

All enums should be in pascal case

The following were the offenders

```
/Users/evan/Coding/sentry/static/app/components/onboarding/frameworkSuggestionModal.tsx
  27:13  error  Enum name `SUPPORTED_LANGUAGES` must match one of the following formats: PascalCase  @typescript-eslint/naming-convention

/Users/evan/Coding/sentry/static/app/types/stacktrace.tsx
  3:13  error  Enum name `STACK_VIEW` must match one of the following formats: PascalCase  @typescript-eslint/naming-convention
  9:13  error  Enum name `STACK_TYPE` must match one of the following formats: PascalCase  @typescript-eslint/naming-convention

/Users/evan/Coding/sentry/static/app/views/performance/data.tsx
  46:13  error  Enum name `PERFORMANCE_TERM` must match one of the following formats: PascalCase  @typescript-eslint/naming-convention

/Users/evan/Coding/sentry/static/app/views/performance/utils.tsx
  90:13  error  Enum name `PROJECT_PERFORMANCE_TYPE` must match one of the following formats: PascalCase  @typescript-eslint/naming-convention

/Users/evan/Coding/sentry/static/app/views/settings/projectSourceMaps/projectSourceMaps.tsx
  37:6  error  Enum name `SORT_BY` must match one of the following formats: PascalCase  @typescript-eslint/naming-convention
```

---------

Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
Evan Purkhiser 1 year ago
parent
commit
8a9132bf60

+ 6 - 6
static/app/components/discover/performanceCardTable.tsx

@@ -21,7 +21,7 @@ import {
   MOBILE_VITAL_DETAILS,
   WEB_VITAL_DETAILS,
 } from 'sentry/utils/performance/vitals/constants';
-import {PROJECT_PERFORMANCE_TYPE} from 'sentry/views/performance/utils';
+import {ProjectPerformanceType} from 'sentry/views/performance/utils';
 
 type PerformanceCardTableProps = {
   allReleasesEventView: EventView;
@@ -612,25 +612,25 @@ function PerformanceCardTable({
   const loader = <StyledLoadingIndicator />;
 
   const platformPerformanceRender = {
-    [PROJECT_PERFORMANCE_TYPE.FRONTEND]: {
+    [ProjectPerformanceType.FRONTEND]: {
       title: t('Frontend Performance'),
       section: renderFrontendPerformance(),
     },
-    [PROJECT_PERFORMANCE_TYPE.BACKEND]: {
+    [ProjectPerformanceType.BACKEND]: {
       title: t('Backend Performance'),
       section: renderBackendPerformance(),
     },
-    [PROJECT_PERFORMANCE_TYPE.MOBILE]: {
+    [ProjectPerformanceType.MOBILE]: {
       title: t('Mobile Performance'),
       section: renderMobilePerformance(),
     },
-    [PROJECT_PERFORMANCE_TYPE.ANY]: {
+    [ProjectPerformanceType.ANY]: {
       title: t('[Unknown] Performance'),
       section: renderUnknownPerformance(),
     },
   };
 
-  const isUnknownPlatform = performanceType === PROJECT_PERFORMANCE_TYPE.ANY;
+  const isUnknownPlatform = performanceType === ProjectPerformanceType.ANY;
 
   return (
     <Fragment>

+ 5 - 5
static/app/components/events/interfaces/crashContent/exception/content.spec.tsx

@@ -5,7 +5,7 @@ import {textWithMarkupMatcher} from 'sentry-test/utils';
 import {Content} from 'sentry/components/events/interfaces/crashContent/exception/content';
 import ProjectsStore from 'sentry/stores/projectsStore';
 import {EntryType} from 'sentry/types';
-import {STACK_TYPE, STACK_VIEW} from 'sentry/types/stacktrace';
+import {StackType, StackView} from 'sentry/types/stacktrace';
 
 describe('Exception Content', function () {
   it('display redacted values from exception entry', async function () {
@@ -103,12 +103,12 @@ describe('Exception Content', function () {
 
     render(
       <Content
-        type={STACK_TYPE.ORIGINAL}
+        type={StackType.ORIGINAL}
         groupingCurrentLevel={0}
         hasHierarchicalGrouping
         newestFirst
         platform="python"
-        stackView={STACK_VIEW.APP}
+        stackView={StackView.APP}
         event={event}
         values={event.entries[0].data.values}
         meta={event._meta.entries[0].data.values}
@@ -149,11 +149,11 @@ describe('Exception Content', function () {
     const project = TestStubs.Project();
 
     const defaultProps = {
-      type: STACK_TYPE.ORIGINAL,
+      type: StackType.ORIGINAL,
       hasHierarchicalGrouping: false,
       newestFirst: true,
       platform: 'python' as const,
-      stackView: STACK_VIEW.APP,
+      stackView: StackView.APP,
       event,
       values: event.entries[0].data.values,
       projectSlug: project.slug,

+ 3 - 3
static/app/components/events/interfaces/crashContent/exception/content.tsx

@@ -9,7 +9,7 @@ import {tct, tn} from 'sentry/locale';
 import {space} from 'sentry/styles/space';
 import {ExceptionType, Project} from 'sentry/types';
 import {Event, ExceptionValue} from 'sentry/types/event';
-import {STACK_TYPE} from 'sentry/types/stacktrace';
+import {StackType} from 'sentry/types/stacktrace';
 import {defined} from 'sentry/utils';
 import useOrganization from 'sentry/utils/useOrganization';
 
@@ -25,7 +25,7 @@ type Props = {
   event: Event;
   platform: StackTraceProps['platform'];
   projectSlug: Project['slug'];
-  type: STACK_TYPE;
+  type: StackType;
   meta?: Record<any, any>;
   newestFirst?: boolean;
   stackView?: StackTraceProps['stackView'];
@@ -201,7 +201,7 @@ export function Content({
         </ErrorBoundary>
         <StackTrace
           data={
-            type === STACK_TYPE.ORIGINAL
+            type === StackType.ORIGINAL
               ? exc.stacktrace
               : exc.rawStacktrace || exc.stacktrace
           }

+ 4 - 4
static/app/components/events/interfaces/crashContent/exception/index.tsx

@@ -1,7 +1,7 @@
 import ErrorBoundary from 'sentry/components/errorBoundary';
 import {ExceptionType, Group, PlatformType, Project} from 'sentry/types';
 import {Event} from 'sentry/types/event';
-import {STACK_TYPE, STACK_VIEW} from 'sentry/types/stacktrace';
+import {StackType, StackView} from 'sentry/types/stacktrace';
 
 import {Content} from './content';
 import RawContent from './rawContent';
@@ -12,10 +12,10 @@ type Props = {
   newestFirst: boolean;
   platform: PlatformType;
   projectSlug: Project['slug'];
-  stackType: STACK_TYPE;
+  stackType: StackType;
   groupingCurrentLevel?: Group['metadata']['current_level'];
   meta?: Record<any, any>;
-  stackView?: STACK_VIEW;
+  stackView?: StackView;
 } & Pick<ExceptionType, 'values'>;
 
 export function ExceptionContent({
@@ -32,7 +32,7 @@ export function ExceptionContent({
 }: Props) {
   return (
     <ErrorBoundary mini>
-      {stackView === STACK_VIEW.RAW ? (
+      {stackView === StackView.RAW ? (
         <RawContent
           eventId={event.id}
           projectSlug={projectSlug}

+ 3 - 7
static/app/components/events/interfaces/crashContent/exception/stackTrace.spec.tsx

@@ -2,7 +2,7 @@ import {render, screen} from 'sentry-test/reactTestingLibrary';
 import {textWithMarkupMatcher} from 'sentry-test/utils';
 
 import ExceptionStacktraceContent from 'sentry/components/events/interfaces/crashContent/exception/stackTrace';
-import {STACK_VIEW} from 'sentry/types/stacktrace';
+import {StackView} from 'sentry/types/stacktrace';
 
 const frames = [
   {
@@ -109,7 +109,7 @@ describe('ExceptionStacktraceContent', function () {
     render(
       <ExceptionStacktraceContent
         {...props}
-        stackView={STACK_VIEW.APP}
+        stackView={StackView.APP}
         chainedException={false}
         stacktrace={{...stacktrace, frames: []}}
       />
@@ -134,11 +134,7 @@ describe('ExceptionStacktraceContent', function () {
 
   it('should render system frames if "stackView: app" and there are no inApp frames and is a chained exceptions', function () {
     render(
-      <ExceptionStacktraceContent
-        {...props}
-        stackView={STACK_VIEW.APP}
-        chainedException
-      />
+      <ExceptionStacktraceContent {...props} stackView={StackView.APP} chainedException />
     );
 
     for (const frame of frames) {

+ 4 - 4
static/app/components/events/interfaces/crashContent/exception/stackTrace.tsx

@@ -5,7 +5,7 @@ import {IconWarning} from 'sentry/icons';
 import {t} from 'sentry/locale';
 import {ExceptionValue, Group, PlatformType} from 'sentry/types';
 import {Event} from 'sentry/types/event';
-import {STACK_VIEW} from 'sentry/types/stacktrace';
+import {StackView} from 'sentry/types/stacktrace';
 import {defined} from 'sentry/utils';
 import {isNativePlatform} from 'sentry/utils/platform';
 
@@ -25,7 +25,7 @@ type Props = {
   groupingCurrentLevel?: Group['metadata']['current_level'];
   meta?: Record<any, any>;
   newestFirst?: boolean;
-  stackView?: STACK_VIEW;
+  stackView?: StackView;
 };
 
 function StackTrace({
@@ -47,7 +47,7 @@ function StackTrace({
   }
 
   if (
-    stackView === STACK_VIEW.APP &&
+    stackView === StackView.APP &&
     (stacktrace.frames ?? []).filter(frame => frame.inApp).length === 0 &&
     !chainedException
   ) {
@@ -70,7 +70,7 @@ function StackTrace({
   }
 
   const includeSystemFrames =
-    stackView === STACK_VIEW.FULL ||
+    stackView === StackView.FULL ||
     (chainedException && data.frames?.every(frame => !frame.inApp));
 
   /**

+ 3 - 3
static/app/components/events/interfaces/crashContent/index.spec.tsx

@@ -2,7 +2,7 @@ import {render} from 'sentry-test/reactTestingLibrary';
 
 import {CrashContent} from 'sentry/components/events/interfaces/crashContent';
 import {withMeta} from 'sentry/components/events/meta/metaProxy';
-import {STACK_TYPE, STACK_VIEW} from 'sentry/types/stacktrace';
+import {StackType, StackView} from 'sentry/types/stacktrace';
 
 describe('CrashContent', function () {
   const exc = TestStubs.ExceptionWithMeta();
@@ -11,8 +11,8 @@ describe('CrashContent', function () {
   it('renders with meta data', function () {
     const wrapper = render(
       <CrashContent
-        stackView={STACK_VIEW.FULL}
-        stackType={STACK_TYPE.ORIGINAL}
+        stackView={StackView.FULL}
+        stackType={StackType.ORIGINAL}
         event={TestStubs.Event()}
         newestFirst
         exception={(proxiedExc as any).exception}

+ 6 - 6
static/app/components/events/interfaces/crashContent/stackTrace/index.tsx

@@ -3,7 +3,7 @@ import styled from '@emotion/styled';
 import ErrorBoundary from 'sentry/components/errorBoundary';
 import {PlatformType} from 'sentry/types';
 import {Event} from 'sentry/types/event';
-import {STACK_VIEW, StacktraceType} from 'sentry/types/stacktrace';
+import {StacktraceType, StackView} from 'sentry/types/stacktrace';
 import {isNativePlatform} from 'sentry/utils/platform';
 
 import Content from './content';
@@ -23,7 +23,7 @@ type Props = Pick<
   inlined?: boolean;
   maxDepth?: number;
   meta?: Record<any, any>;
-  stackView?: STACK_VIEW;
+  stackView?: StackView;
 };
 
 export function StackTraceContent({
@@ -38,7 +38,7 @@ export function StackTraceContent({
   meta,
   inlined,
 }: Props) {
-  if (stackView === STACK_VIEW.RAW) {
+  if (stackView === StackView.RAW) {
     return (
       <ErrorBoundary mini>
         <pre className="traceback plain">
@@ -53,7 +53,7 @@ export function StackTraceContent({
       <ErrorBoundary mini>
         <StyledNativeContent
           data={stacktrace}
-          includeSystemFrames={stackView === STACK_VIEW.FULL}
+          includeSystemFrames={stackView === StackView.FULL}
           platform={platform}
           event={event}
           newestFirst={newestFirst}
@@ -72,7 +72,7 @@ export function StackTraceContent({
         <StyledHierarchicalGroupingContent
           data={stacktrace}
           className="no-exception"
-          includeSystemFrames={stackView === STACK_VIEW.FULL}
+          includeSystemFrames={stackView === StackView.FULL}
           platform={platform}
           event={event}
           newestFirst={newestFirst}
@@ -91,7 +91,7 @@ export function StackTraceContent({
       <StyledContent
         data={stacktrace}
         className="no-exception"
-        includeSystemFrames={stackView === STACK_VIEW.FULL}
+        includeSystemFrames={stackView === StackView.FULL}
         platform={platform}
         event={event}
         newestFirst={newestFirst}

+ 6 - 6
static/app/components/events/interfaces/exception.tsx

@@ -1,7 +1,7 @@
 import {t} from 'sentry/locale';
 import {ExceptionType, Group, PlatformType, Project} from 'sentry/types';
 import {EntryType, Event} from 'sentry/types/event';
-import {STACK_TYPE, STACK_VIEW} from 'sentry/types/stacktrace';
+import {StackType, StackView} from 'sentry/types/stacktrace';
 
 import {PermalinkTitle, TraceEventDataSection} from '../traceEventDataSection';
 
@@ -63,7 +63,7 @@ export function Exception({
     <TraceEventDataSection
       title={<PermalinkTitle>{t('Stack Trace')}</PermalinkTitle>}
       type={EntryType.EXCEPTION}
-      stackType={STACK_TYPE.ORIGINAL}
+      stackType={StackType.ORIGINAL}
       projectSlug={projectSlug}
       eventId={event.id}
       recentFirst={isStacktraceNewestFirst()}
@@ -108,14 +108,14 @@ export function Exception({
         ) : (
           <ExceptionContent
             stackType={
-              display.includes('minified') ? STACK_TYPE.MINIFIED : STACK_TYPE.ORIGINAL
+              display.includes('minified') ? StackType.MINIFIED : StackType.ORIGINAL
             }
             stackView={
               display.includes('raw-stack-trace')
-                ? STACK_VIEW.RAW
+                ? StackView.RAW
                 : fullStackTrace
-                ? STACK_VIEW.FULL
-                : STACK_VIEW.APP
+                ? StackView.FULL
+                : StackView.APP
             }
             projectSlug={projectSlug}
             newestFirst={recentFirst}

+ 6 - 6
static/app/components/events/interfaces/exceptionV2.tsx

@@ -1,7 +1,7 @@
 import {t} from 'sentry/locale';
 import {ExceptionType, Group, PlatformType, Project} from 'sentry/types';
 import {EntryType, Event} from 'sentry/types/event';
-import {STACK_TYPE, STACK_VIEW} from 'sentry/types/stacktrace';
+import {StackType, StackView} from 'sentry/types/stacktrace';
 
 import {PermalinkTitle, TraceEventDataSection} from '../traceEventDataSection';
 
@@ -63,7 +63,7 @@ export function ExceptionV2({
     <TraceEventDataSection
       title={<PermalinkTitle>{t('Stack Trace')}</PermalinkTitle>}
       type={EntryType.EXCEPTION}
-      stackType={STACK_TYPE.ORIGINAL}
+      stackType={StackType.ORIGINAL}
       projectSlug={projectSlug}
       eventId={event.id}
       recentFirst={isStacktraceNewestFirst()}
@@ -108,14 +108,14 @@ export function ExceptionV2({
         ) : (
           <ExceptionContent
             stackType={
-              display.includes('minified') ? STACK_TYPE.MINIFIED : STACK_TYPE.ORIGINAL
+              display.includes('minified') ? StackType.MINIFIED : StackType.ORIGINAL
             }
             stackView={
               display.includes('raw-stack-trace')
-                ? STACK_VIEW.RAW
+                ? StackView.RAW
                 : fullStackTrace
-                ? STACK_VIEW.FULL
-                : STACK_VIEW.APP
+                ? StackView.FULL
+                : StackView.APP
             }
             projectSlug={projectSlug}
             newestFirst={recentFirst}

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