Просмотр исходного кода

fix(ts): Codemod all `sentry/types` warnings (#76150)

Wrote this codemod:
https://gist.github.com/evanpurkhiser/83f2f0098f7b215894342903bd3b02d6

---------

Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
Evan Purkhiser 6 месяцев назад
Родитель
Сommit
a0237e4ce2

+ 1 - 1
static/app/actionCreators/tags.tsx

@@ -6,8 +6,8 @@ import {normalizeDateTimeParams} from 'sentry/components/organizations/pageFilte
 import {t} from 'sentry/locale';
 import AlertStore from 'sentry/stores/alertStore';
 import TagStore from 'sentry/stores/tagStore';
-import type {Tag, TagValue} from 'sentry/types';
 import type {PageFilters} from 'sentry/types/core';
+import type {Tag, TagValue} from 'sentry/types/group';
 import {
   type ApiQueryKey,
   useApiQuery,

+ 1 - 1
static/app/components/assigneeSelectorDropdown.spec.tsx

@@ -16,7 +16,7 @@ import GroupStore from 'sentry/stores/groupStore';
 import MemberListStore from 'sentry/stores/memberListStore';
 import ProjectsStore from 'sentry/stores/projectsStore';
 import TeamStore from 'sentry/stores/teamStore';
-import type {Group} from 'sentry/types';
+import type {Group} from 'sentry/types/group';
 
 jest.mock('sentry/actionCreators/modal', () => ({
   openInviteMembersModal: jest.fn(),

+ 3 - 1
static/app/components/avatarChooser.tsx

@@ -16,7 +16,9 @@ import PanelHeader from 'sentry/components/panels/panelHeader';
 import Well from 'sentry/components/well';
 import {t} from 'sentry/locale';
 import {space} from 'sentry/styles/space';
-import type {AvatarUser, Organization, SentryApp, Team} from 'sentry/types';
+import type {SentryApp} from 'sentry/types/integrations';
+import type {Organization, Team} from 'sentry/types/organization';
+import type {AvatarUser} from 'sentry/types/user';
 import withApi from 'sentry/utils/withApi';
 
 export type Model = Pick<AvatarUser, 'avatar'>;

+ 3 - 3
static/app/components/charts/eventsRequest.tsx

@@ -12,14 +12,14 @@ import {
   isMultiSeriesStats,
 } from 'sentry/components/charts/utils';
 import {t} from 'sentry/locale';
+import type {DateString} from 'sentry/types/core';
+import type {Series, SeriesDataUnit} from 'sentry/types/echarts';
 import type {
-  DateString,
   EventsStats,
   EventsStatsData,
   MultiSeriesEventsStats,
   OrganizationSummary,
-} from 'sentry/types';
-import type {Series, SeriesDataUnit} from 'sentry/types/echarts';
+} from 'sentry/types/organization';
 import {defined} from 'sentry/utils';
 import {DURATION_UNITS, SIZE_UNITS} from 'sentry/utils/discover/fieldRenderers';
 import type {AggregationOutputType} from 'sentry/utils/discover/fields';

+ 1 - 1
static/app/components/charts/groupStatusChart.stories.tsx

@@ -2,7 +2,7 @@ import styled from '@emotion/styled';
 
 import GroupStatusChart from 'sentry/components/charts/groupStatusChart';
 import storyBook from 'sentry/stories/storyBook';
-import type {TimeseriesValue} from 'sentry/types';
+import type {TimeseriesValue} from 'sentry/types/core';
 
 const stats: ReadonlyArray<TimeseriesValue> = [
   [1715554800, 126],

+ 1 - 1
static/app/components/charts/groupStatusChart.tsx

@@ -6,7 +6,7 @@ import MiniBarChart from 'sentry/components/charts/miniBarChart';
 import {LazyRender} from 'sentry/components/lazyRender';
 import Placeholder from 'sentry/components/placeholder';
 import {t} from 'sentry/locale';
-import type {TimeseriesValue} from 'sentry/types';
+import type {TimeseriesValue} from 'sentry/types/core';
 import type {Series} from 'sentry/types/echarts';
 import {formatAbbreviatedNumber} from 'sentry/utils/formatters';
 import theme from 'sentry/utils/theme';

+ 1 - 1
static/app/components/charts/sessionsRequest.tsx

@@ -9,7 +9,7 @@ import type {
   Organization,
   SessionApiResponse,
   SessionFieldWithOperation,
-} from 'sentry/types';
+} from 'sentry/types/organization';
 import {filterSessionsInTimeWindow, getSessionsInterval} from 'sentry/utils/sessions';
 
 const propNamesToIgnore = ['api', 'children', 'organization'];

+ 1 - 1
static/app/components/charts/useChartZoom.tsx

@@ -13,7 +13,7 @@ import {updateDateTime} from 'sentry/actionCreators/pageFilters';
 import DataZoomInside from 'sentry/components/charts/components/dataZoomInside';
 import DataZoomSlider from 'sentry/components/charts/components/dataZoomSlider';
 import ToolBox from 'sentry/components/charts/components/toolBox';
-import type {DateString} from 'sentry/types';
+import type {DateString} from 'sentry/types/core';
 import type {
   EChartChartReadyHandler,
   EChartDataZoomHandler,

+ 2 - 1
static/app/components/charts/utils.tsx

@@ -6,8 +6,9 @@ import orderBy from 'lodash/orderBy';
 import moment from 'moment-timezone';
 
 import {DEFAULT_STATS_PERIOD} from 'sentry/constants';
-import type {EventsStats, MultiSeriesEventsStats, PageFilters} from 'sentry/types';
+import type {PageFilters} from 'sentry/types/core';
 import type {ReactEchartsRef, Series} from 'sentry/types/echarts';
+import type {EventsStats, MultiSeriesEventsStats} from 'sentry/types/organization';
 import {defined, escape} from 'sentry/utils';
 import {getFormattedDate} from 'sentry/utils/dates';
 import type {TableDataWithTitle} from 'sentry/utils/discover/discoverQuery';

+ 1 - 1
static/app/components/commitRow.tsx

@@ -19,8 +19,8 @@ import {IconWarning} from 'sentry/icons';
 import {t, tct} from 'sentry/locale';
 import ConfigStore from 'sentry/stores/configStore';
 import {space} from 'sentry/styles/space';
-import type {AvatarProject} from 'sentry/types';
 import type {Commit} from 'sentry/types/integrations';
+import type {AvatarProject} from 'sentry/types/project';
 import {trackAnalytics} from 'sentry/utils/analytics';
 import useOrganization from 'sentry/utils/useOrganization';
 import {useHasStreamlinedUI} from 'sentry/views/issueDetails/utils';

Некоторые файлы не были показаны из-за большого количества измененных файлов