-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(eslint): Enable no-constant-binary-expression and fix violations #83273
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -162,8 +162,9 @@ export function MostRegressedProfileFunctions(props: MostRegressedProfileFunctio | |
|
||
const onChangeTrendType = useCallback(v => setTrendType(v.value), []); | ||
|
||
const hasDifferentialFlamegraphPageFeature = | ||
false && organization.features.includes('profiling-differential-flamegraph-page'); | ||
const hasDifferentialFlamegraphPageFeature = organization.features.includes( | ||
'profiling-differential-flamegraph-page' | ||
); | ||
Comment on lines
+165
to
+167
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
return ( | ||
<RegressedFunctionsContainer> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,22 +41,21 @@ export function getDocsLinkForEventType( | |
event: DataCategoryExact | string // TODO(isabella): get rid of strings after removing need for backward compatibility on gs | ||
) { | ||
switch (event) { | ||
case DataCategoryExact.TRANSACTION || 'transaction': | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should resolve to be It doesn't really matter because the enum value and the string value are the same, so this is a true statement: |
||
case DataCategoryExact.TRANSACTION: | ||
// For pre-AM3 plans prior to June 11th, 2024 | ||
return 'https://docs.sentry.io/pricing/quotas/legacy-manage-transaction-quota/'; | ||
case DataCategoryExact.SPAN || | ||
DataCategoryExact.SPAN_INDEXED || | ||
'span' || | ||
'span_indexed': | ||
Comment on lines
-47
to
-50
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This wasn't working before when the function was called with The case would boil down to be the same as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
case DataCategoryExact.SPAN: | ||
case DataCategoryExact.SPAN_INDEXED: | ||
case 'span_indexed': | ||
// For post-AM3 plans after June 11th, 2024 | ||
return 'https://docs.sentry.io/pricing/quotas/manage-transaction-quota/'; | ||
case DataCategoryExact.ATTACHMENT || 'attachment': | ||
case DataCategoryExact.ATTACHMENT: | ||
return 'https://docs.sentry.io/product/accounts/quotas/manage-attachments-quota/#2-rate-limiting'; | ||
case DataCategoryExact.REPLAY || 'replay': | ||
case DataCategoryExact.REPLAY: | ||
return 'https://docs.sentry.io/product/session-replay/'; | ||
case DataCategoryExact.MONITOR_SEAT || 'monitorSeat': | ||
case DataCategoryExact.MONITOR_SEAT: | ||
return 'https://docs.sentry.io/product/crons/'; | ||
case DataCategoryExact.PROFILE_DURATION || 'profileDuration': | ||
case DataCategoryExact.PROFILE_DURATION: | ||
return 'https://docs.sentry.io/product/explore/profiling/'; | ||
default: | ||
return 'https://docs.sentry.io/product/accounts/quotas/manage-event-stream-guide/#common-workflows-for-managing-your-event-stream'; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,19 +79,17 @@ function Content() { | |
const handleClearSearch = useCallback( | ||
(searchIndex: number) => { | ||
const newQueries = [...queries]; | ||
if (typeof newQueries[searchIndex] !== undefined) { | ||
delete newQueries[searchIndex]; | ||
browserHistory.push({ | ||
...location, | ||
query: { | ||
...location.query, | ||
cursor: undefined, | ||
query: newQueries, | ||
}, | ||
}); | ||
return true; | ||
} | ||
return false; | ||
// TODO: do we need to return false when `newQueries[searchIndex] === undefined`? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't want to 'fix' the existing if-statement because that would cause a change in behavior. But if we need that guard to exist, then it only needs to be |
||
delete newQueries[searchIndex]; | ||
browserHistory.push({ | ||
...location, | ||
query: { | ||
...location.query, | ||
cursor: undefined, | ||
query: newQueries, | ||
}, | ||
}); | ||
return true; | ||
}, | ||
[location, queries] | ||
); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typeof
returns a string, it can never equalundefined
... but it could equal"undefined"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
both
no-constant-binary-expression
andvalid-typeof
would catch this statement.