-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
lint(eslint): Enable no-extra-non-null-assertion and auto-fix violations #83786
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 |
---|---|---|
|
@@ -344,7 +344,7 @@ export default typescript.config([ | |
...react.configs.flat.recommended.rules, | ||
...react.configs.flat['jsx-runtime'].rules, | ||
'react/display-name': 'off', // TODO(ryan953): Fix violations and delete this line | ||
'react/no-unescaped-entities': 'off', // TODO(ryan953): Fix violations and delete this line | ||
'react/no-unescaped-entities': 'off', | ||
'react/no-unknown-property': ['error', {ignore: ['css']}], | ||
'react/prop-types': 'off', // TODO(ryan953): Fix violations and delete this line | ||
}, | ||
|
@@ -418,8 +418,7 @@ export default typescript.config([ | |
'@typescript-eslint/ban-ts-comment': 'off', // TODO(ryan953): Fix violations and delete this line | ||
'@typescript-eslint/no-array-constructor': 'off', // TODO(ryan953): Fix violations and delete this line | ||
'@typescript-eslint/no-empty-object-type': 'off', // TODO(ryan953): Fix violations and delete this line | ||
'@typescript-eslint/no-explicit-any': 'off', // TODO(ryan953): Fix violations and delete this line | ||
'@typescript-eslint/no-extra-non-null-assertion': 'off', // TODO(ryan953): Fix violations and delete this line | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
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.
|
||
'@typescript-eslint/no-namespace': 'off', // TODO(ryan953): Fix violations and delete this line | ||
'@typescript-eslint/no-non-null-asserted-optional-chain': 'off', // TODO(ryan953): Fix violations and delete this line | ||
'@typescript-eslint/no-require-imports': 'off', // TODO(ryan953): Fix violations and delete this line | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -668,7 +668,7 @@ describe('WaterfallModel', () => { | |
|
||
expected[1] = { | ||
type: 'out_of_view', | ||
span: fullWaterfall[1]!!.span, | ||
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. Here's an example of the automation fixing some earlier automation. |
||
span: fullWaterfall[1]!.span, | ||
} as EnhancedProcessedSpanType; | ||
|
||
expected[4] = { | ||
|
@@ -696,7 +696,7 @@ describe('WaterfallModel', () => { | |
}, | ||
{ | ||
type: 'out_of_view', | ||
span: fullWaterfall[1]!!.span, | ||
span: fullWaterfall[1]!.span, | ||
}, | ||
fullWaterfall[2], | ||
fullWaterfall[3], | ||
|
@@ -884,7 +884,7 @@ describe('WaterfallModel', () => { | |
{ | ||
...fullWaterfall[1]!, | ||
span: { | ||
...fullWaterfall[1]!!.span, | ||
...fullWaterfall[1]!.span, | ||
parent_span_id: (event.entries[0] as any).data[0]!.span_id, | ||
span_id: 'foo', | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,14 +79,14 @@ function getLegendProps(showLegend?: boolean): Pick<BaseChartProps, 'legend' | ' | |
// But for now we keep it here to not invluence the bundle size of the main chunks. | ||
echarts.use(CanvasRenderer); | ||
|
||
function isNonZeroValue(value: number | null) { | ||
return value !== null && value !== 0; | ||
function isNonZeroValue(value: number | undefined) { | ||
return value !== undefined && value !== 0; | ||
} | ||
|
||
function addSeriesPadding(data: Series['data']) { | ||
const hasNonZeroSibling = (index: number) => { | ||
return ( | ||
isNonZeroValue(data[index - 1]!?.value) || isNonZeroValue(data[index + 1]!?.value) | ||
isNonZeroValue(data[index - 1]?.value!) || isNonZeroValue(data[index + 1]?.value) | ||
); | ||
}; | ||
const paddingIndices = new Set<number>(); | ||
|
@@ -142,11 +142,11 @@ export const MetricChart = memo( | |
} | ||
}); | ||
|
||
const bucketSize = series[0]!?.data[1]!?.name - series[0]!?.data[0]!?.name; | ||
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 is a good example where a manual fix was needed... Before we had Now we have one |
||
const bucketSize = series[0]?.data[1]?.name! - series[0]?.data[0]?.name!; | ||
const isSubMinuteBucket = bucketSize < 60_000; | ||
const lastBucketTimestamp = series[0]!?.data?.[series[0]!?.data?.length - 1]!?.name; | ||
const lastBucketTimestamp = series[0]?.data[series[0]?.data.length - 1]?.name; | ||
const ingestionBuckets = useMemo( | ||
() => getIngestionDelayBucketCount(bucketSize, lastBucketTimestamp), | ||
() => getIngestionDelayBucketCount(bucketSize, lastBucketTimestamp!), | ||
[bucketSize, lastBucketTimestamp] | ||
); | ||
|
||
|
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.
This isn't going to happen. I tried and it's not worth it right now: #83511