Skip to content
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

ref(tsc) enable nouncheckedindexedaccess #82857

Merged
merged 9 commits into from
Jan 3, 2025
1 change: 1 addition & 0 deletions config/tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"noImplicitThis": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noUncheckedIndexedAccess": true,
"strict": true,
"strictBindCallApply": false,
"useUnknownInCatchVariables": false,
Expand Down
2 changes: 1 addition & 1 deletion static/app/components/avatarUploader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ class AvatarUploader extends Component<Props, State> {
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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[] => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
10 changes: 5 additions & 5 deletions static/app/views/issueList/issueViewsHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -372,7 +372,7 @@ function IssueViewsIssueListHeaderTabsContent({
? views.find(tab => tab.id === viewId)!.key
: query
? TEMPORARY_TAB_KEY
: views[0].key;
: views[0]!.key;

return (
<DraggableTabList
Expand Down
2 changes: 1 addition & 1 deletion static/app/views/performance/table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ class _Table extends Component<Props, State> {
renderHeadCellWithMeta = (tableMeta: TableData['meta']) => {
const columnTitles = this.props.columnTitles ?? COLUMN_TITLES_OPTIONAL_TOOLTIP;
return (column: TableColumn<keyof TableDataRow>, index: number): React.ReactNode =>
this.renderHeadCell(tableMeta, column, columnTitles[index]);
this.renderHeadCell(tableMeta, column, columnTitles[index]!);
};

renderPrependCellWithData = (tableData: TableData | null) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading