Skip to content

Commit

Permalink
chore(lint): Apply arrow-body-style as-needed fixes (#17262)
Browse files Browse the repository at this point in the history
  • Loading branch information
evanpurkhiser committed Feb 28, 2020
1 parent 7e11627 commit f7acdaa
Show file tree
Hide file tree
Showing 254 changed files with 2,848 additions and 3,489 deletions.
Expand Up @@ -14,9 +14,7 @@ function getIncidentsFromIncidentResponse(incidents) {
}
log.push({
name: item.name,
updates: item.incident_updates.map(update => {
return update.body;
}),
updates: item.incident_updates.map(update => update.body),
url: item.shortlink,
status: item.status,
});
Expand Down
8 changes: 2 additions & 6 deletions src/sentry/static/sentry/app/actionCreators/tags.jsx
Expand Up @@ -83,9 +83,7 @@ export function loadOrganizationTags(api, orgId, selection) {
method: 'GET',
query,
})
.then(tags => {
return [...BUILTIN_TAGS, ...tags];
});
.then(tags => [...BUILTIN_TAGS, ...tags]);

promise.then(
results => {
Expand Down Expand Up @@ -117,9 +115,7 @@ export function fetchOrganizationTags(api, orgId, projectIds = null) {
method: 'GET',
query,
})
.then(tags => {
return [...BUILTIN_TAGS, ...tags];
});
.then(tags => [...BUILTIN_TAGS, ...tags]);
promise.then(tagFetchSuccess, TagActions.loadTagsError);

return promise;
Expand Down
20 changes: 9 additions & 11 deletions src/sentry/static/sentry/app/api.tsx
Expand Up @@ -192,8 +192,8 @@ export class Client {
openSudo({
superuser: code === SUPERUSER_REQUIRED,
sudo: code === SUDO_REQUIRED,
retryRequest: () => {
return this.requestPromise(path, requestOptions)
retryRequest: () =>
this.requestPromise(path, requestOptions)
.then(data => {
if (typeof requestOptions.success !== 'function') {
return;
Expand All @@ -206,8 +206,7 @@ export class Client {
return;
}
requestOptions.error(err);
});
},
}),
onClose: () => {
if (typeof requestOptions.error !== 'function') {
return;
Expand Down Expand Up @@ -335,13 +334,12 @@ export class Client {
errorThrown
);
},
complete: (jqXHR: JQueryXHR, textStatus: string) => {
return this.wrapCallback<[JQueryXHR, string]>(
complete: (jqXHR: JQueryXHR, textStatus: string) =>
this.wrapCallback<[JQueryXHR, string]>(
id,
options.complete,
true
)(jqXHR, textStatus);
},
)(jqXHR, textStatus),
})
);

Expand Down Expand Up @@ -392,9 +390,9 @@ export class Client {
}

_chain<Args extends any[]>(...funcs: Array<((...args: Args) => any) | undefined>) {
const filteredFuncs = funcs.filter((f): f is (...args: Args) => any => {
return typeof f === 'function';
});
const filteredFuncs = funcs.filter(
(f): f is (...args: Args) => any => typeof f === 'function'
);
return (...args: Args): void => {
filteredFuncs.forEach(func => {
func.apply(funcs, args);
Expand Down
146 changes: 68 additions & 78 deletions src/sentry/static/sentry/app/components/actions/ignore.jsx
Expand Up @@ -151,18 +151,16 @@ export default class IgnoreActions extends React.Component {
isNestedDropdown
alwaysRenderMenu
>
{this.getIgnoreDurations().map(duration => {
return (
<MenuItem noAnchor key={duration}>
<ActionLink
{...actionLinkProps}
onAction={() => this.onIgnore({ignoreDuration: duration})}
>
<Duration seconds={duration * 60} />
</ActionLink>
</MenuItem>
);
})}
{this.getIgnoreDurations().map(duration => (
<MenuItem noAnchor key={duration}>
<ActionLink
{...actionLinkProps}
onAction={() => this.onIgnore({ignoreDuration: duration})}
>
<Duration seconds={duration * 60} />
</ActionLink>
</MenuItem>
))}
<MenuItem divider />
<MenuItem noAnchor>
<a onClick={() => this.setState({modal: 'duration'})}>{t('Custom')}</a>
Expand All @@ -176,44 +174,40 @@ export default class IgnoreActions extends React.Component {
isNestedDropdown
alwaysRenderMenu
>
{this.getIgnoreCounts().map(count => {
return (
<li className="dropdown-submenu" key={count}>
<DropdownLink
title={tn('one time\u2026', '%s times\u2026', count)}
caret={false}
isNestedDropdown
alwaysRenderMenu
>
<MenuItem noAnchor>
{this.getIgnoreCounts().map(count => (
<li className="dropdown-submenu" key={count}>
<DropdownLink
title={tn('one time\u2026', '%s times\u2026', count)}
caret={false}
isNestedDropdown
alwaysRenderMenu
>
<MenuItem noAnchor>
<ActionLink
{...actionLinkProps}
onAction={() => this.onIgnore({ignoreCount: count})}
>
{t('from now')}
</ActionLink>
</MenuItem>
{this.getIgnoreWindows().map(([hours, label]) => (
<MenuItem noAnchor key={hours}>
<ActionLink
{...actionLinkProps}
onAction={() => this.onIgnore({ignoreCount: count})}
onAction={() =>
this.onIgnore({
ignoreCount: count,
ignoreWindow: hours,
})
}
>
{t('from now')}
{label}
</ActionLink>
</MenuItem>
{this.getIgnoreWindows().map(([hours, label]) => {
return (
<MenuItem noAnchor key={hours}>
<ActionLink
{...actionLinkProps}
onAction={() =>
this.onIgnore({
ignoreCount: count,
ignoreWindow: hours,
})
}
>
{label}
</ActionLink>
</MenuItem>
);
})}
</DropdownLink>
</li>
);
})}
))}
</DropdownLink>
</li>
))}
<MenuItem divider />
<MenuItem noAnchor>
<a onClick={() => this.setState({modal: 'count'})}>{t('Custom')}</a>
Expand All @@ -227,44 +221,40 @@ export default class IgnoreActions extends React.Component {
isNestedDropdown
alwaysRenderMenu
>
{this.getIgnoreCounts().map(count => {
return (
<li className="dropdown-submenu" key={count}>
<DropdownLink
title={tn('one user\u2026', '%s users\u2026', count)}
caret={false}
isNestedDropdown
alwaysRenderMenu
>
<MenuItem noAnchor>
{this.getIgnoreCounts().map(count => (
<li className="dropdown-submenu" key={count}>
<DropdownLink
title={tn('one user\u2026', '%s users\u2026', count)}
caret={false}
isNestedDropdown
alwaysRenderMenu
>
<MenuItem noAnchor>
<ActionLink
{...actionLinkProps}
onAction={() => this.onIgnore({ignoreUserCount: count})}
>
{t('from now')}
</ActionLink>
</MenuItem>
{this.getIgnoreWindows().map(([hours, label]) => (
<MenuItem noAnchor key={hours}>
<ActionLink
{...actionLinkProps}
onAction={() => this.onIgnore({ignoreUserCount: count})}
onAction={() =>
this.onIgnore({
ignoreUserCount: count,
ignoreUserWindow: hours,
})
}
>
{t('from now')}
{label}
</ActionLink>
</MenuItem>
{this.getIgnoreWindows().map(([hours, label]) => {
return (
<MenuItem noAnchor key={hours}>
<ActionLink
{...actionLinkProps}
onAction={() =>
this.onIgnore({
ignoreUserCount: count,
ignoreUserWindow: hours,
})
}
>
{label}
</ActionLink>
</MenuItem>
);
})}
</DropdownLink>
</li>
);
})}
))}
</DropdownLink>
</li>
))}
<MenuItem divider />
<MenuItem noAnchor>
<a onClick={() => this.setState({modal: 'users'})}>{t('Custom')}</a>
Expand Down
40 changes: 18 additions & 22 deletions src/sentry/static/sentry/app/components/actions/resolve.tsx
Expand Up @@ -181,17 +181,15 @@ class ResolveActions extends React.Component<Props, State> {
<ActionLink
{...actionLinkProps}
title={t('The next release')}
onAction={() => {
return (
hasRelease &&
onUpdate({
status: ResolutionStatus.RESOLVED,
statusDetails: {
inNextRelease: true,
},
})
);
}}
onAction={() =>
hasRelease &&
onUpdate({
status: ResolutionStatus.RESOLVED,
statusDetails: {
inNextRelease: true,
},
})
}
>
{t('The next release')}
</ActionLink>
Expand All @@ -200,17 +198,15 @@ class ResolveActions extends React.Component<Props, State> {
<ActionLink
{...actionLinkProps}
title={t('The current release')}
onAction={() => {
return (
hasRelease &&
onUpdate({
status: ResolutionStatus.RESOLVED,
statusDetails: {
inRelease: latestRelease ? latestRelease.version : 'latest',
},
})
);
}}
onAction={() =>
hasRelease &&
onUpdate({
status: ResolutionStatus.RESOLVED,
statusDetails: {
inRelease: latestRelease ? latestRelease.version : 'latest',
},
})
}
>
{latestRelease
? t(
Expand Down

0 comments on commit f7acdaa

Please sign in to comment.