diff --git a/config/tsconfig.base.json b/config/tsconfig.base.json index 326841c8574a4a..e837746b45bb24 100644 --- a/config/tsconfig.base.json +++ b/config/tsconfig.base.json @@ -40,6 +40,7 @@ "noImplicitThis": true, "noUnusedLocals": true, "noUnusedParameters": true, + "noUncheckedIndexedAccess": true, "strict": true, "strictBindCallApply": false, "useUnknownInCatchVariables": false, diff --git a/static/app/components/avatarUploader.tsx b/static/app/components/avatarUploader.tsx index 472f4c78bfd531..da52b2c89ff02d 100644 --- a/static/app/components/avatarUploader.tsx +++ b/static/app/components/avatarUploader.tsx @@ -226,7 +226,7 @@ class AvatarUploader extends Component { getDiffSW, } as const; - const diff = helpers['getDiff' + resizeDirection!.toUpperCase()](yDiff, xDiff); + const diff = helpers['getDiff' + resizeDirection!.toUpperCase()]!(yDiff, xDiff); let height = container.clientHeight - oldDimensions.top; let width = container.clientWidth - oldDimensions.left; diff --git a/static/app/views/issueList/groupSearchViewTabs/issueViewTab.tsx b/static/app/views/issueList/groupSearchViewTabs/issueViewTab.tsx index 44a6c8e22fe608..20636e1ee9567e 100644 --- a/static/app/views/issueList/groupSearchViewTabs/issueViewTab.tsx +++ b/static/app/views/issueList/groupSearchViewTabs/issueViewTab.tsx @@ -74,7 +74,7 @@ export function IssueViewTab({ dispatch({type: 'DELETE_VIEW', syncViews: true}); // Including this logic in the dispatch call breaks the tests for some reason // so we're doing it here instead - tabListState?.setSelectedKey(tabs.filter(tb => tb.key !== tab.key)[0].key); + tabListState?.setSelectedKey(tabs.filter(tb => tb.key !== tab.key)[0]!.key); }; const makeMenuOptions = (tab: IssueView): MenuItemProps[] => { diff --git a/static/app/views/issueList/groupSearchViewTabs/issueViews.tsx b/static/app/views/issueList/groupSearchViewTabs/issueViews.tsx index 265117fafc9a18..f21af8a544699a 100644 --- a/static/app/views/issueList/groupSearchViewTabs/issueViews.tsx +++ b/static/app/views/issueList/groupSearchViewTabs/issueViews.tsx @@ -539,7 +539,7 @@ export function IssueViewsStateProvider({ return; } setNewViewActive(false); - const {label, query: newQuery, saveQueryToView} = newViews[0]; + const {label, query: newQuery, saveQueryToView} = newViews[0]!; const remainingNewViews: IssueView[] = newViews.slice(1)?.map(view => { const newId = generateTempViewId(); const viewToTab: IssueView = { diff --git a/static/app/views/issueList/issueViewsHeader.tsx b/static/app/views/issueList/issueViewsHeader.tsx index cd91ed968b2b05..bd554b5a27d37a 100644 --- a/static/app/views/issueList/issueViewsHeader.tsx +++ b/static/app/views/issueList/issueViewsHeader.tsx @@ -202,14 +202,14 @@ function IssueViewsIssueListHeaderTabsContent({ ...location, query: { ...queryParamsWithPageFilters, - query: views[0].query, - sort: views[0].querySort, - viewId: views[0].id, + query: views[0]!.query, + sort: views[0]!.querySort, + viewId: views[0]!.id, }, }), {replace: true} ); - tabListState?.setSelectedKey(views[0].key); + tabListState?.setSelectedKey(views[0]!.key); return; } // if a viewId is present, check if it exists in the existing views. @@ -372,7 +372,7 @@ function IssueViewsIssueListHeaderTabsContent({ ? views.find(tab => tab.id === viewId)!.key : query ? TEMPORARY_TAB_KEY - : views[0].key; + : views[0]!.key; return ( { renderHeadCellWithMeta = (tableMeta: TableData['meta']) => { const columnTitles = this.props.columnTitles ?? COLUMN_TITLES_OPTIONAL_TOOLTIP; return (column: TableColumn, index: number): React.ReactNode => - this.renderHeadCell(tableMeta, column, columnTitles[index]); + this.renderHeadCell(tableMeta, column, columnTitles[index]!); }; renderPrependCellWithData = (tableData: TableData | null) => { diff --git a/static/app/views/performance/transactionSummary/transactionSpans/spanMetricsTable.tsx b/static/app/views/performance/transactionSummary/transactionSpans/spanMetricsTable.tsx index 45d7209ccc1be4..ac00a479b27935 100644 --- a/static/app/views/performance/transactionSummary/transactionSpans/spanMetricsTable.tsx +++ b/static/app/views/performance/transactionSummary/transactionSpans/spanMetricsTable.tsx @@ -168,6 +168,9 @@ export default function SpanMetricsTable(props: Props) { location, sort, }), + // This is now caught by noUncheckedIndexedAccess, ignoring for now as + // it seems related to some nasty grid editable generic. + // @ts-ignore renderBodyCell: renderBodyCell( location, organization, diff --git a/static/app/views/performance/transactionSummary/transactionSpans/spanSummary/spanSummaryTable.tsx b/static/app/views/performance/transactionSummary/transactionSpans/spanSummary/spanSummaryTable.tsx index 9c4bbfb0b1cd73..0b25cc89b0dd46 100644 --- a/static/app/views/performance/transactionSummary/transactionSpans/spanSummary/spanSummaryTable.tsx +++ b/static/app/views/performance/transactionSummary/transactionSpans/spanSummary/spanSummaryTable.tsx @@ -251,6 +251,9 @@ export default function SpanSummaryTable(props: Props) { location, sort, }), + // This is now caught by noUncheckedIndexedAccess, ignoring for now as + // it seems related to some nasty grid editable generic. + // @ts-ignore renderBodyCell: renderBodyCell( location, organization,