Skip to content

Commit

Permalink
🛠️ apply pre-commit fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
getsantry[bot] authored Aug 9, 2024
1 parent ef20f80 commit 967d72f
Show file tree
Hide file tree
Showing 37 changed files with 213 additions and 194 deletions.
6 changes: 3 additions & 3 deletions static/app/components/charts/baseChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ function BaseChartUnwrapped({
//
const eventsMap = useMemo(
() =>
(({
({
click: (props, instance) => {
handleClick(props, instance);
onClick?.(props, instance);
Expand All @@ -616,8 +616,8 @@ function BaseChartUnwrapped({

brush: (props, instance) => onBrushStart?.(props, instance),
brushend: (props, instance) => onBrushEnd?.(props, instance),
brushselected: (props, instance) => onBrushSelected?.(props, instance)
}) as ReactEchartProps['onEvents']),
brushselected: (props, instance) => onBrushSelected?.(props, instance),
}) as ReactEchartProps['onEvents'],
[
onClick,
onHighlight,
Expand Down
4 changes: 3 additions & 1 deletion static/app/components/charts/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,9 @@ export function isMultiSeriesStats(
): data is MultiSeriesEventsStats {
return (
// the isSingleSeriesStats check is for topN queries returning null data
(defined(data) && ((data.data === undefined && data.totals === undefined) || (defined(isTopN) && isTopN && defined(data) && !isSingleSeriesStats(data))))
defined(data) &&
((data.data === undefined && data.totals === undefined) ||
(defined(isTopN) && isTopN && defined(data) && !isSingleSeriesStats(data)))
);
}

Expand Down
6 changes: 3 additions & 3 deletions static/app/components/clippedBox.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ class MockResizeObserver {

function mockGetBoundingClientRect({height}: {height: number}) {
window.HTMLDivElement.prototype.getBoundingClientRect = () =>
(({
({
bottom: 0,
height,
left: 0,
right: 0,
top: 0,
width: 0
}) as DOMRect);
width: 0,
}) as DOMRect;
}

function clearMockGetBoundingClientRect() {
Expand Down
6 changes: 3 additions & 3 deletions static/app/components/deprecatedforms/form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class Form<
const nonFieldErrors = this.state.errors?.non_field_errors;

return (
(<FormContext.Provider value={this.getContext()}>
<FormContext.Provider value={this.getContext()}>
<StyledForm
onSubmit={this.onSubmit}
className={this.props.className}
Expand All @@ -150,7 +150,7 @@ class Form<
<ul>
{nonFieldErrors.map((e, i) => (
// TODO(TS): Objects cannot be rendered to dom
(<li key={i}>{e as any}</li>)
<li key={i}>{e as any}</li>
))}
</ul>
</div>
Expand Down Expand Up @@ -182,7 +182,7 @@ class Form<
{this.props.extraButton}
</div>
</StyledForm>
</FormContext.Provider>)
</FormContext.Provider>
);
}
}
Expand Down
4 changes: 2 additions & 2 deletions static/app/components/events/eventReplay/index.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ jest.mock('sentry/utils/replays/hooks/useReplayOnboarding');
jest.mock(
'sentry/components/events/eventReplay/replayClipPreview',
() =>
(function() {
function () {
return <div data-test-id="replay-clip" />;
})
}
);

const mockEventTimestamp = new Date('2022-09-22T16:59:41Z');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ export function isFrameFilenamePathlike(frame: Frame): boolean {
return (
// If all filenames are anonymous, we do not want to show this alert
// If all absolute paths do not have a file extension, we do not want to show this alert
((frame.filename === '<anonymous>' && frame.inApp) ||
(frame.filename === '<anonymous>' && frame.inApp) ||
// If all function names are on the blocklist, we do not want to show this alert
fileNameBlocklist.includes(frame.function ?? '') || (!!frame.absPath && !getFileExtension(filename)))
fileNameBlocklist.includes(frame.function ?? '') ||
(!!frame.absPath && !getFileExtension(filename))
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -800,13 +800,13 @@ class NewTraceDetailsSpanTree extends Component<PropType> {
spanTree.push({type: SpanTreeNodeType.MESSAGE, element: limitExceededMessage});

return (
(<TraceViewContainer>
<TraceViewContainer>
<WindowScroller onScroll={this.throttledOnScroll}>
{({height, isScrolling, onChildScroll, scrollTop, registerChild}) => (
<AutoSizer disableHeight>
{({width}) => (
// TODO(TS): registerChild expects a ReactNode instead of a HTML ref
(<div ref={el => registerChild(el as any)}>
<div ref={el => registerChild(el as any)}>
<ReactVirtualizedList
autoHeight
isScrolling={isScrolling}
Expand All @@ -820,12 +820,12 @@ class NewTraceDetailsSpanTree extends Component<PropType> {
rowRenderer={props => this.renderRow(props, spanTree)}
ref={listRef}
/>
</div>)
</div>
)}
</AutoSizer>
)}
</WindowScroller>
</TraceViewContainer>)
</TraceViewContainer>
);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ export const Consumer = ScrollbarManagerContext.Consumer;
export const withScrollbarManager = <P extends ScrollbarManagerChildrenProps>(
WrappedComponent: React.ComponentType<P>
) =>
(class extends Component<
class extends Component<
Omit<P, keyof ScrollbarManagerChildrenProps> & Partial<ScrollbarManagerChildrenProps>
> {
static displayName = `withScrollbarManager(${getDisplayName(WrappedComponent)})`;
Expand All @@ -565,4 +565,4 @@ export const withScrollbarManager = <P extends ScrollbarManagerChildrenProps>(
</ScrollbarManagerContext.Consumer>
);
}
});
};
6 changes: 3 additions & 3 deletions static/app/components/feedback/list/useMailboxCounts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default function useMailboxCounts({

return useMemo(
() =>
(({
({
...result,

data: result.data
Expand All @@ -86,8 +86,8 @@ export default function useMailboxCounts({
resolved: result.data[MAILBOX.resolved],
ignored: result.data[MAILBOX.ignored],
}
: undefined
}) as UseApiQueryResult<HookReturnType, RequestError>),
: undefined,
}) as UseApiQueryResult<HookReturnType, RequestError>,
[result, MAILBOX.ignored, MAILBOX.resolved, MAILBOX.unresolved]
);
}
8 changes: 4 additions & 4 deletions static/app/components/forms/fields/radioField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,21 @@ function handleChange(

function RadioField(props: RadioFieldProps) {
return (
(<FormField {...props}>
<FormField {...props}>
{({id, onChange, onBlur, value, disabled, orientInline, ...fieldProps}) => (
// XXX: The label must be present on the role="radiogroup" element. The
// `htmlFor` attribute on the Field label does NOT link to the group.
(<RadioGroup
<RadioGroup
id={id}
choices={fieldProps.choices}
disabled={disabled}
orientInline={orientInline}
label={fieldProps.label}
value={value === '' ? null : value}
onChange={(v, e) => handleChange(v, onChange, onBlur, e)}
/>)
/>
)}
</FormField>)
</FormField>
);
}

Expand Down
8 changes: 4 additions & 4 deletions static/app/components/group/pluginActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ class PluginActionsModal extends Component<ModalProps, ModalState> {
const {actionType} = this.state;

return (
(<Fragment>
<Fragment>
<Header closeButton>
<h4>{tct('[name] Issue', {name: plugin.name || plugin.title})}</h4>
</Header>
Expand All @@ -179,7 +179,7 @@ class PluginActionsModal extends Component<ModalProps, ModalState> {
{actionType && (
// need the key here so React will re-render
// with new action prop
(<Body key={actionType}>
<Body key={actionType}>
{plugins.get(plugin).renderGroupActions({
plugin,
group,
Expand All @@ -188,9 +188,9 @@ class PluginActionsModal extends Component<ModalProps, ModalState> {
actionType,
onSuccess,
})}
</Body>)
</Body>
)}
</Fragment>)
</Fragment>
);
}
}
Expand Down
4 changes: 2 additions & 2 deletions static/app/components/hookOrDefault.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ describe('HookOrDefault', () => {
HookStore.add(
'component:replay-onboarding-cta',
() =>
(function({organization}) {
function ({organization}) {
return <div data-test-id="hook-component">{organization.slug}</div>;
})
}
);

const Component = HookOrDefault({
Expand Down
20 changes: 10 additions & 10 deletions static/app/components/modals/recoveryOptionsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function RecoveryOptionsModal({
}

return (
(<Fragment>
<Fragment>
<Header closeButton>{t('Two-Factor Authentication Enabled')}</Header>
<Body>
<TextBlock>
Expand All @@ -72,22 +72,22 @@ function RecoveryOptionsModal({

{displaySmsPrompt ? (
// set up backup phone number
(<Alert type="warning">
<Alert type="warning">
{t('We recommend adding a phone number as a backup 2FA method.')}
</Alert>)
</Alert>
) : (
// get recovery codes
(<Alert type="warning">
<Alert type="warning">
{t(
`Recovery codes are the only way to access your account if you lose
your device and cannot receive two-factor authentication codes.`
)}
</Alert>)
</Alert>
)}
</Body>
{displaySmsPrompt ? (
// set up backup phone number
(<Footer>
<Footer>
<Button onClick={handleSkipSms} name="skipStep" autoFocus>
{t('Skip this step')}
</Button>
Expand All @@ -101,10 +101,10 @@ function RecoveryOptionsModal({
>
{t('Add a Phone Number')}
</Button>
</Footer>)
</Footer>
) : (
// get recovery codes
(<Footer>
<Footer>
<Button
priority="primary"
onClick={closeModal}
Expand All @@ -118,9 +118,9 @@ function RecoveryOptionsModal({
>
{t('Get Recovery Codes')}
</Button>
</Footer>)
</Footer>
)}
</Fragment>)
</Fragment>
);
}

Expand Down
4 changes: 2 additions & 2 deletions static/app/components/modals/widgetViewerModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ function WidgetViewerModal(props: Props) {
const links = parseLinkHeader(pageLinks ?? null);
const isFirstPage = links.previous?.results === false;
return (
(<Fragment>
<Fragment>
<GridEditable
isLoading={loading}
data={tableResults?.[0]?.data ?? []}
Expand Down Expand Up @@ -682,7 +682,7 @@ function WidgetViewerModal(props: Props) {
}}
/>
)}
</Fragment>)
</Fragment>
);
};

Expand Down
Loading

0 comments on commit 967d72f

Please sign in to comment.