Browse Source

ref(ui): Fix duplicate TS types and JS variable declarations (#28483)

This fixes the issue where we have a TS type alias with the same identifier as a JS variable. This needs to be fixed so we can upgrade `@typescript/eslint` (see https://github.com/getsentry/eslint-config-sentry/pull/105)
Billy Vong 3 years ago
parent
commit
bd864f7d1c

+ 3 - 3
static/app/components/similarScoreCard.tsx

@@ -17,13 +17,13 @@ const scoreComponents = {
   'similarity:*:message:character-5-shingle': t('Log Message'),
 };
 
-type Score = number | null;
+type ScoreValue = number | null;
 
 type Props = {
   // we treat the score list keys as opaque as we wish to be able to extend the
   // backend without having to fix UI. Keys not in scoreComponents are grouped
   // into Other anyway
-  scoreList?: [string, Score][];
+  scoreList?: [string, ScoreValue][];
 };
 
 const SimilarScoreCard = ({scoreList = []}: Props) => {
@@ -72,7 +72,7 @@ const Wrapper = styled('div')`
   margin: ${space(0.25)} 0;
 `;
 
-const Score = styled('div')<{score: Score}>`
+const Score = styled('div')<{score: ScoreValue}>`
   height: 16px;
   width: 48px;
   border-radius: 2px;

+ 1 - 3
static/app/stores/alertStore.tsx

@@ -105,8 +105,6 @@ const storeConfig: AlertStoreInterface & Internals = {
   },
 };
 
-type AlertStore = Reflux.Store & AlertStoreInterface;
-
-const AlertStore = Reflux.createStore(storeConfig) as AlertStore;
+const AlertStore = Reflux.createStore(storeConfig) as Reflux.Store & AlertStoreInterface;
 
 export default AlertStore;

+ 2 - 3
static/app/stores/committerStore.tsx

@@ -102,8 +102,7 @@ export function getCommitterStoreKey(
   return `${orgSlug} ${projectSlug} ${eventId}`;
 }
 
-type CommitterStore = Reflux.Store & CommitterStoreInterface;
-
-const CommitterStore = Reflux.createStore(CommitterStoreConfig) as CommitterStore;
+const CommitterStore = Reflux.createStore(CommitterStoreConfig) as Reflux.Store &
+  CommitterStoreInterface;
 
 export default CommitterStore;

+ 2 - 3
static/app/stores/configStore.tsx

@@ -69,8 +69,7 @@ const configStoreConfig: Reflux.StoreDefinition & ConfigStoreInterface = {
   },
 };
 
-type ConfigStore = Reflux.Store & ConfigStoreInterface;
-
-const ConfigStore = Reflux.createStore(configStoreConfig) as ConfigStore;
+const ConfigStore = Reflux.createStore(configStoreConfig) as Reflux.Store &
+  ConfigStoreInterface;
 
 export default ConfigStore;

+ 1 - 3
static/app/stores/eventStore.tsx

@@ -98,8 +98,6 @@ const storeConfig: Reflux.StoreDefinition & Internals & EventStoreInterface = {
   },
 };
 
-type EventStore = Reflux.Store & EventStoreInterface;
-
-const EventStore = Reflux.createStore(storeConfig) as EventStore;
+const EventStore = Reflux.createStore(storeConfig) as Reflux.Store & EventStoreInterface;
 
 export default EventStore;

+ 2 - 3
static/app/stores/formSearchStore.tsx

@@ -57,8 +57,7 @@ const formSearchStoreConfig: Reflux.StoreDefinition & Internals & StoreInterface
   },
 };
 
-type FormSearchStore = Reflux.Store & StoreInterface;
-
-const FormSearchStore = Reflux.createStore(formSearchStoreConfig) as FormSearchStore;
+const FormSearchStore = Reflux.createStore(formSearchStoreConfig) as Reflux.Store &
+  StoreInterface;
 
 export default FormSearchStore;

+ 2 - 3
static/app/stores/globalSelectionStore.tsx

@@ -37,8 +37,6 @@ type GlobalSelectionStoreInterface = {
   onSave: (data: UpdateData) => void;
 };
 
-type GlobalSelectionStore = Reflux.Store & GlobalSelectionStoreInterface;
-
 const storeConfig: Reflux.StoreDefinition & GlobalSelectionStoreInterface = {
   state: getDefaultSelection(),
 
@@ -162,6 +160,7 @@ const storeConfig: Reflux.StoreDefinition & GlobalSelectionStoreInterface = {
   },
 };
 
-const GlobalSelectionStore = Reflux.createStore(storeConfig) as GlobalSelectionStore;
+const GlobalSelectionStore = Reflux.createStore(storeConfig) as Reflux.Store &
+  GlobalSelectionStoreInterface;
 
 export default GlobalSelectionStore;

+ 1 - 3
static/app/stores/groupStore.tsx

@@ -96,8 +96,6 @@ type GroupStoreInterface = Reflux.StoreDefinition & {
   onPopulateReleases: (itemId: string, releaseData: GroupRelease) => void;
 };
 
-type GroupStore = Reflux.Store & GroupStoreInterface;
-
 const storeConfig: Reflux.StoreDefinition & Internals & GroupStoreInterface = {
   listenables: [GroupActions],
   pendingChanges: new PendingChangeQueue(),
@@ -513,6 +511,6 @@ const storeConfig: Reflux.StoreDefinition & Internals & GroupStoreInterface = {
   },
 };
 
-const GroupStore = Reflux.createStore(storeConfig) as GroupStore;
+const GroupStore = Reflux.createStore(storeConfig) as Reflux.Store & GroupStoreInterface;
 
 export default GroupStore;

+ 2 - 3
static/app/stores/groupingStore.tsx

@@ -171,8 +171,6 @@ type Internals = {
   api: Client;
 };
 
-type GroupingStore = Reflux.Store & GroupingStoreInterface;
-
 const storeConfig: Reflux.StoreDefinition & Internals & GroupingStoreInterface = {
   listenables: [GroupingActions],
   api: new Client(),
@@ -618,6 +616,7 @@ const storeConfig: Reflux.StoreDefinition & Internals & GroupingStoreInterface =
   },
 };
 
-const GroupingStore = Reflux.createStore(storeConfig) as GroupingStore;
+const GroupingStore = Reflux.createStore(storeConfig) as Reflux.Store &
+  GroupingStoreInterface;
 
 export default GroupingStore;

+ 2 - 3
static/app/stores/guideStore.tsx

@@ -249,8 +249,7 @@ const guideStoreConfig: Reflux.StoreDefinition & GuideStoreInterface = {
   },
 };
 
-type GuideStore = Reflux.Store & GuideStoreInterface;
-
-const GuideStore = Reflux.createStore(guideStoreConfig) as GuideStore;
+const GuideStore = Reflux.createStore(guideStoreConfig) as Reflux.Store &
+  GuideStoreInterface;
 
 export default GuideStore;

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