Browse Source

style(ts): Sort type keys alphabetically (#31625)

Matej Minar 3 years ago
parent
commit
bb42837000

+ 1 - 1
package.json

@@ -166,7 +166,7 @@
     "babel-plugin-dynamic-import-node": "^2.2.0",
     "csstype": "^3.0.8",
     "eslint": "5.11.1",
-    "eslint-config-sentry-app": "1.73.0",
+    "eslint-config-sentry-app": "1.74.0",
     "eslint-plugin-simple-import-sort": "^6.0.0",
     "html-webpack-plugin": "^5.3.2",
     "jest": "27.0.6",

+ 5 - 5
static/app/__mocks__/api.tsx

@@ -31,13 +31,13 @@ interface MatchCallable {
 }
 
 type ResponseType = ApiNamespace.ResponseMeta & {
-  url: string;
-  statusCode: number;
-  method: string;
-  callCount: 0;
-  match: MatchCallable[];
   body: any;
+  callCount: 0;
   headers: Record<string, string>;
+  match: MatchCallable[];
+  method: string;
+  statusCode: number;
+  url: string;
 };
 
 type MockResponse = [resp: ResponseType, mock: jest.Mock];

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

@@ -4,9 +4,9 @@ import CommitterStore, {getCommitterStoreKey} from 'sentry/stores/committerStore
 import {Committer} from 'sentry/types';
 
 type ParamsGet = {
+  eventId: string;
   orgSlug: string;
   projectSlug: string;
-  eventId: string;
 };
 
 export function getCommitters(api: Client, params: ParamsGet) {

+ 22 - 22
static/app/actionCreators/events.tsx

@@ -16,27 +16,27 @@ import {QueryBatching} from 'sentry/utils/performance/contexts/genericQueryBatch
 
 type Options = {
   organization: OrganizationSummary;
-  project?: Readonly<number[]>;
-  environment?: Readonly<string[]>;
-  team?: Readonly<string | string[]>;
-  period?: string | null;
-  start?: DateString;
-  end?: DateString;
-  interval?: string;
+  partial: boolean;
   comparisonDelta?: number;
+  end?: DateString;
+  environment?: Readonly<string[]>;
+  field?: string[];
+  generatePathname?: (org: OrganizationSummary) => string;
   includePrevious?: boolean;
+  interval?: string;
   limit?: number;
-  query?: string;
-  yAxis?: string | string[];
-  field?: string[];
-  topEvents?: number;
   orderby?: string;
-  partial: boolean;
-  withoutZerofill?: boolean;
-  referrer?: string;
+  period?: string | null;
+  project?: Readonly<number[]>;
+  query?: string;
   queryBatching?: QueryBatching;
   queryExtras?: Record<string, string>;
-  generatePathname?: (org: OrganizationSummary) => string;
+  referrer?: string;
+  start?: DateString;
+  team?: Readonly<string | string[]>;
+  topEvents?: number;
+  withoutZerofill?: boolean;
+  yAxis?: string | string[];
 };
 
 /**
@@ -129,22 +129,22 @@ export const doEventsRequest = (
 
 export type EventQuery = {
   field: string[];
-  equation?: string[];
-  team?: string | string[];
-  project?: string | string[];
-  sort?: string | string[];
   query: string;
-  per_page?: number;
-  referrer?: string;
   environment?: string[];
+  equation?: string[];
   noPagination?: boolean;
+  per_page?: number;
+  project?: string | string[];
+  referrer?: string;
+  sort?: string | string[];
+  team?: string | string[];
 };
 
 export type TagSegment = {
   count: number;
   name: string;
-  value: string;
   url: LocationDescriptor;
+  value: string;
   isOther?: boolean;
   key?: string;
 };

+ 2 - 2
static/app/actionCreators/formSearch.tsx

@@ -6,9 +6,9 @@ import {FormSearchField} from 'sentry/stores/formSearchStore';
 import {Field, JsonFormObject} from 'sentry/views/settings/components/forms/type';
 
 type Params = {
-  route: string;
-  formGroups: JsonFormObject[];
   fields: Record<string, Field>;
+  formGroups: JsonFormObject[];
+  route: string;
 };
 /**
  * Creates a list of objects to be injected by a search source

+ 6 - 6
static/app/actionCreators/group.tsx

@@ -10,13 +10,13 @@ import {uniqueId} from 'sentry/utils/guid';
 
 type AssignedBy = 'suggested_assignee' | 'assignee_selector';
 type AssignToUserParams = {
+  assignedBy: AssignedBy;
   /**
    * Issue id
    */
   id: string;
   user: User | Actor;
   member?: Member;
-  assignedBy: AssignedBy;
 };
 
 export function assignToUser(params: AssignToUserParams) {
@@ -84,12 +84,12 @@ export function clearAssignment(groupId: string, assignedBy: AssignedBy) {
 }
 
 type AssignToActorParams = {
+  actor: Pick<Actor, 'id' | 'type'>;
+  assignedBy: AssignedBy;
   /**
    * Issue id
    */
   id: string;
-  actor: Pick<Actor, 'id' | 'type'>;
-  assignedBy: AssignedBy;
 };
 
 export function assignToActor({id, actor, assignedBy}: AssignToActorParams) {
@@ -179,10 +179,10 @@ export function updateNote(
 }
 
 type ParamsType = {
-  itemIds?: Array<number> | Array<string>;
-  query?: string;
   environment?: string | Array<string> | null;
+  itemIds?: Array<number> | Array<string>;
   project?: Array<number> | null;
+  query?: string;
 };
 
 type UpdateParams = ParamsType & {
@@ -302,8 +302,8 @@ export function bulkDelete(
 }
 
 type BulkUpdateParams = UpdateParams & {
-  failSilently?: boolean;
   data?: any;
+  failSilently?: boolean;
 };
 
 export function bulkUpdate(

+ 5 - 5
static/app/actionCreators/indicator.tsx

@@ -11,22 +11,22 @@ import FormModel, {FieldValue} from 'sentry/views/settings/components/forms/mode
 type IndicatorType = 'loading' | 'error' | 'success' | 'undo' | '';
 
 type Options = {
-  duration?: number;
   append?: boolean;
+  disableDismiss?: boolean;
+  duration?: number;
   modelArg?: {
-    model: FormModel;
     id: string;
+    model: FormModel;
     undo: () => void;
   };
-  disableDismiss?: boolean;
   undo?: () => void;
 };
 
 export type Indicator = {
-  type: IndicatorType;
   id: string | number;
   message: React.ReactNode;
   options: Options;
+  type: IndicatorType;
   clearId?: null | number;
 };
 
@@ -124,8 +124,8 @@ const prettyFormString = (val: ChangeValue, model: FormModel, fieldName: string)
 type ChangeValue = FieldValue | Record<string, any>;
 
 type Change = {
-  old: ChangeValue;
   new: ChangeValue;
+  old: ChangeValue;
 };
 
 /**

+ 4 - 4
static/app/actionCreators/members.tsx

@@ -74,9 +74,9 @@ export function indexMembersByProject(members: Member[]): IndexedMembersByProjec
 }
 
 type UpdateMemberOptions = {
-  orgId: string;
-  memberId: string;
   data: Member | null;
+  memberId: string;
+  orgId: string;
 };
 
 export async function updateMember(
@@ -100,10 +100,10 @@ export async function updateMember(
 }
 
 type ResendMemberInviteOptions = {
-  orgId: string;
   memberId: string;
-  regenerate?: boolean;
+  orgId: string;
   data?: object;
+  regenerate?: boolean;
 };
 
 export async function resendMemberInvite(

+ 15 - 15
static/app/actionCreators/modal.tsx

@@ -40,20 +40,20 @@ export function closeModal() {
 
 type OpenSudoModalOptions = {
   onClose?: () => void;
-  superuser?: boolean;
-  sudo?: boolean;
   retryRequest?: () => Promise<any>;
+  sudo?: boolean;
+  superuser?: boolean;
 };
 
 type emailVerificationModalOptions = {
-  onClose?: () => void;
-  emailVerified?: boolean;
   actionMessage?: string;
+  emailVerified?: boolean;
+  onClose?: () => void;
 };
 
 type inviteMembersModalOptions = {
-  onClose?: () => void;
   initialData?: Partial<InviteRow>[];
+  onClose?: () => void;
   source?: string;
 };
 
@@ -75,10 +75,10 @@ export async function openEmailVerification({
 }
 
 type OpenDiffModalOptions = {
-  targetIssueId: string;
-  project: Project;
   baseIssueId: Group['id'];
   orgId: Organization['id'];
+  project: Project;
+  targetIssueId: string;
   baseEventId?: Event['id'];
   targetEventId?: string;
 };
@@ -95,11 +95,11 @@ type CreateTeamModalOptions = {
    * The organization to create a team for
    */
   organization: Organization;
+  onClose?: (team: Team) => void;
   /**
    * An initial project to add the team to. This may be deprecated soon as we may add a project selection inside of the modal flow
    */
   project?: Project;
-  onClose?: (team: Team) => void;
 };
 
 export async function openCreateTeamModal(options: CreateTeamModalOptions) {
@@ -110,6 +110,7 @@ export async function openCreateTeamModal(options: CreateTeamModalOptions) {
 }
 
 type CreateOwnershipRuleModalOptions = {
+  issueId: string;
   /**
    * The organization to create a rules for
    */
@@ -118,14 +119,13 @@ type CreateOwnershipRuleModalOptions = {
    * The project to create a rules for
    */
   project: Project;
-  issueId: string;
 };
 
 export type EditOwnershipRulesModalOptions = {
+  onSave: (text: string | null) => void;
   organization: Organization;
-  project: Project;
   ownership: IssueOwnership;
-  onSave: (text: string | null) => void;
+  project: Project;
 };
 
 export async function openCreateOwnershipRule(options: CreateOwnershipRuleModalOptions) {
@@ -162,8 +162,8 @@ export async function openRecoveryOptions(options: RecoveryModalOptions) {
 
 export type TeamAccessRequestModalOptions = {
   memberId: string;
-  teamId: string;
   orgId: string;
+  teamId: string;
 };
 
 export async function openTeamAccessRequestModal(options: TeamAccessRequestModalOptions) {
@@ -193,18 +193,18 @@ export async function openHelpSearchModal(options?: HelpSearchModalOptions) {
 }
 
 export type SentryAppDetailsModalOptions = {
-  sentryApp: SentryApp;
   isInstalled: boolean;
   onInstall: () => Promise<void>;
   organization: Organization;
+  sentryApp: SentryApp;
   onCloseModal?: () => void; // used for analytics
 };
 
 type DebugFileSourceModalOptions = {
-  organization: Organization;
-  sourceType: CustomRepoType;
   appStoreConnectSourcesQuantity: number;
   onSave: (data: Record<string, any>) => Promise<void>;
+  organization: Organization;
+  sourceType: CustomRepoType;
   appStoreConnectStatusData?: AppStoreConnectStatusData;
   onClose?: () => void;
   sourceConfig?: Record<string, any>;

+ 4 - 4
static/app/actionCreators/organizations.tsx

@@ -158,9 +158,9 @@ export async function fetchOrganizationByMember(
 
 type FetchOrganizationDetailsParams = {
   /**
-   * Should set as active organization?
+   * Should load projects in ProjectsStore
    */
-  setActive?: boolean;
+  loadProjects?: boolean;
 
   /**
    * Should load teams in TeamStore?
@@ -168,9 +168,9 @@ type FetchOrganizationDetailsParams = {
   loadTeam?: boolean;
 
   /**
-   * Should load projects in ProjectsStore
+   * Should set as active organization?
    */
-  loadProjects?: boolean;
+  setActive?: boolean;
 };
 export async function fetchOrganizationDetails(
   orgId: string,

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